PlugWiki
VS Code (GitHub Copilot) logo

How to add an MCP server to VS Code

Add MCP servers to VS Code with the MCP: Add Server command or a config file, then use them from Copilot agents in chat.

Local servers
Yes
runs stdio servers
Hosted servers
Yes
connects by URL
Config
JSON
how servers are added
Picks
5
ranked

Run MCP: Add Server from the Command Palette, pick Command (stdio) for a local server or HTTP for a hosted one, and choose where to store it. VS Code reads two file formats. The VS Code format uses a servers object in .vscode/mcp.json, and the portable Copilot format uses mcpServers in .mcp.json or ~/.copilot/mcp-config.json. Pick the format that matches your agent harness before you copy a config between them.

Good for

  • Developers using Copilot agents in VS Code who need more tools
  • Teams sharing servers through .vscode/mcp.json or a workspace .mcp.json
  • People moving servers over from Claude Desktop, Cursor or Windsurf
  • Admins who restrict MCP servers with an enterprise allowlist

Install VS Code (GitHub Copilot)

VS Code (Copilot)

  1. 1

    Open the Command Palette (Shift+Cmd+P on macOS, Ctrl+Shift+P on Windows and Linux) and run MCP: Add Server.

  2. 2

    Choose HTTP for a server URL or Command (stdio) for a launch command.

  3. 3

    Enter a server ID that is not already used.

  4. 4

    Choose Global, then Copilot Global, for a personal setup.

  5. 5

    Accept the trust and sign-in prompts you understand.

Copilot harness sessions read the portable format. VS Code forwards servers from .vscode/mcp.json to them, except servers that need ${input:...} prompts. Docs updated 10/28/2026.

From the vendor's docs. Source.

At a glance

Add an MCP server to VS Code

  1. 1

    Run MCP: Add Server

    Open the Command Palette and run MCP: Add Server. Choose HTTP if you have a URL, or Command (stdio) if you have a launch command. Enter a server ID such as playwright.

  2. 2

    Choose where to store it

    Pick Global, then Copilot Global, to keep it out of your project (it writes $COPILOT_HOME/mcp-config.json, or ~/.copilot/mcp-config.json when COPILOT_HOME is unset). For a team, use the workspace-root .mcp.json; the guided flow offers it only when the experimental chat.mcp.workspaceRootConfig.enabled setting is on. The older .vscode/mcp.json (or the user-profile mcp.json) stays available for input variables and sandboxing.

  3. 3

    Or edit the file by hand

    In .vscode/mcp.json:

    {
      "servers": {
        "playwright": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@playwright/mcp@latest"]
        },
        "context7": { "type": "http", "url": "https://mcp.context7.com/mcp" }
      }
    }

    In a portable file, use mcpServers and leave out type for local servers.

    Uses Context7

  4. 4

    Check it loaded

    Run MCP: List Servers to start, stop or restart a server and open Show Output. Open Chat: Open Customizations, then MCP Servers, to see each server and its toggle.

  5. 5

    Use it in a prompt

    Expand the tool call in the conversation and confirm it came from the server you added and returned real output.

    Prompt
    Use the Context7 MCP tools to look up the React documentation for useState. Summarize the basic usage and cite the documentation returned by the tool. Do not change files.

    Uses Context7

  6. 6

    If it does not work

    Run MCP: List Servers, pick the server, and choose Show Output. A stdio server needs its runtime (for example Node.js) on the machine that runs it. In a remote window or dev container, configure the server there.

Best MCP servers for VS Code (GitHub Copilot)

MCP servers that work in VS Code (GitHub Copilot)

40 · official first, then servers with a page, then by stars

Show all 40

