How to Use MCP with VS Code

VS Code added native MCP server support in version 1.99 (April 2025), bringing the same external tool connectivity that Cursor and Claude Desktop offer to the world’s most widely used code editor. With MCP in VS Code, GitHub Copilot’s chat can query your database while you write queries, fetch GitHub issues while you implement features, or search internal documentation without leaving the editor. This guide covers how to configure MCP servers in VS Code, which servers add the most value to a coding workflow, and how the VS Code implementation differs from other MCP clients.

MCP in VS Code: How It Works

VS Code’s MCP support integrates with GitHub Copilot Chat — the AI chat panel built into the editor. When MCP servers are configured, their tools become available to Copilot in chat sessions and in Copilot Edits (the multi-file editing mode, VS Code’s equivalent of Cursor Composer). The AI decides when to call a tool based on the conversation context, the same way it does in Claude Desktop and Cursor. Tool calls are visible in the chat as collapsible blocks showing what was called and what was returned, maintaining transparency about where information came from.

VS Code’s MCP implementation has one important difference from Cursor’s: it requires GitHub Copilot to be active (Individual, Business, or Enterprise subscription). The MCP tools are exposed to Copilot’s models rather than being available to any AI provider. For teams already using Copilot, this is no friction at all. For developers who prefer Claude or other models as their primary AI assistant in VS Code, this means MCP tools only work in Copilot Chat, not in third-party AI extensions.

Configuring MCP Servers in VS Code

MCP servers in VS Code are configured through the settings UI or directly in settings.json. There are three configuration scopes:

  • User settings (~/.vscode/settings.json or via Settings UI) — available in all workspaces for the current user
  • Workspace settings (.vscode/settings.json in the project root) — available only in that workspace, committable to the repository
  • Remote settings — for VS Code Remote (SSH, Dev Containers, Codespaces) where servers need to run on the remote machine

In settings.json, MCP servers go under the github.copilot.chat.mcp.servers key. Each server entry specifies the type (stdio is the most common), the command, its arguments, and any environment variables. The structure is similar to Claude Desktop and Cursor configs with minor syntax differences — if you already have servers configured in another client, adapting the config to VS Code takes a few minutes.

Figure 1 — MCP config: same servers, three clients

Config location Claude Desktop Cursor VS Code Global / userclaude_desktop_config.json~/.cursor/mcp.jsonUser settings.json Project / workspaceN/A.cursor/mcp.json.vscode/settings.json AI integrationClaude (all models)Any modelGitHub Copilot only Restart needed?Yes, after config changeUsually noReload window

Enabling and Verifying MCP in VS Code

Before MCP servers will work, confirm that MCP support is enabled in VS Code settings. Search for “mcp” in the Settings UI and check that github.copilot.chat.mcp.enabled is true — it defaults to true in recent versions but may be false in older installations or enterprise-managed settings. After adding a server to settings.json, reload the VS Code window (Ctrl+Shift+P → “Developer: Reload Window”) and open Copilot Chat. Type a slash in the chat input and look for the MCP tool names in the autocomplete — their presence confirms the server connected successfully.

If a server does not appear, the Output panel (View → Output → GitHub Copilot) shows MCP connection logs. The most common issues are the same as in other MCP clients: the server command is not found because Node.js is not in the PATH that VS Code uses at launch (different from the terminal PATH on some systems), or environment variables are not being passed correctly. Adding explicit full paths to the command (e.g. /usr/local/bin/npx instead of npx) resolves most PATH issues.

Using MCP Tools in Copilot Chat

Once servers are connected, invoke their tools in Copilot Chat by describing what you need naturally — you do not need to name specific tools. “What tables are in the database?” triggers the database MCP server’s schema inspection tool. “Search for the current API reference for Prisma v6 migrations” triggers the web search server. “What does issue #89 say about the expected behaviour?” triggers the GitHub server.

In Copilot Edits (the multi-file editing mode), MCP tools work the same way as in chat. A Copilot Edits session that starts with “implement the feature in issue #89 following our database patterns” can fetch the issue, inspect the relevant database tables, and generate code that matches both the specification and the actual data model. This is the same workflow that makes Cursor Composer with MCP powerful — the difference is that it now works within VS Code without requiring a tool switch.

