VS Code supports MCP servers through GitHub Copilot's agent mode. You can add them from the command palette or by editing a JSON file. Here is the quick setup.
Step 1 — enable agent mode
Open the Copilot Chat view and switch the mode selector to Agent. MCP tools are only available in agent mode, not in plain chat.
Step 2 — add a server
Two options:
- Command palette — run MCP: Add Server, pick the type (stdio/HTTP), and follow the prompts. VS Code scaffolds the config for you.
- Edit the file — workspace servers live in
.vscode/mcp.json; user-level servers go in yoursettings.jsonunder anmcpblock.
A filesystem example for .vscode/mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"]
}
}
}
Note VS Code uses servers (not mcpServers) as the key. See MCP config file location for how each client differs.
Step 3 — start and use
VS Code shows a Start action on the server. Click it, then in Copilot agent mode open the tools picker and enable the server's tools. Ask the agent to use them.
Prerequisites
Node 18+ for npx servers; Python 3.10+ with uv for Python servers.
Common problems
- Tools missing — you are not in agent mode (step 1), or the server is not started.
spawn npx ENOENT— PATH issue; use an absolute path tonpx. See Cursor MCP not working (same fix).- Secrets in config — use input variables / env rather than hardcoding tokens; see MCP security best practices.
Going further
Browse popular servers — GitHub, Postgres, Playwright — or ready-made loadouts.