GitHub / Microsoft · VS Code agent mode · JetBrains, Visual Studio & others · Copilot CLI · Copilot coding agent (github.com)
GitHub Copilot config file: where it lives & format
GitHub Copilot MCP config file: where .vscode/mcp.json lives, its format and copy-paste examples. For the full walkthrough, see the step-by-step guide.
1. Find the config file
.vscode/mcp.json (workspace; labeled deprecated in the guided flow, still supported)User-profile mcp.json (same label).mcp.json at the workspace root (portable, mcpServers; experimental in MCP: Add Server)
VS Code uses a top-level "servers" key (not "mcpServers") and an explicit "type": "stdio" | "http".
2. Add a local (stdio) server
Example: Context7, which runs locally with npx.
.vscode/mcp.json{
"servers": {
"context7": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp"
]
}
}
}
3. Add a remote (HTTP) server
Example: Notion's hosted server. You sign in with OAuth the first time it connects.
.vscode/mcp.json{
"servers": {
"notion": {
"type": "http",
"url": "https://mcp.notion.com/mcp"
}
}
}
4. If it won't connect
- Validate the file. One trailing comma breaks the whole file.
- Check the top-level key: VS Code uses
servers; Claude Code, Cursor and Antigravity usemcpServers; Codex uses TOML tables. - If
npxisn't found, the app may not see your shell's PATH (common with nvm). Use the full path tonpx. - Restart the agent or reload the window after editing.
Adding MCP servers in VS Code safely
In VS Code, run MCP: Add Server from the Command Palette (Ctrl+Shift+P, or Shift+Cmd+P on Mac). The picker can browse the MCP server gallery, add a server from an NPM package, Pip package or Docker image, or discover configurations already set up in another application. Your organization can restrict which servers are available.
VS Code's docs warn that local MCP servers can run code on your machine and tools act with your permissions. When adding a package, review the package name, version and publisher in the confirmation and select Allow only if you trust the source, then review the generated command, arguments and credential requirements before accepting trust or tool approval prompts. Never paste credentials into chat.
The guided flow labels workspace .vscode/mcp.json and the user-profile mcp.json as deprecated but still supported; use them when you need input variables or per-server sandboxing. The newer destination is a workspace-root .mcp.json, offered when the experimental chat.mcp.workspaceRootConfig.enabled setting is on.
Source: code.visualstudio.com · Checked Oct 24, 2026
Frequently asked questions
.vscode/mcp.json (workspace; labeled deprecated in the guided flow, still supported) or User-profile mcp.json (same label) or .mcp.json at the workspace root (portable, mcpServers; experimental in MCP: Add Server).
Guides, pricing & comparisons
How to add an MCP server to GitHub Copilot in VS Code
Portable agent skills: one SKILL.md for every coding agent
GitHub Copilot CLI yolo mode: --allow-all and safer tool rules
Agent Skills moves to the Agentic AI Foundation: what changes
MCP security: the risks in MCP servers and how to lock them down
GitHub Copilot CLI: install, sign in and start using it
GitHub Copilot coding agent (now cloud agent): how to use it
GitHub Copilot agent mode: how to use it in your IDE
GitHub Copilot skills: create, install and use agent skills
Fix spawn npx ENOENT when starting an MCP server
MCP connection closed: find why a server will not connect
Claude Code vs GitHub Copilot: documented features compared
Cursor vs GitHub Copilot: documented features compared
OpenAI Codex vs GitHub Copilot: documented features compared
GitHub Copilot pricing and AI credits
AGENTS.md vs CLAUDE.md vs Cursor rules
AGENTS.md templates for Laravel and Next.js
MCP servers that work in every coding agent