---
title: "VS Code (GitHub Copilot) MCP config: file path, key, example · DotsAgent"
description: "Add MCP servers to VS Code (GitHub Copilot) from Microsoft: where the config file lives, the top-level key and format, remote OAuth support and a sample config."
url: https://dotsagent.io/mcp/clients/vscode-copilot
---

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**: 

## Example config

This example adds GitHub's hosted server and Playwright as a local server, in the shape this client expects.

`.vscode/mcp.json`

```
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

`shell`

```
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 →](https://dotsagent.io/mcp/config#client=vscode-copilot)

## Other clients

[Claude Desktop](https://dotsagent.io/mcp/clients/claude-desktop)

[Claude Code](https://dotsagent.io/mcp/clients/claude-code)

[Cursor](https://dotsagent.io/mcp/clients/cursor)

[Windsurf / Devin Desktop](https://dotsagent.io/mcp/clients/windsurf)

[Zed](https://dotsagent.io/mcp/clients/zed)

[OpenAI Codex CLI](https://dotsagent.io/mcp/clients/codex-cli)

[Gemini CLI](https://dotsagent.io/mcp/clients/gemini-cli)

[ChatGPT](https://dotsagent.io/mcp/clients/chatgpt)

[OpenClaw](https://dotsagent.io/mcp/clients/openclaw)

[Cline](https://dotsagent.io/mcp/clients/cline)

[Continue](https://dotsagent.io/mcp/clients/continue)

[JetBrains AI Assistant](https://dotsagent.io/mcp/clients/jetbrains-ai)

## Sources

1. [code.visualstudio.com](https://code.visualstudio.com/docs/copilot/reference/mcp-configuration)/docs/copilot/reference/mcp-configuration
2. [code.visualstudio.com](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)/docs/copilot/customization/mcp-servers

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
