How to add MCP servers to VS Code with GitHub Copilot
VS Code now runs Copilot chat on the Copilot harness. It reads MCP servers in the same mcpServers format most other apps use. The older .vscode/mcp.json file with a servers key belongs to the Local harness, which is deprecated and will be removed in February 2027.
Checked against the official docs on 2026-11-26. Apps change often; the sources are linked at the bottom.
Where the config file lives
| Your servers, all workspaces (Copilot Global) | ~/.copilot/mcp-config.json (or $COPILOT_HOME/mcp-config.json) |
| Shared with a workspace | .mcp.json at the workspace root |
| Old format (deprecated Local harness) | .vscode/mcp.json or the profile mcp.json, with a "servers" key |
| Top-level key | mcpServers |
Add a remote server (a URL)
- Open the MCP servers list
With Copilot selected in chat, run Chat: Open Customizations from the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS) and select MCP Servers. Select Add Server (+) in the User group. - Choose HTTP and enter the URL
For a first test, VS Code's docs suggest the free Microsoft Learn server:https://learn.microsoft.com/api/mcp. Enter a server ID such asmicrosoftLearn. - Pick where to save it
Choose Global → Copilot Global for yourself, or the workspace-root.mcp.jsonto share with a team (the guided flow offers it only while the experimentalchat.mcp.workspaceRootConfig.enabledsetting is on; you can always create the file yourself). Accept the trust prompt if you trust the server. - Or edit the file yourself
Remote servers use"type": "http".{ "mcpServers": { "context7": { "type": "http", "url": "https://mcp.context7.com/mcp", "tools": ["*"] } } }
Add a local server (runs on your computer)
- Add a command (stdio) server
In the same Add Server flow, choose Command (stdio) and enter the launch command, for examplenpx -y @playwright/mcp@latest. Or add it to the file:{ "mcpServers": { "playwright": { "type": "stdio", "command": "npx", "args": ["-y", "@playwright/mcp@latest"], "tools": ["*"] } } } - Pass secrets as environment variable references
Use${NAME}(or${NAME:-default}) inenv,argsor headers, and set the variable on your computer. Don't paste real keys into shared files."env": { "API_KEY": "${MY_API_KEY}" }
Tips
- Test it: ask Copilot to use the server for a small task, then expand the tool call to confirm it really ran.
- Editor-only fields such as
inputs,envFileandsandboxEnabledbelong to the old.vscode/mcp.jsonformat, so don't copy them intomcpServersfiles. - Moving from
.vscode/mcp.json: see "servers" vs "mcpServers". - Since VS Code 1.147 (November 18, 2026), Skills over MCP is on by default: a server can provide skills to the model. The first time you connect to such a server, VS Code asks before adding its skills to the model's context; they then appear on the Skills tab of the Agent Customizations editor. To opt out, turn off the
chat.agentHost.mcpSkills.enabledsetting. - Since VS Code 1.148 (November 25, 2026), MCP Apps have a fullscreen button that moves the app into the editor area (or the Secondary Side Bar in the Agents window).
Common problems in VS Code (GitHub Copilot)
- VS Code ignores my MCP config ("servers" vs "mcpServers")
- MCP servers fail on Windows with npx (use cmd /c)
- Too many MCP tools: trimming tools in Cursor, VS Code, Codex and Devin Desktop
- Remote MCP server says "Needs authentication" or 401 after it used to work