MCP server

/

Coding assistants

VS Code

Installing Spectron as an MCP server in VS Code.

VS Code supports MCP servers through the GitHub Copilot extension (version 1.99 or later with agent mode enabled) and through compatible AI extensions that implement the MCP client protocol.

  • VS Code 1.99 or later

  • GitHub Copilot extension with agent mode enabled, or another MCP-compatible VS Code extension

To enable Copilot agent mode: open VS Code settings, search for github.copilot.chat.agent.enabled, and set it to true.

The MCP server lives at /mcp on your Spectron instance. On SurrealDB Cloud the base is your context host from Surrealist API keys; self-hosted, it is your server's base URL. Point VS Code at it with install-mcp:

npx install-mcp https://<your-context-host>/mcp \
  --client vscode \
  --header "Authorization: Bearer <your-api-key>" \
  --oauth no

The URL is the first argument; auth is passed with --header, and --oauth no skips the OAuth prompt (Spectron uses a static Bearer key). The installer writes the configuration to .vscode/mcp.json in your current working directory, which makes the MCP server available to everyone who opens the workspace — suitable for shared team projects.

To make the server available in every workspace instead, add the same entry to your global VS Code config by hand (see the paths below).

ScopePath
Workspace.vscode/mcp.json (relative to your project root)
Global (macOS)~/Library/Application Support/Code/User/mcp.json
Global (Windows)%APPDATA%\Code\User\mcp.json
Global (Linux)~/.config/Code/User/mcp.json

.vscode/mcp.json (workspace):

{
  "servers": {
    "spectron": {
      "type": "http",
      "url": "https://<your-context-host>/mcp",
      "headers": {
        "Authorization": "Bearer <your-api-key>",
        "X-Spectron-Context": "acme-prod"
      }
    }
  }
}

VS Code uses the servers key (rather than mcpServers) and requires a type field. The install-mcp command handles this difference automatically.

The .vscode/mcp.json file can be committed to your repository so the team shares the same MCP server configuration. The API key should not be committed directly. Instead, use a VS Code input variable to prompt for the key at runtime:

{
  "inputs": [
    {
      "id": "spectronApiKey",
      "type": "promptString",
      "description": "Spectron API key",
      "password": true
    }
  ],
  "servers": {
    "spectron": {
      "type": "http",
      "url": "https://<your-context-host>/mcp",
      "headers": {
        "Authorization": "Bearer ${input:spectronApiKey}",
        "X-Spectron-Context": "acme-prod"
      }
    }
  }
}

VS Code will prompt each developer for their API key the first time they use the MCP server in the workspace.

  1. Open VS Code and the workspace

  2. Open the Copilot chat panel (Ctrl+Shift+I or Cmd+Shift+I)

  3. Switch to Agent mode using the mode selector in the chat panel

  4. Type @spectron or ask: "What MCP servers are available?"

  5. Copilot should acknowledge the Spectron tools

Alternatively, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run MCP: List Servers to see the status of all configured MCP servers including Spectron.

In Copilot agent mode:

"Remember that we use Prisma for all database access in this project and that direct SQL queries are not permitted outside of migration scripts."

Copilot calls remember. The decision persists across VS Code sessions and is recalled the next time you ask a database-related question.

Before asking Copilot to refactor a module:

"What do you know about the design decisions behind the authentication module?"

Copilot calls recall, retrieves the relevant context, and incorporates it into its refactoring suggestions.

If your team's documentation is synced into Spectron's knowledge base:

"What does our architecture decision record say about the API gateway pattern?"

Copilot calls recall and returns the relevant ADR content.

Keep memory isolated per repository by passing a scope argument on each tool call (for example ["org/acme/project/platform-v3"]), or by using separate Spectron contexts. The install helper does not set default scope headers.

Delete the "spectron" entry from .vscode/mcp.json (workspace) or from the global mcp.json file. VS Code will stop offering the Spectron tools in subsequent sessions.

Was this page helpful?