Setup guide

How to add an MCP server to VS Code

VS Code (Copilot agent mode) reads `.vscode/mcp.json`. Its schema differs from every other client: servers sit under `servers`, not `mcpServers`, and each needs a `type`.

Where the config lives

  • Workspace: .vscode/mcp.json
  • User: MCP: Open User Configuration (command palette)

Servers go under the servers key.

What VS Code can run

  • Local servers (stdio)
  • Remote servers (HTTP)
  • Remote servers (SSE)

504 of the 508 servers in the catalog run natively in VS Code.

Step by step

  1. Create `.vscode/mcp.json` in your workspace.
  2. Add servers under `servers`, each with `type` (`stdio`, `http` or `sse`).
  3. Click the ▶ Start action that appears above the entry, then use Copilot Chat in agent mode.

Reloading: Use the Start / Restart code lens above each server entry.

Example: the Filesystem server in VS Code

The official reference server for file access. Replace the directory with the folder you want the assistant to see.

Create .vscode/mcp.json

json
{
  "servers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/directory"
      ]
    }
  }
}

Troubleshooting

A config copied from Cursor or Claude does nothing
VS Code wants `servers` (not `mcpServers`) and an explicit `type` on every entry.
`npx` is not found, or the server exits immediately on Windows
Windows launches `npx` through cmd. Use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "<package>"]`, and make sure Node.js 18+ is on the PATH of the user the client runs as.
`SyntaxError` or `Unsupported engine` when the server starts
Most MCP servers need Node.js 18 or newer (`node -v`). If you use nvm, the client may not see your shell's Node: point `command` at the absolute path of `npx`.
The server starts but every tool call fails with 401 or 403
Its API key is missing or wrong. Put it in the server's `env` block (or the header for remote servers) — never in a file you commit.

Official documentation: VS Code MCP docs

Setting up several servers at once?

Tick them in the catalog and the setup builder merges them into one VS Code config.

Open the setup builder for VS Code

Best MCP servers for VS Code

The highest health scores among servers that run natively in VS Code.

See every server that runs in VS Code →