Home / Guides / MCP servers in VS Code

MCP servers in VS Code with GitHub Copilot

VS Code has two MCP configuration formats now. New setups for the Copilot harness use a portable file with a top-level mcpServers object: .mcp.json at the workspace root for a team, or ~/.copilot/mcp-config.json for you. The older .vscode/mcp.json with a servers object belongs to the Local harness, which Microsoft has deprecated and plans to remove in February 2027.

Checked against Add and use MCP servers in VS Code and the MCP configuration reference on November 28, 2026. This area is changing quickly.

Add a server without editing JSON

  1. Select Copilot in a chat session, run Chat: Open Customizations from the Command Palette and pick MCP Servers, then Add Server. MCP: Add Server starts the same guided flow.
  2. Choose HTTP and paste the endpoint for a hosted server, or Command (stdio) and paste the launch command for a local one, such as npx -y @playwright/mcp@latest.
  3. Give it a unique ID (no spaces; camelCase for several words) and pick where it is saved: Global > Copilot Global for you, or the workspace-root .mcp.json to share it.
  4. Accept the trust prompt only for a server you have checked, then ask for a small task and expand the tool call to confirm it was the server that answered.

Which file to use

GoalFile
A server for you, in every workspace~/.copilot/mcp-config.json (or $COPILOT_HOME/mcp-config.json). Also read by Copilot CLI on the same machine.
A server the whole team gets with the repo.mcp.json at the workspace root. Claude Code reads the same file for its project scope.
Keep an existing older setup working for now.vscode/mcp.json or the profile mcp.json (Local harness, deprecated)

In remote and Dev Container sessions the personal file is read on the host where Copilot runs, not copied from your laptop.

The portable format

{
  "mcpServers": {
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"],
      "tools": ["*"]
    },
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}
FieldUse
typestdio for a command, http for Streamable HTTP, sse for an older SSE endpoint. Microsoft suggests HTTP when a server offers it.
command, args, env, cwdLocal servers. Install the runtime (Node, Python, Docker) where Copilot runs.
url, headersHosted servers.
toolsWhich tools to expose; ["*"] is all. It does not skip tool approvals.
oauthClientIdFor a server that needs a pre-registered OAuth client.

Coming from .vscode/mcp.json

Portable (.mcp.json, mcp-config.json)Older editor format (.vscode/mcp.json)
Top-level keymcpServersservers
Environment variables${NAME} or ${NAME:-default}${env:NAME}
Prompted inputs, envFileNot supported${input:...} and envFile
Dev mode, per-server sandboxNot in this formatdev, sandboxEnabled, sandbox

VS Code can forward eligible .vscode/mcp.json entries to a Copilot session, but entries that use ${input:...} or ${command:...} are rejected, and envFile and sandbox rules do not carry over. Rewriting the entry in the portable format is the durable fix. code --add-mcp still writes the older format.

Keys and tokens

Do not commit tokens or filled-in auth headers. A personal config file is not a secret store either. Put the value in the environment of the machine that runs the server and reference it with the braced ${NAME} form (a bare $NAME is read as literal text). Use OAuth where the server supports it.

.mcp.json entries for popular servers

Built from each server's entry in the official MCP Registry, the same as on their Socketlist pages. Data as of November 11, 2026. Replace anything in <angle brackets>.

playwright-mcp score 90

{
  "mcpServers": {
    "playwright-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@playwright/mcp"
      ]
    }
  }
}

Context7 score 90

{
  "mcpServers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}"
      }
    }
  }
}

Chrome DevTools MCP score 95

{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}

GitHub score 80

{
  "mcpServers": {
    "github": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p",
        "127.0.0.1:8085:8085",
        "-e",
        "GITHUB_OAUTH_CALLBACK_PORT=8085",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN=<token>",
        "ghcr.io/github/github-mcp-server:2.1.0"
      ]
    }
  }
}

Every listed server has its .mcp.json entry on its own page. Companies on Copilot Business or Enterprise can restrict which servers run: see the Copilot MCP allowlist. Before connecting anything to real data, use the security checklist.