MCP in Dev Containers and Codespaces

VS Code’s remote development features (Dev Containers, GitHub Codespaces, Remote SSH) add a consideration for MCP: servers need to run in the same environment as the code. For a Dev Container, stdio MCP servers must be installed and runnable inside the container, not on the host machine. The workspace .vscode/settings.json config is available inside the container, but a server that launches via npx requires Node.js to be present in the container image.

The practical approach for Dev Container teams: add MCP server installation to the container’s postCreateCommand or Dockerfile, and use workspace settings to configure the servers so they are available to everyone who opens the container. This way, any developer who opens the project in a Dev Container or Codespace gets the full MCP integration without any manual setup beyond supplying their personal API keys as environment variables.

Team Deployment Considerations

For teams deploying MCP across all developers’ VS Code instances, the workspace settings approach works well — commit .vscode/settings.json with the server definitions but without API keys, and document how to supply the keys via environment variables or a local settings override. VS Code’s settings hierarchy allows personal overrides without touching the committed config: a developer can add their API keys to user settings or a local .env file without modifying the project config that others rely on.

Enterprise VS Code deployments managed via group policy or MDM should check that the github.copilot.chat.mcp.enabled setting has not been administratively disabled before investing time in server configuration — some enterprise Copilot deployments restrict MCP access at the policy level. Check with your IT or security team if servers are configured correctly but the tools do not appear in Copilot Chat.

MCP vs Built-in Copilot Context

VS Code’s Copilot already has built-in context sources — the open editor, the workspace file tree, terminal output, and GitHub-specific context in enterprise plans. MCP servers extend this to external systems. The distinction matters for deciding when MCP is actually needed: if Copilot’s built-in context covers your use case (asking about the currently open file, referring to workspace files, reading terminal output), MCP is not necessary. MCP adds the most value for external data sources that Copilot cannot reach natively — a separate database, a web search for current information, an internal tool or documentation system. Evaluate each potential MCP server against what Copilot already provides before adding it, to keep the server list focused on genuine additions rather than redundancy.

MCP support in VS Code brings the same external tool connectivity that was previously a differentiator for Cursor and Claude Desktop to the editor that most developers already use. The setup is slightly more involved than in Cursor (particularly around environment variable management and the Copilot-only restriction), but the core capability is equivalent: an AI that can reach outside the open project to query databases, fetch issues, search the web, and access internal tools. For teams standardised on VS Code who want richer AI assistance without switching editors, MCP is the most direct path to getting it.

MCP and Copilot Instructions Working Together

VS Code’s Copilot supports custom instructions — a text description of how Copilot should behave in the workspace, configured via a .github/copilot-instructions.md file. MCP servers and custom instructions complement each other in the same way that MCP and Cursor rules files do. An instruction like “when writing SQL, use the database MCP server to check the actual schema before generating queries” makes the database server part of Copilot’s default behaviour rather than something you invoke manually. An instruction like “when starting a new feature, fetch the relevant GitHub issue using the GitHub MCP server for context” turns issue-reading into an automatic first step rather than an occasional reminder. Investing time in a good copilot-instructions.md that references the MCP servers your team has configured produces a more consistent and capable AI workflow across all team members, with less per-session direction required from each developer.

What to Expect as MCP in VS Code Matures

VS Code’s MCP support arrived in April 2025 and has been actively developed since — each VS Code release has brought improvements to tool discovery, error reporting, and the range of transport protocols supported. The current stdio transport covers the vast majority of available MCP servers, but HTTP and SSE transports (for servers running as persistent services rather than launched on demand) are in active development and expand the range of servers that can be used in remote environments. The Copilot-only restriction on which AI models can use MCP tools is the most significant current limitation — as VS Code’s AI extension API matures, expect third-party extension authors to gain the ability to expose their own AI to MCP tools, broadening the utility beyond Copilot subscribers. Following the VS Code release notes and the MCP specification changelog is the most efficient way to stay current on what new capabilities become available and how to use them.

Leave a Comment