Microsoft
Add MCP servers to VS Code (GitHub Copilot)
VS Code reads .vscode/mcp.json in the workspace, a user-profile mcp.json, or the newer portable .mcp.json files.
- macOS
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- Windows
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- Linux
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- Project file
.vscode/mcp.json (key 'servers') or portable .mcp.json (key 'mcpServers')- Top-level key
servers- Format
- json
- OAuth for remote servers
- Yes
Example config
This example adds GitHub's hosted server and Playwright as a local server, in the shape this client expects.
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"playwright": {
"type": "stdio",
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
code --add-mcp '{"name":"github","type":"http","url":"https://api.githubcopilot.com/mcp/"}'
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
Notes and quirks
- .vscode/mcp.json uses the key servers; the portable .mcp.json and ~/.copilot/mcp-config.json use mcpServers.
- A top-level inputs array prompts you for secrets, so keys stay out of the file.
- The guided Add server flow now marks .vscode/mcp.json and the user-profile file as deprecated in favour of the portable files. Both still work.
- VS Code also discovers servers already set up for Claude Desktop, Copilot CLI, Cursor and Windsurf.
- code --add-mcp adds a server from a JSON string.
Build a VS Code (GitHub Copilot) config →
Other clients
Claude DesktopClaude CodeCursorWindsurf / Devin DesktopZedOpenAI Codex CLIGemini CLIChatGPTOpenClawClineContinueJetBrains AI Assistant