All MCP setup guides
MCPVS Code

How to Add a Remote MCP Server to VS Code

In .vscode/mcp.json the root key is servers, not mcpServers — paste the wrong one and it is silently ignored. Plus the Local harness OAuth servers need, the Copilot org policy that hides MCP entirely, and why tools only appear in agent mode.

Last verified October 1, 2026

How do I add a remote MCP server to VS Code?

Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), run MCP: Add Server, choose HTTP, paste the server's URL, and name it. OAuth runs automatically on first connect. A few things then commonly go wrong, and all are silent rather than loud: in .vscode/mcp.json the root key is servers, not mcpServers; on VS Code 1.140 and later an OAuth server needs the Local harness; and MCP tools only appear when Chat is running an agent. You need VS Code 1.101 or later.

Requirements, including the one an admin controls

  • VS Code 1.101 or later. Earlier versions don't have full MCP support.
  • A GitHub Copilot subscription. As of October 2026, on Copilot Business or Enterprise seats your organization's "MCP servers in Copilot" policy must be enabled — and it is off by default, so an admin may need to turn it on. Free, Pro, Pro+, and Max personal plans are not policy-gated — GitHub's policy doc names all four.

If the MCP commands are missing entirely rather than failing, one of those two is why.

Adding the server

From the Command Palette

  1. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Run MCP: Add Server
  3. Choose HTTP as the server type
  4. Paste the URL
  5. Name it, then choose where to save it: .mcp.json for this workspace, or Copilot Global for every workspace. The flow still lists .vscode/mcp.json and your VS Code user profile, which VS Code now marks as deprecated destinations but still reads.

By editing the config

For a workspace-level server in VS Code's own format, create .vscode/mcp.json:

{
  "servers": {
    "my-server": {
      "type": "http",
      "url": "https://mcp.example.com/mcp"
    }
  }
}

For a user-level config covering every workspace, run MCP: Open User Configuration from the Command Palette and add the same block.

VS Code also reads a portable workspace file, .mcp.json at the project root, which other Copilot tools share. It uses mcpServers as the root key; the same entry looks like this:

{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "https://mcp.example.com/mcp"
    }
  }
}

There is also a shell one-liner:

code --add-mcp '{"name":"my-server","type":"http","url":"https://mcp.example.com/mcp"}'

The key that makes configs vanish

In .vscode/mcp.json, the root key is servers. Not mcpServers.

VS Code now reads two formats: its own (.vscode/mcp.json and the user-profile mcp.json, root key servers) and a portable one (.mcp.json at the workspace root and ~/.copilot/mcp-config.json, root key mcpServers, shared with other Copilot tools). Paste an mcpServers block into .vscode/mcp.json and it is silently ignored — no error, no warning, no entry in the server list. The file is valid JSON, so nothing complains.

The branded VS Code documentation names this as the most common cause of a config being ignored — and it is an easy one to hit when copying a working config from Cursor or Claude Code. The simplest fix there is to save it as .mcp.json instead, where mcpServers is the right key.

Authorization

OAuth is automatic. When VS Code first connects, a browser tab opens to the server's consent screen; sign in and approve.

Back in the editor, an Auth CodeLens appears above the server entry in mcp.json. Click it any time to re-authenticate — or to start the OAuth flow manually if it never triggered on its own.

Using the tools

Choose the Local harness first. VS Code 1.140 added a Copilot harness, and it may already be selected in the chat input. Copilot harness sessions can currently reach only local MCP servers that don't need sign-in, so a remote server that uses OAuth won't load there. Open the harness picker (the Session Target control) in the Chat view and choose Local.

MCP tools appear when Chat is running an agent. Open Chat, pick the built-in Agent in the agent picker — VS Code renamed chat modes to agents in 2026, so older builds show the same thing as a mode picker with Ask, Edit, and Agent — and check the tools picker.

This catches people who connected successfully: the server is live, the tools exist, and they are invisible because Chat is not running an agent (on older builds: ask or edit mode). The agent is not optional here.

Visual Studio

Visual Studio (2022 17.14+ and Visual Studio 2026) supports the same servers through .mcp.json — global at %USERPROFILE%\.mcp.json, or per-solution in the solution directory. The root key is servers, same as VS Code:

{
  "servers": {
    "my-server": {
      "url": "https://mcp.example.com/mcp"
    }
  }
}

When Copilot Chat loads the server, click the "Authentication Required" CodeLens to run the browser OAuth flow. Note that Visual Studio disables MCP tools by default — enable them in the tool picker before use. The same Copilot org policy applies on Business and Enterprise seats.

A worked example

With a real server — Tempreon, a hosted MCP server that gives your AI a persistent memory of how you work:

{
  "servers": {
    "tempreon": {
      "type": "http",
      "url": "https://api.tempreon.com/functions/v1/tempreon-mcp/mcp"
    }
  }
}

Save, approve the browser prompt, make sure Chat is running the Agent in the Local harness, and the tools are there. The account-holder walkthrough, including the Visual Studio variant, is in the VS Code setup doc.

Sources

The dated claims on this page were checked against these vendor documents. Client UIs move constantly, so if one of these has changed since the date shown, trust the vendor over this page — and tell us.

Frequently asked questions

I added an MCP server to VS Code but my config seems to be ignored. Why?
The most common cause is a root key that doesn't match the file. In .vscode/mcp.json and the user-profile mcp.json, VS Code uses servers — paste a config with mcpServers there and it is silently ignored. The portable .mcp.json at the workspace root and ~/.copilot/mcp-config.json use mcpServers instead. Check which file you edited and match the key to it; nothing errors, so it is easy to miss.
Where do I add an MCP server in VS Code?
Open the Command Palette with Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows and Linux, run MCP: Add Server, choose HTTP, paste the server URL, and name it. Then choose .mcp.json to save it for this workspace or Copilot Global to save it for every workspace. To edit config directly, use .mcp.json (root key mcpServers) or .vscode/mcp.json (root key servers) for one workspace, or MCP: Open User Configuration for all of them.
The server connected but its tools don't appear in Chat. What's missing?
MCP tools only surface when Chat is running an agent in a harness that can reach them. On VS Code 1.140 or later, open the harness picker in the chat input and choose Local — the Copilot harness can currently use only local servers that don't require authorization. Then pick the built-in Agent in the agent picker (older builds call this the mode picker, with Ask, Edit, and Agent) and check the tools picker. If they are still absent, restart the server from the CodeLens above its entry in mcp.json.