MCP
VS Code
Copilot
2026

How to Set Up MCP in VS Code with GitHub Copilot

Add MCP servers to Visual Studio Code and supercharge GitHub Copilot's agent mode

March 4, 20267 min read

Prerequisites

  • VS Code 1.99+ or VS Code Insiders
  • GitHub Copilot extension installed and active
  • Node.js 18+ installed (for npx-based MCP servers)
  • GitHub Copilot agent mode enabled

Step 1: Create the MCP Configuration File

VS Code reads MCP server configurations from .vscode/mcp.json in your workspace root.

// .vscode/mcp.json
{
  "servers": {
    "github": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_your_token_here" }
    },
    "filesystem": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-filesystem", "${workspaceFolder}"]
    },
    "postgres": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-postgres"],
      "env": { "DATABASE_URL": "postgresql://localhost:5432/mydb" }
    }
  }
}

Step 2: Enable Agent Mode in Copilot Chat

MCP tools are available in Copilot's Agent Mode. Open Copilot Chat (Ctrl+Shift+I) and select the Agent mode dropdown. Your configured MCP servers will appear as available tools.

Step 3: Use MCP Tools in Chat

"List all open issues in this repo" → Copilot uses the GitHub MCP server

"Show me the database schema for the users table" → Uses PostgreSQL MCP server

"Read the deployment config file" → Uses Filesystem MCP server

VS Code Settings for MCP

// settings.json — User or Workspace settings
{
  "chat.mcp.enabled": true,
  "chat.mcp.discovery.enabled": true
}

These settings enable MCP support and auto-discovery of .vscode/mcp.json files.

VS Code vs Cursor vs Claude Code: MCP Comparison

FeatureVS Code + CopilotCursorClaude Code
Config file.vscode/mcp.json.cursor/mcp.json.claude.json
GUI setupYesYesCLI only
Agent modeCopilot AgentComposerAlways-on
Auto-approve toolsAsk each timeConfigurableConfigurable
AI Skills supportLimited.cursorrulesSKILL.md

Browse MCP Servers for VS Code

Find verified MCP servers compatible with VS Code and Copilot

Browse MCPs