Skip to content

Latest commit

 

History

History
196 lines (158 loc) · 9.7 KB

vscode.md

File metadata and controls

196 lines (158 loc) · 9.7 KB
description Connect GitHub Copilot in VS Code to Loom's MCP memory server. Save project decisions and recall them in any chat or editor that shares the namespace.
seo
title
Shared MCP memory for GitHub Copilot in VS Code

Connect GitHub Copilot in VS Code to Loom's MCP memory server

GitHub Copilot in VS Code can save and retrieve project decisions through Loom's MCP server over streamable HTTP. Connect clients to the same Loom server and give them access to the same namespace to share those decisions.

There is no VS Code extension: the loom_* tools are the integration, with no session capture or code shunt; the Claude Code and Codex plugins have those.

In VS Code, each chat runs on an agent harness, picked in its Session Target control before the first prompt. Use Copilot: the Local harness is deprecated. The Copilot harness reads its own MCP configuration, mcp-config.json (the file Copilot CLI uses), not the editor profile's mcp.json; VS Code forwards eligible editor-profile entries to it.

The Copilot steps below follow the linked VS Code documentation. No Copilot session has been run against Loom, so the token expansion in its configuration file and whether the harness offers the tools to the model are untested; verify the connection before relying on it.

Check for an existing entry

In a new chat, select Copilot in the Session Target control before the first prompt, then run Chat: Open Customizations and open MCP Servers. VS Code forwards eligible editor entries, such as the one the install links or loom install write or one copied from the dashboard, so Loom may already be listed. Add a Copilot entry only when no listed loom entry points at your server: through the session's MCP settings for a local server, or the Copilot configuration file.

Local single-user server

Use the tokenless setup when the Copilot harness can reach your single-user Loom server at localhost:7777 from the machine or container where the harness runs. Otherwise, use the Copilot configuration file with an authenticated Loom server the harness can reach.

In a chat with Copilot selected as the Session Target, run Chat: Open Customizations, open MCP Servers, and select Add Server in the User group (adding an MCP server). Choose HTTP and enter http://localhost:7777/mcp, or http://localhost:7777/mcp?toolset=coding if the session uses the code index (choosing a toolset). Enter loom as the server ID, select Global → Copilot Global, and review and accept the server trust request when VS Code shows it. If Copilot Global is missing, check the Copilot harness requirements. You can also use the Copilot configuration file with the local URL and omit headers for a tokenless server.

Install links for the editor profile

Add Loom to VS Code · Add Loom to VS Code Insiders

The links open the server details in VS Code. Review the configuration and select Install. Both links carry this server configuration:

{ "name": "loom", "type": "http", "url": "http://localhost:7777/mcp" }

To install directly from a terminal, run:

code --add-mcp '{"name":"loom","type":"http","url":"http://localhost:7777/mcp"}'

Both methods add servers.loom to the editor profile's mcp.json. The dashboard's VS Code entry under Settings → Tokens has the same shape (type: "http" and url) with your server's URL and a token header.

Remote or authenticated server

On the host running the Copilot harness, add the entry below to mcpServers in $COPILOT_HOME/mcp-config.json, or ~/.copilot/mcp-config.json if COPILOT_HOME is unset. For a remote session, edit the file on the remote host or in the container where the harness runs. Replace https://loom.example.com with your server URL. Set LOOM_API_KEY to your Loom token in the environment of the host that runs the harness so the token stays out of the file. If you change that environment, quit VS Code and open it again (the Agent Host, the process that runs the harness, can keep running when only the project window closes), or restart the remote session, so the harness sees the variable.

{
  "mcpServers": {
    "loom": {
      "type": "http",
      "url": "https://loom.example.com/mcp?toolset=coding",
      "headers": { "Authorization": "Bearer ${LOOM_API_KEY}" },
      "tools": ["*"]
    }
  }
}

This is the file and entry GitHub Copilot CLI uses. The Copilot CLI plugin registers its own loom entry at localhost:7777, which a user entry named loom does not replace; to use another server, uninstall the plugin first. See the Copilot configuration reference for other destinations and authentication options. The GitHub Copilot cloud agent is configured in the repository's settings instead: see hosted builders.

Editor profile entry

loom install writes the literal bearer token into the editor's mcp.json:

loom install --client vscode --server-url https://loom.example.com --token "$LOOM_API_KEY" --toolset coding

This merges a servers.loom entry into the mcp.json of the VS Code Stable default profile at the standard user data location. The entry has no input prompt, so VS Code can also forward it to the Copilot harness.

For a named profile, VS Code Insiders, or a different user data location:

  1. Copy the dashboard's VS Code entry. It carries your server's URL and token; add ?toolset=coding to its url for a session that uses the code index.
  2. Open the intended profile and run MCP: Open User Configuration. It opens that profile's editor-managed mcp.json, not the Copilot file.
  3. Add the entry under servers, keeping the other entries.

Editor entries that use ${input:...} prompts are not forwarded to the Copilot harness. For sessions that read the editor's mcp.json directly, such as the deprecated Local harness, this form keeps the token out of the file: VS Code prompts for it once and stores it.

{
  "servers": {
    "loom": {
      "type": "http",
      "url": "https://loom.example.com/mcp?toolset=coding",
      "headers": { "Authorization": "Bearer ${input:loom-token}" }
    }
  },
  "inputs": [
    { "id": "loom-token", "type": "promptString", "password": true, "description": "Loom token" }
  ]
}

Verify the connection

In a chat with Copilot as the Session Target and Agent selected in the agent picker (the read-only Ask agent cannot call the write tools in step 3):

  1. Run Chat: Open Customizations, open MCP Servers and select the loom entry. Check that the URL points to your Loom server and that the entry comes from the intended file: for a Copilot Global entry, use Other Properties to open its source JSON (mcp-config.json under $COPILOT_HOME or ~/.copilot); a forwarded editor entry appears as read-only JSON from the editor profile's mcp.json.
  2. Ask the agent to call loom_activate from that server. Expand the tool call and confirm which server answered and that it returned the Loom session primer. If the tool is missing, check the chat's Session Target and where you saved the entry. If the tool call fails with 401, check the token the entry sends (for the Copilot file, that LOOM_API_KEY is set on the host where the harness runs), then see checking the connection.
  3. Ask it to save a test fact with loom_memory_set under a key you choose, read it back with loom_memory_get, check the value, and delete it with loom_memory_delete.

To check that a second authorized client can retrieve a saved decision, run the two-session memory check.

Agent instructions

Add the agent instructions block to .github/copilot-instructions.md so the agent knows when to call the tools, unless the repository's AGENTS.md already carries it. The block names the coding toolset's tools: connect with ?toolset=coding on url; otherwise the tools it names that the listing leaves out run through loom_op, as the block says.

Related