ipIterPrompt
IntegrationDeveloper WorkflowVerified Last verified 2026-07-24

VS Code MCP Support (Agent Mode)

by Microsoft

VS Code supports the Model Context Protocol so its Copilot Chat agent mode can call tools from MCP servers. You define servers in a workspace `.vscode/mcp.json` (or in user settings for global availability); once added, the servers' tools appear to the agent, which requests approval before running them.

Works with

Marketplace extensions and MCP servers.

When to use it

  • When you want VS Code's agent to act on real systems via MCP
  • Bringing an MCP server you run elsewhere into VS Code

When not to

  • Adding write-capable servers that touch production without approvals in place

What it does

  • Register local or remote MCP servers in `.vscode/mcp.json`
  • Use server tools from Copilot Chat's agent mode
  • Share a workspace `mcp.json` so teammates get the same tools

How to install

Setup steps with copy-paste config. Sources are cited under each method.

Workspace mcp.json

VS Code

Requires: VS Code · Copilot Chat with agent mode · An MCP server command or endpoint

  1. Create .vscode/mcp.json

    Define the server under `servers`; VS Code discovers it for the workspace.

    json
    {
      "servers": {
        "github": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-github"]
        }
      }
    }
  2. Use it in agent mode

    Open Copilot Chat, switch to agent mode, and the server's tools become available (with per-call approval).

How to prompt it

Copy-paste prompts written to exercise this plugin, with what to expect.

Agent uses an MCP tool

You added a database MCP server to the workspace.

In agent mode, use the database tools to list the slowest queries this week and suggest indexes. Read-only.

What to expect: VS Code's agent calls the MCP server's tools (with approval) and returns findings grounded in live data.

  • Keep a workspace `mcp.json` in the repo so the setup travels with the project.

Tips for getting the most out of it

  • VS Code's config key is `servers` in `.vscode/mcp.json` — different from some other hosts' `mcpServers`.
  • Review and approve tool invocations, especially for servers that can write.

Prompts to pair with it

Real prompts from the IterPrompt library you can copy or run.

xcode-mcp (for pi agent)

Turn any AI chat into a xcode-mcp (for pi agent) with this community persona prompt.

413 copiesOpen ↗

Code Review Agent

Turn any AI chat into a code review agent with this community persona prompt.

1,557 copiesOpen ↗

VSCode CodeTour Expert Agent

Turn any AI chat into a vscode codetour expert agent with this community persona prompt.

698 copiesOpen ↗

xcode-mcp

Turn any AI chat into a xcode-mcp with this community persona prompt.

3,429 copiesOpen ↗

Code Formatter Agent Role

Turn any AI chat into a code formatter agent role with this community persona prompt.

2,008 copiesOpen ↗

Code Review Agent Role

Turn any AI chat into a code review agent role with this community persona prompt.

4,036 copiesOpen ↗
See more prompts in the library

Frequently asked questions

Do I need Copilot for this?+

MCP tools are used through Copilot Chat's agent mode, so Copilot access applies. The `mcp.json` configuration itself is a standard VS Code feature.

Can I reuse servers from other editors?+

Yes — MCP is portable. The same server runs in Claude, Cursor, Cline, and Zed with the equivalent config.

Pairs well with

Related guides

Alternatives to VS Code MCP Support (Agent Mode)

Sources & verification

The facts on this page and where they come from. Anything unverified is labeled — we'd rather say "unknown" than guess.

Install steps, pricing, and availability change often. Always confirm on the official page before relying on setup details.