VS Code has built-in MCP client support — you don't need a separate extension to connect an MCP server to GitHub Copilot's agent mode. The mechanism is a single JSON config file, mcp.json, which you can place in one of two spots: .vscode/mcp.json inside your project (checked into source control so your whole team gets the same servers), or your user profile via the MCP: Open User Configuration command, which applies across every workspace you open.
The config file structure
Every server entry lives under a top-level servers object, keyed by a name you choose. A local server you spawn yourself uses "type": "stdio" with a command and args; a remote server you're only connecting to uses "type": "http" with a url. Both forms can coexist in the same file:
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp"
},
"playwright": {
"command": "npx",
"args": ["-y", "@microsoft/mcp-server-playwright"]
}
}
}
VS Code provides IntelliSense (autocomplete and validation) while you edit this file, since it ships a JSON schema for the format. The first time a configured server starts, VS Code shows a trust dialog — you have to explicitly confirm you trust the server and its capabilities before it runs, and individual tool calls it makes typically still need per-call confirmation in the Chat view unless you're running a sandboxed server on macOS/Linux, which gets auto-approval because it's already confined to a restricted environment.
Adding a server through the UI
Rather than hand-editing JSON, you can run the MCP: Add Server command from the Command Palette, which walks you through picking a server type and filling in the command or URL, then writes the entry into either the workspace or user mcp.json for you.
| Config location | Scope | Typical use |
|---|---|---|
.vscode/mcp.json |
This project only, shared via git | Project-specific tools (e.g. a server that talks to this repo's own API) |
| User profile | Every workspace you open | Personal tools you want everywhere (e.g. a GitHub or Playwright server) |
Once a server is trusted and running, its tools appear directly in Copilot Chat's agent mode — you don't invoke them by name, you just describe what you want and the model decides which registered tool to call, the same way it would call any built-in capability.
Practical Challenge
Create a .vscode/mcp.json in a test project with one stdio server (e.g. the official filesystem or fetch reference server) and confirm it shows up as an available tool source in Copilot Chat's agent mode after you approve the trust prompt.
Concept Check
.vscode/mcp.json is the project-scoped location — commit it so teammates get the same server list automatically..vscode/, and one user-profile location for cross-workspace servers.Sources & Further Reading
- Add and manage MCP servers in VS Code — official guide to
mcp.jsonlocations, adding servers via the UI, and the trust/approval flow. - MCP configuration reference — the full
mcp.jsonschema, including theservers,inputs, and sandboxing options.
AI