How to Add an MCP Server to VS Code

Updated November 5, 2026

Short answer: Open the Command Palette in VS Code and run MCP: Add Server, then follow the prompts. To edit the file by hand, use .vscode/mcp.json with a top-level servers object. VS Code's format uses servers, not the mcpServers key used by most other apps.

The easy way

  1. Open the Command Palette.
  2. Run MCP: Add Server.
  3. Enter the server URL or start command, then choose where to save it.

You can also run MCP: Browse MCP Servers to find servers from inside VS Code.

Edit the file by hand

A remote server in .vscode/mcp.json:

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

A local server:

{
  "servers": {
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    }
  }
}

For servers you want in every project, run MCP: Open User Configuration and add them there.

Why doesn't my copied config work?

Most server instructions show mcpServers, which is the format for Cursor, Claude and others. In .vscode/mcp.json, rename that key to servers and add a type to each entry. VS Code also supports a portable .mcp.json file that uses mcpServers. See the VS Code configuration reference.

Good servers to start with

See our picks for coding and databases.

Frequently asked questions

Does VS Code use mcpServers or servers?

The .vscode/mcp.json format uses servers. The portable format, used in files such as .mcp.json, uses mcpServers.

Where is the MCP config file in VS Code?

Project config is at .vscode/mcp.json. For user config, run MCP: Open User Configuration from the Command Palette.

More guides