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
- Create `.vscode/mcp.json` in your workspace.
- Add servers under `servers`, each with `type` (`stdio`, `http` or `sse`).
- 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
{
"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