How to add MCP servers to GitHub Copilot in VS Code
Explore with AI
To add an MCP server to GitHub Copilot, run MCP: Add Server in VS Code from the Command Palette, or edit .vscode/mcp.json in your workspace and add an entry under servers. An HTTP server needs a type and url; a stdio server needs a command and args. Use Configure Tools in the Copilot chat input to turn its tools on or off.
To add an MCP server to GitHub Copilot, run MCP: Add Server from VS Code’s Command Palette, or add the server under servers in .vscode/mcp.json. An HTTP server needs a type and a url; a local server needs the command that starts it. Then use Configure Tools in the Copilot chat input to choose which of its tools Copilot can use.
MCP, the Model Context Protocol, is how GitHub Copilot’s chat and agent mode in VS Code call tools outside your editor. Copilot reads its servers from VS Code’s MCP config. The steps below follow VS Code’s MCP documentation.
1. Pick workspace or user config
| File | Use it for |
|---|---|
.vscode/mcp.json in the workspace | Servers for this project. Commit it so the team gets the same tools. |
mcp.json in your user profile | Servers you want in every workspace. Open it with MCP: Open User Configuration. |
VS Code also reads a portable .mcp.json at the workspace root, which uses mcpServers in place of servers.
2. Add a server with the guided flow
Open the Command Palette and run MCP: Add Server. Choose Command (stdio) for a program VS Code starts on your machine, or HTTP for a remote server, then give it an ID and choose where to save it. The flow writes the same JSON you would write by hand.
3. Or write the JSON yourself
A remote server needs type and url; a local one needs type, command and args:
{
"servers": {
"polylane": {
"type": "http",
"url": "https://mcp.polylane.com/mcp"
},
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@playwright/mcp"]
}
}
}
Avoid hardcoding API keys in the file. VS Code supports input variables and environment files for secrets, so the version you commit holds a reference and the value stays on your machine.
4. Trust and confirmation
Workspace servers inherit Workspace Trust, so in a trusted workspace they start without a separate prompt. For servers that don’t come from your trusted workspace, VS Code asks when a server first starts or its configuration changes. Decline and the server doesn’t start; Copilot carries on without its tools.
You might be asked to confirm each tool invocation. Read the first few: it is the quickest way to learn what a server actually does.
5. Choose which tools Copilot can use
Select Configure Tools in the Copilot chat input to see every server’s tools and turn them on or off. Fewer tools means less for the model to choose between, so turn off the ones a project doesn’t need.
The first server in the example is Polylane’s. It lets GitHub Copilot debug production: logs, traces and deploys from every provider you connect, through one HTTP server.
Using GitHub Copilot? See how to give GitHub Copilot production context with Polylane.
Common questions.
Where does GitHub Copilot read MCP servers from?
From VS Code's MCP config: .vscode/mcp.json for the workspace, under a top-level servers object, and in the mcp.json of your user profile, which MCP: Open User Configuration opens.
How do I add an MCP server without editing JSON?
Run MCP: Add Server from the Command Palette. It walks you through choosing Command (stdio) or HTTP, a server ID and where to save it.
How do I keep API keys out of mcp.json?
Don't hardcode them. VS Code's docs recommend input variables or environment files, so the file you commit holds a reference and the secret stays on your machine.
Will Copilot run MCP tools without asking?
You might be asked to confirm each tool invocation. Configure Tools in the chat input shows each server's tools and lets you turn them on or off.
Why didn't my MCP server start?
For a server that doesn't come from your trusted workspace, VS Code asks the first time it starts or when its config changes. If you decline, it doesn't start and chat continues without its tools.
Boris Tane is the founder of Polylane. He previously founded Baselime, observability for the future of the cloud, which Cloudflare acquired. At Cloudflare he built and led the Workers observability team.
More in this series
Using coding agents: Claude Code, Cursor, Codex and more
- 1 How to use Claude Code: a practical guide
- 2 How to add MCP servers to Cursor
- 3 How to use Codex CLI: install, AGENTS.md, MCP and exec
- 4 How to use OpenCode: install, plan and build, MCP
- 5 How to add MCP servers to GitHub Copilot in VS Code
- 6 How to use the Pi coding agent
Related
- Railway activity feed filters and cron jobs in the CLI Railway's 16 October 2026 update: filter the activity feed by service, list and trigger cron runs with railway cron, and migrate railway.json to IaC.
- Cloudflare Tunnel: 50,000 routes and Tunnels for Platforms Cloudflare raised Tunnel routes to 50,000 per account on 16 October 2026 and launched Tunnels for Platforms at $4.50 a tunnel. Limits, setup and gotchas.
- How to deploy Vite apps to Cloudflare with Void Void, announced by Cloudflare on 15 October 2026, deploys Vite apps to Workers in one command. Setup steps, secrets, migrations, CI and the gotchas.
- CloudWatch log centralisation: GovCloud and 13 new Regions AWS added CloudWatch log centralisation to GovCloud (US) and 13 commercial Regions on 16 October 2026. Setup steps, pricing, limits and gotchas.
- How to Monitor a Next.js App on Render Monitor a Next.js app on Render: a health route that checks the database, JSON logs with Rndr-Id, onRequestError, OpenTelemetry traces, streams and alerts.