Skip to content

How to add MCP servers to VS Code

VS Code reads MCP servers from ~/.copilot/mcp-config.json (for you) or .mcp.json (for one project), under the "mcpServers" key. A local server’s entry is a command with args; a remote server’s entry is its URL in "url".
Last checked against Microsoft’s docs

Quick facts

Local servers
Yes (stdio)
Remote servers
Streamable HTTP: Yes · SSE: YesURL field: url
Sign-in
OAuth: Yes · Headers: YesOAuth works through dynamic client registration or a pre-registered client (oauthClientId); tokens can go in headers.
Resources
Partly
Prompts
No
Tool approval
Yes
Platforms
macOS, Windows and Linux

Step by step

Add a remote server

Example: a hosted server whose latest check on AI-Powered answered, Context7.

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

Add a local server

Example: a popular npm package that needs no keys, Chrome DevTools MCP.

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

Add a server that needs an API key or header

Local servers read keys from environment variables. Replace each <NAME> placeholder with your own value in the file on your computer; never paste real keys into a website.

Example: Context7.

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "<CONTEXT7_API_KEY>"
      }
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

Request headers for remote servers: yes. OAuth works through dynamic client registration or a pre-registered client (oauthClientId); tokens can go in headers.

Add a server that signs in with OAuth

OAuth sign-in: yes. Add the server by its URL as a remote server, then sign in when asked. OAuth works through dynamic client registration or a pre-registered client (oauthClientId); tokens can go in headers.

Config file locations

ForSystemPath
You (every project)All systems~/.copilot/mcp-config.json
One projectAll systems.mcp.json

Get the config for any server

Search the MCP servers on AI-Powered and copy the VS Code snippet for one.

Adding several servers? Build one config with the MCP config generator.

Servers that work in VS Code

Popular servers with an install config for VS Code and no failing latest check.
  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 476K GitHub stars
    • Developer tools
  2. Browser Use

    MCP server

    Browser agents and cloud browsers for AI, with an MCP server for web tasks

    • 7 tools
    • Remote
    • Freemium
    • 122K GitHub stars
    • Browser automation
  3. MCP server for AI clients to scrape sites with HTTP and stealth browser sessions

    Runs locally
    • 17 tools
    • Open source
    • 105K GitHub stars
    • Web search and scraping
  4. Hosted MCP connector for creating and rendering videos from HTML through AI chat

    • Remote
    • Freemium
    • 89K GitHub stars
    • Design and media
  5. Context7

    MCP server

    Version-specific library docs and code examples piped into coding agents via MCP

    • 2 tools
    • Remote
    • Freemium
    • 65.4K GitHub stars
    • Developer tools
  6. MCP server and CLI that let coding agents drive and inspect a live Chrome browser

    Runs locally
    • Open source
    • 59.1K GitHub stars
    • Browser automation
  7. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 49.1K GitHub stars
    • Knowledge and memory
  8. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    • Remote
    • Open source
    • 34.7K GitHub stars
    • Developer tools
  9. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.7K GitHub stars
    • Developer tools
  10. ffmpeg-skill

    MCP server

    Local FFmpeg video and audio editing tools for coding agents over MCP

    Runs locally
    • Open source
    • 10.3K GitHub stars
    • Design and media
  11. Ha MCP

    MCP server

    MCP server for managing and automating Home Assistant from AI assistants

    Runs locally
    • 8 tools
    • Open source
    • 8.1K GitHub stars
    • Productivity
  12. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.8K GitHub stars
    • Analytics and data

Troubleshooting

A guide tells you to use .vscode/mcp.json with a "servers" key
That is the older editor-managed format, which VS Code says will be removed in February 2027. Use "mcpServers" in ~/.copilot/mcp-config.json or a workspace .mcp.json instead.
A workspace server doesn’t start
Workspace servers follow Workspace Trust. Trust the folder; restricted mode blocks them.
A local server works on your machine but not in a dev container or remote window
The command runs in the remote environment. Check that the runtime is installed there and on its PATH.
A Docker server connects and then stops
Don’t start the container with -d. The client needs the container’s stdin and stdout.
${env:NAME} or ${input:...} isn’t replaced
Those variables belong to the older format. The portable format uses ${NAME} or ${NAME:-default} and has no input prompts.
A local server fails with “npx” (or uvx, docker) not found
Apps started from a dock or menu may not see your terminal’s PATH. Use the full path of the command (run which npx in a terminal to find it), then restart VS Code.
You can’t tell whether the server or VS Code is at fault
Test the server on its own with the MCP Inspector (npx @modelcontextprotocol/inspector). If it lists tools there, check the VS Code setup.

Where to find logs

  • Run “MCP: List Servers”, pick the server and choose Show Output.

Safety notes

  • Local servers can run code on your machine. Check the publisher and the command before you start one.
  • Approve only tool calls you understand; trusting a server doesn’t approve its tools.
  • Keep secrets in environment variables and reference them with ${NAME} rather than writing them into a shared .mcp.json.
  • A local server runs on your computer with your access to files and the network. Add only servers whose source you trust.

Questions about MCP in VS Code

Which MCP config file should I use in VS Code?

VS Code now recommends the portable format: "mcpServers" in ~/.copilot/mcp-config.json for you, or .mcp.json at the workspace root for a project. The older .vscode/mcp.json with "servers" still works but is deprecated and due to be removed in February 2027.

Can I install an MCP server in VS Code with one click?

Yes. A vscode:mcp/install link opens the server details so you can review it before installing. We only offer it when the server has no values to fill in.

Does VS Code support MCP prompts?

Not in Copilot sessions. The /mcp.<server>.<prompt> commands only belonged to the older editor harness.

Can I limit which tools a server exposes?

Yes. In the portable format, set "tools" to the list of tools you want (["*"] for all). Tool approvals still apply.

Can I use local MCP servers in VS Code?

Yes. VS Code starts a local server as a command on your computer (stdio).

Does VS Code support remote MCP servers?

Yes. VS Code connects over Streamable HTTP and the older SSE transport. The URL goes in the "url" field.

Where is the VS Code MCP config file?

For you: ~/.copilot/mcp-config.json. For one project: .mcp.json.

Can VS Code sign in to MCP servers with OAuth?

Yes. OAuth works through dynamic client registration or a pre-registered client (oauthClientId); tokens can go in headers.

Other MCP clients