Free toolGenerate .mcp.json configs for Claude Code, Cursor & Codex →
G

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.

Step-by-step guideHow to add an MCP server to GitHub Copilot in VS Code →The full walkthrough with verification and troubleshooting. This page is the quick config reference.

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 use mcpServers; Codex uses TOML tables.
  • If npx isn't found, the app may not see your shell's PATH (common with nvm). Use the full path to npx.
  • Restart the agent or reload the window after editing.
Generate your config →

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