Common errors and fixes

  • Cannot have more than 128 tools per request

    Cause: A chat request can have at most 128 tools enabled.

    Fix: Deselect tools or whole MCP servers in the tools picker, or enable virtual tools with github.copilot.chat.virtualTools.threshold.

    vs-code Source

  • A server does not appear or changes do not show up

    Cause: The selected agent harness, workspace or config format may not match the file you edited.

    Fix: Check which harness is selected and which config source you changed, and compare servers against mcpServers in the format table.

    vs-code Source

  • A stdio server fails to start

    Cause: The command, arguments, runtime or PATH is wrong in the place the server runs. A command installed locally can be missing in a remote window.

    Fix: Check the command, then run MCP: List Servers and choose Show Output.

    vs-code Source

  • A Docker stdio server exits or does not connect

    Cause: Detached mode (-d) breaks the stdio connection.

    Fix: Remove -d so the container runs in the foreground.

    vs-code Source

  • Server blocked from starting

    Cause: Restricted mode in Workspace Trust prevents workspace servers from starting, or an enterprise allowlist blocks it.

    Fix: Trust the workspace only after reviewing it, or ask your administrator about the enterprise MCP allowlist.

    vs-code Source

  • Server with ${input:...} is missing in Copilot sessions

    Cause: Servers that need interactive input variables are not forwarded to Copilot harness sessions.

    Fix: Use ${NAME} environment variables in a portable config or OAuth instead.

    vs-code Source

Verdict

VS Code gives you a guided MCP: Add Server flow, stdio, HTTP and OAuth, and a server gallery. The main limit is two config formats, so check which one your agent harness reads before copying a file.

VS Code gives you a guided MCP: Add Server flow, stdio, HTTP and OAuth, and a server gallery. The main limit is two config formats, so check which one your agent harness reads before copying a file.

Best for

  • Developers already using Copilot agents in VS Code
  • Teams that share servers in a committed config file

Skip it if

  • You want one JSON shape that works the same in every app
  • You need more than 128 tools active in one request

Questions

Where is the VS Code MCP config file?

.vscode/mcp.json in your workspace, or mcp.json in your user profile (run MCP: Open User Configuration). The portable Copilot format uses .mcp.json in the workspace root or ~/.copilot/mcp-config.json.

What is the difference between servers and mcpServers?

servers is the VS Code format in .vscode/mcp.json. mcpServers is the portable format in .mcp.json and mcp-config.json. Check the capability table in the docs before you copy a config between them.

Does VS Code support remote (HTTP) MCP servers?

Yes. Use "type": "http" with a url. VS Code tries streamable HTTP first and falls back to SSE.

Does VS Code support OAuth for MCP servers?

Yes. VS Code opens a browser window for sign-in on first connect. You can set oauth.clientId, and a client secret is kept in VS Code secret storage rather than in mcp.json.

How many MCP tools can VS Code use at once?

A chat request can have at most 128 tools enabled. If you hit the error, deselect tools or servers in the tools picker, or turn on virtual tools with github.copilot.chat.virtualTools.threshold.

How do I disable an MCP server in VS Code?

Open Chat: Open Customizations, choose MCP Servers, and use the server's toggle. A disabled server does not start, and its tools are unavailable.

How do I add an MCP server from the command line?

Use code --add-mcp with a JSON object that has a name and the server config, as in the install box. It writes to your user-profile configuration.

Can VS Code reuse MCP servers from Claude Desktop or Cursor?

Yes. Turn on chat.mcp.discovery.enabled and pick the sources. Copilot CLI discovery is on by default, and the other sources are off.

Do MCP servers run in a dev container or remote workspace?

Yes, but configure them there. Use MCP: Open Remote User Configuration or add customizations.vscode.mcp to devcontainer.json, and install the runtime where the command runs.

Information

updated Nov 2, 2026

Transports
stdio, SSE, Streamable HTTP
Config file (all)
.vscode/mcp.json (workspace) or user settings

WebsiteDocs

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. Add MCP servers in VS Code · code.visualstudio.com
  2. MCP configuration reference · code.visualstudio.com
  3. Manage and troubleshoot MCP servers · code.visualstudio.com
  4. Use tools with agents · code.visualstudio.com

Updated Nov 2, 2026.