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": {
"praxen": {
"type": "http",
"url": "https://mcp.getpraxen.app/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 Praxen Inc.’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 Praxen Inc..
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.
About the author
Founder of Praxen Inc.
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
- How to correlate incidents with deploys using evidence Learn how to correlate incidents with deploys using release markers, metrics, logs and verified GitHub, Vercel, Cloudflare and Kubernetes change events.
- What is change intelligence? A production safety guide What is change intelligence? Learn how deploys, config, flags, infrastructure and dependency changes connect to incidents, using tools you already have.
- Turn your app into a context graph Agents that run software need a context graph of the app: every resource, what it connects to, the repository that deploys it and the team that owns it. How we built one on Durable Objects, keep it fresh across every provider without polling AWS, decide what counts as a change, and delete from it safely.
- How to use Claude Code to debug production issues Debug production issues with Claude Code: get logs and traces into the session, test hypotheses against evidence, stay read-only and ship a verified fix.
- Is it safe to give an AI SRE read access to production? Read access for an AI SRE is a sound first step if you scope it. The risks are secrets, customer data and exfiltration. Here are the controls and a checklist.