Skip to main content
Guide1 min read

VS Code MCP setup: add servers to Copilot (2026)

Add MCP servers to VS Code and use them in Copilot agent mode. The .vscode/mcp.json file, the Add Server command, and a working example.

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 your settings.json under an mcp block.

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 to npx. 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.

Loadout

Build your AI agent loadout

The directory of MCP servers and AI agents that actually work. Pick the right loadout for Slack, Postgres, GitHub, Figma and 20+ integrations — with install commands ready to paste into Claude Desktop, Cursor or your own stack.

© 2026 Loadout. Built on Angular 21 SSR.