Add MCP servers in VS Code
VS Code supports MCP servers in GitHub Copilot chat. Its config uses a servers object (not mcpServers) and an explicit type.
Updated Oct 15, 2026 · 1 source
§1Config files
| Scope | File | Top-level key |
|---|---|---|
| Workspace (portable) | .mcp.json at workspace root | mcpServers |
| Workspace (VS Code features) | .vscode/mcp.json | servers |
| User | ~/.copilot/mcp-config.json (or $COPILOT_HOME) | mcpServers |
| User profile | mcp.json via "MCP: Open User Configuration" | servers |
{
"servers": {
"github": { "type": "http", "url": "https://api.githubcopilot.com/mcp" },
"playwright": { "command": "npx", "args": ["-y", "@microsoft/mcp-server-playwright"] }
}
}§2Other ways to add a server
- Extensions view → search
@mcp→ Install (user profile) or Install in Workspace. - Command Palette → "MCP: Add Server" for a guided flow (stdio command or HTTP URL).
- CLI:
code --add-mcp "{\"name\":\"my-server\",\"command\":\"uvx\",\"args\":[\"mcp-server-fetch\"]}" - Auto-discovery of configs from Claude Desktop, Cursor and others via the
chat.mcp.discovery.enabledsetting.
§3Trust and sandboxing
Workspace MCP servers inherit Workspace Trust; other servers get a trust prompt when they first start or their config changes. On macOS and Linux you can set "sandboxEnabled": true on a stdio server to restrict its file system and network access.
Build a .vscode/mcp.json from any of our servers in the Config Builder — pick the VS Code tab.
§4FAQ
- What is the VS Code MCP config file?
- .vscode/mcp.json in the workspace (top-level servers object), or a portable .mcp.json at the workspace root (top-level mcpServers object).
- Can VS Code sandbox MCP servers?
- Yes, on macOS and Linux. Set sandboxEnabled: true on a stdio server and add a sandbox object to grant specific file or network access. Not available on Windows.
§5Sources
Sources checked Oct 15, 2026. Spot something out of date? Tell us.