How to Install MCP Servers in VS Code (GitHub Copilot)
How to add MCP servers to VS Code for GitHub Copilot agent mode — the .vscode/mcp.json file, the servers key, and enabling tools in Copilot Chat.
Where the config lives
- Workspace
.vscode/mcp.json in your project root - User
the "mcp" section of your VS Code user settings.json
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
}
}
}Step by step
- 1
Create the MCP config
Run "MCP: Add Server" from the Command Palette, or create .vscode/mcp.json in your project. Note that VS Code nests servers under a "servers" key — not "mcpServers" like other clients.
- 2
Add the server definition
Add a named entry with a "command" and "args". For secrets, use VS Code "inputs" so the value is prompted for and stored securely instead of hard-coded in the file.
- 3
Enable it in Copilot agent mode
Open Copilot Chat and switch to Agent mode, then start the server from the MCP prompt. The tools become available for Copilot to call during agent tasks.
Popular MCP servers to try in VS Code (GitHub Copilot)
Frequently asked questions
How do I add an MCP server to VS Code?
Create a .vscode/mcp.json in your project (or run "MCP: Add Server" from the Command Palette) and add the server under a "servers" key. MCP tools are used from GitHub Copilot Chat in Agent mode.
Why does VS Code use "servers" instead of "mcpServers"?
VS Code adopted its own schema and nests MCP servers under a "servers" key, with support for a separate "inputs" array for prompted secrets. If you copy a config from Claude or Cursor, rename "mcpServers" to "servers".
Do I need Copilot agent mode to use MCP in VS Code?
Yes — MCP tools are invoked from Copilot Chat in Agent mode. Make sure you have Copilot enabled and select Agent mode before expecting the server tools to be called.