VS Code now supports MCP servers natively through GitHub Copilot’s agent mode. If you have been using MCP servers in Claude Desktop or Claude Code and want the same capabilities inside your editor, the setup is simpler than you might expect. Edit a JSON config, restart Copilot, and your MCP tools show up in chat.

This guide walks through adding your first server, running multiple servers together, handling secrets, and fixing the problems that trip people up most often.

Prerequisites

Before you start:

  • VS Code 1.99+ installed. MCP support shipped in April 2025 and has been stable since the 1.100 release cycle.
  • GitHub Copilot extension installed and active. You need a Copilot subscription (Individual, Business, or Enterprise).
  • Node.js 18+ if you plan to use npm-distributed MCP servers. Run node --version to check.
  • Agent mode enabled in Copilot Chat. Open the Copilot chat panel and look for the mode dropdown — select “Agent” instead of “Ask” or “Edit.”

Adding your first MCP server

VS Code stores MCP server configuration in a JSON settings file. You have two options for where to put it:

Workspace-level (recommended for project-specific servers): Create a .vscode/mcp.json file in your project root.

User-level (for servers you want everywhere): Add to your VS Code settings.json under the mcp key.

Here is a workspace-level example using the filesystem MCP server:

// .vscode/mcp.json
{
  "servers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "${workspaceFolder}"
      ]
    }
  }
}

Save the file. VS Code will detect the change and show a notification to start the server. Click “Start” or reload the window with Cmd+Shift+P > “Developer: Reload Window.”

Verifying the connection

Open the Copilot chat panel in agent mode. Type a message that would require the server’s tools — for the filesystem server, try “list the files in my project root.”

If the server is connected, Copilot will call the MCP tool and show the results inline. You will see a tool call indicator in the chat response showing which MCP tool was invoked.

You can also check server status in the Output panel. Open it with Cmd+Shift+U and select “MCP” from the dropdown. This shows connection logs, tool registrations, and any errors.

stdio vs HTTP servers

MCP servers come in two flavors, and VS Code handles both.

stdio servers run as local processes. VS Code spawns them, sends JSON-RPC over stdin/stdout, and manages the lifecycle. Most MCP servers on npm use this transport. The config above is a stdio example.

HTTP servers run as standalone services (local or remote) and communicate over Streamable HTTP. Use these when the server needs to persist between sessions or when you are connecting to a remote service:

{
  "servers": {
    "my-remote-server": {
      "type": "http",
      "url": "http://localhost:3001/mcp"
    }
  }
}

For HTTP servers, make sure the server is running before you try to connect from VS Code. VS Code will not start it for you.

Useful servers to start with

These servers work well in VS Code and cover common developer workflows:

Filesystem lets Copilot read, write, and search files outside the current workspace. Handy when you need it to pull context from another project.

GitHub gives you issue and PR management right from chat. Requires a GitHub personal access token (see the secrets section below for how to handle that safely).

{
  "servers": {
    "github": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github-pat}"
      }
    }
  }
}

The ${input:github-pat} syntax prompts you for the token when the server starts, so you do not have to hardcode secrets in the config file.

Postgres connects Copilot to your database so it can write SQL, inspect schemas, and explain query results without leaving the editor.

Memory gives Copilot persistent memory across chat sessions using a local knowledge graph. Useful if you find yourself re-explaining project context every time you open a new chat.

Context7 pulls current documentation for libraries and frameworks, so Copilot references actual APIs instead of whatever it absorbed during training.

Running multiple servers

You can configure as many servers as you need. Each gets its own entry in the servers object:

{
  "servers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"]
    },
    "github": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github-pat}"
      }
    }
  }
}

Copilot’s agent mode will pick the right server for each request. If you ask it to “create a GitHub issue for the bug in app.ts,” it will use the GitHub server for the issue and the filesystem server to read the file.

Environment variables and secrets

Never put API keys directly in your MCP config files, especially if the config is committed to version control. VS Code supports several approaches:

Input variables prompt at startup:

"env": {
  "API_KEY": "${input:my-api-key}"
}

Environment file references pull from a .env file in your workspace. Add the .env to your .gitignore.

System environment variables work if the key is already set in your shell profile. The MCP server process inherits the environment from VS Code.

Troubleshooting

Server does not start. Check the Output panel under “MCP” for error messages. Most of the time it is a missing dependency. Run the server command manually in your terminal first to rule out VS Code-specific issues. If you are behind a corporate proxy, that can also block npx from reaching the npm registry.

Tools do not appear in chat. Make sure you are in Agent mode, not Ask or Edit mode. The mode dropdown is at the top of the Copilot chat panel. MCP tools only work in agent mode.

Server crashes after a few seconds. Some servers expect specific arguments or environment variables. Check the server’s README for required configuration. The Postgres server, for example, needs a connection string passed as an argument.

“Command not found” errors. This one catches a lot of people on macOS. VS Code does not always inherit your shell PATH, so it cannot find npx even though it works fine in your terminal. Either set terminal.integrated.env.osx in your VS Code settings or use the full path to npx in your MCP config.

Server works but Copilot ignores it. Copilot picks tools based on relevance to your prompt. Be specific in your requests. Instead of “help me with my database,” try “query the users table for records created this week.”

FAQ

Q: Do I need GitHub Copilot to use MCP servers in VS Code? A: Yes. MCP support lives inside Copilot’s agent mode. No subscription, no MCP.

Q: Can I use the same MCP servers I configured for Claude Desktop? A: The servers themselves are the same, but the config file format differs. Claude Desktop uses claude_desktop_config.json with a slightly different schema. You will need to recreate the configuration in VS Code’s format, but the server packages and arguments are identical.

Q: Is there a limit to how many MCP servers I can run? A: No hard limit. Each stdio server runs as its own process, though, so ten or more running at once will start eating RAM. Add servers as you need them rather than configuring a dozen upfront.