How to Install an MCP Server in VS Code (New Format)
Add an MCP server in VS Code in 6 steps. Since 1.146, Copilot reads mcpServers in .mcp.json and ~/.copilot/mcp-config.json; .vscode/mcp.json is deprecated.

- Date
- November 28, 2026
To install an MCP server in VS Code, run Chat: Open Customizations, select MCP Servers, then Add Server, and give it the server's URL (remote) or launch command (local); for personal use choose Global > Copilot Global, which saves it to ~/.copilot/mcp-config.json. To share a server with your team, put it in a .mcp.json file at the root of the repository, under a top-level mcpServers key.
That is a change. Most guides still tell you to create .vscode/mcp.json with a servers key. Since VS Code 1.146 (November 11, 2026), that file belongs to the deprecated Local harness, which Microsoft will remove in February 2027, and the Copilot harness that new chat sessions use doesn't read it directly. We checked what VS Code 1.146 itself writes when you add a server from the command line: it still writes the old format. This guide covers both, and how to move.
| What you want | Where it goes (Copilot harness) | Top-level key |
|---|---|---|
| A server for yourself, in every workspace | ~/.copilot/mcp-config.json (or $COPILOT_HOME/mcp-config.json) | mcpServers |
| A server your team gets from the repo | .mcp.json at the workspace root | mcpServers |
| An existing setup you haven't migrated | .vscode/mcp.json or your profile's mcp.json (deprecated) | servers |
How do you add an MCP server in VS Code?
Use the Agent Customizations editor; it asks for four things and writes the file for you. These are the steps from VS Code's documentation, as of November 28, 2026:
| Step | What to do |
|---|---|
| 1 | In a chat session, select Copilot as the session target |
| 2 | Run Chat: Open Customizations from the Command Palette and select MCP Servers |
| 3 | Select Add Server (+). Choose HTTP for a remote server or Command (stdio) for a local one |
| 4 | Enter the URL or the launch command, then a server ID such as microsoftLearn |
| 5 | Choose Global > Copilot Global for yourself, or the workspace-root .mcp.json to share it |
| 6 | Accept the trust and sign-in prompts you understand, then test it with a tool call |
MCP: Add Server in the Command Palette starts the same flow. MCP: Browse MCP Servers and the Customization Marketplace let you install published servers, where your organization allows it.
To try the flow with a server that needs no account, VS Code suggests Microsoft Learn at https://learn.microsoft.com/api/mcp. When we connected to it on November 28, it offered three tools: microsoft_docs_search, microsoft_code_sample_search and microsoft_docs_fetch. For more servers you can test without signing in, see our list of remote MCP servers that still work.
What goes in the MCP config file?
A top-level mcpServers object, with one entry per server: a type, then a url for remote servers or a command and args for local ones. This is the "portable" format in VS Code's MCP configuration reference:
{
"mcpServers": {
"microsoftLearn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
},
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@playwright/mcp@0.0.86"]
},
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${GITHUB_PAT}" }
}
}
}
| Field | For | What it does |
|---|---|---|
type | All | http for Streamable HTTP, stdio for a local command, sse for an old SSE endpoint |
url, headers | Remote | The endpoint, and optional headers such as an API key |
command, args | Local | The program to start and its arguments |
env | Local | Environment variables for the server process |
cwd | Local | Working directory |
tools | All | Which tools to expose; ["*"] for all. It doesn't skip tool approvals |
oauthClientId | Remote | For servers that need a pre-registered OAuth client, such as Google's Workspace MCP servers |
Three rules worth knowing:
- Secrets go in environment variables. Write
${NAME}, or${NAME:-default}for a non-secret default. Bare$NAMEis treated as literal text. Don't commit tokens: "a personal configuration file is not a secret store." - Editor-only fields don't belong here.
inputs,envFile,devandsandboxEnabledwork only in the old format. - Pin local servers. VS Code's own example uses
@playwright/mcp@latest, which fetches whatever was published last. A fixed version, as above, changes only when you change it. Our MCP supply chain analysis explains why.
What happened to .vscode/mcp.json?
It still exists, but it is the configuration of the Local harness, which VS Code deprecated in 1.146 and will remove in February 2027. The Copilot harness, the default for new chat sessions since VS Code 1.143, reads mcp-config.json and .mcp.json instead.
The reference is explicit: "For new Copilot configurations, use these native destinations, not .vscode/mcp.json or profile mcp.json." The two formats differ in more than the file name:
| Copilot harness (current) | Local harness (deprecated) | |
|---|---|---|
| Files | ~/.copilot/mcp-config.json, workspace .mcp.json | .vscode/mcp.json, profile mcp.json |
| Top-level key | mcpServers | servers |
| Environment variables | ${NAME}, ${NAME:-default} | ${env:NAME} |
| Prompted secrets | Not supported | inputs with ${input:...} |
envFile, dev mode, per-server sandbox | Not supported | Supported |
| How Copilot sessions get it | Read directly | Forwarded by the editor, if eligible |
Definitions in the old files can be "forwarded" to Copilot sessions, except ones that use ${input:...} or ${command:...}. Forwarding leaves the old file in place; migration writes the new files. VS Code's migration guide covers replacing input prompts with environment variables.
What does code --add-mcp write?
The old format. VS Code's reference notes that code --add-mcp targets "editor-managed configuration, not the portable Copilot files". We checked on VS Code 1.146.0, using a throwaway profile so we didn't touch a real one:
code --user-data-dir /tmp/vscode-test --add-mcp \
'{"name":"microsoftLearn","type":"http","url":"https://learn.microsoft.com/api/mcp"}'
# Added MCP servers: microsoftLearn
It created User/mcp.json in that profile:
{
"servers": {
"microsoftLearn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
},
"inputs": []
}
That is the deprecated servers format. If you script your setup, edit ~/.copilot/mcp-config.json or .mcp.json directly instead, or add servers through the Customizations editor.
Can VS Code and Claude Code share one MCP config?
Yes: a .mcp.json file at the repository root, with mcpServers, works for both. Claude Code reads the same file for project-scoped servers and uses the same ${VAR} and ${VAR:-default} syntax, according to its MCP documentation. Cursor and Claude Desktop also use the mcpServers key, so their entries can usually be copied across; add a type to each.
Each tool still asks for its own approval. Claude Code holds .mcp.json servers at "Pending approval" until you approve them in an interactive session. In VS Code, .mcp.json follows Workspace Trust: in a trusted workspace its servers can start without a separate prompt, "including after configuration changes". Read the file before you trust a repository, because a stdio entry can run any command.
If you are setting up Claude Code too, our guide to what an MCP server is shows the claude mcp add commands.
How do you check that the server works?
Ask for something only that server can do, then expand the tool call in the chat and check which server answered. VS Code's documentation warns that "a plausible answer without a tool call doesn't verify the connection."
For Microsoft Learn, ask Copilot to use the Microsoft Learn MCP tools to find the official documentation for a specific API, and tell it not to change files. If something is wrong:
| What you see | What to check |
|---|---|
| The server doesn't appear or won't start | Which file it is in, the runtime (Node.js for npx, Python for uvx), and the server output (MCP: List Servers > Show Output) |
| Sign-in or connection fails | The publisher's auth instructions; your organization's MCP access policy (chat.mcp.access) |
| It runs but its tools are never called | Whether the tools are enabled for the session; name the server in your prompt |
It worked in .vscode/mcp.json but not in a new session | New sessions use the Copilot harness, which can't take entries that use ${input:...} or ${command:...}; move the entry to mcp-config.json or .mcp.json with an environment variable |
| An API key prompt no longer appears | ${input:...} isn't supported in the new format; use an environment variable |
To pause a server, use Disable in its menu under MCP Servers. Stopping it only ends the current run.
Do MCP servers in VS Code bring skills now?
Yes. Since VS Code 1.147 (November 18, 2026), servers that support Skills over MCP can give Copilot skills, and VS Code asks you to allow them the first time. Allowed skills appear on the Skills tab of the Agent Customizations editor. To turn the feature off, disable the chat.agentHost.mcpSkills.enabled setting.
Few servers ship skills yet. On November 28 we found 12 of 817 public servers that do, plus hosted ones such as Hugging Face and Shopify. Our guide to Skills over MCP explains what you approve when you allow them.
When not to use an MCP server in VS Code
- You only need a command-line tool. Copilot's agent can already run
git,ghorpsqlin the terminal; an MCP server adds a layer you may not need. - You need the same server in a remote container or SSH host. Your local
mcp-config.jsonisn't forwarded; configure the server where the harness runs. - Your integration depends on a prompted secret. The Copilot harness can't pass a
${input:...}value or a stored VS Code secret into an HTTP header. Use OAuth, if the server supports it, or an environment variable. - Your organization manages Copilot centrally. Admins can restrict which servers run, so a server may be missing for policy reasons, not configuration.
To find a server for a job, browse the MCPInstall directory; each server page lists its install command or URL.
Frequently asked questions
Where is the MCP config file in VS Code?
For the Copilot harness: ~/.copilot/mcp-config.json for your own servers (or $COPILOT_HOME/mcp-config.json), and .mcp.json at the workspace root for shared ones. The older .vscode/mcp.json and profile mcp.json belong to the deprecated Local harness.
Is it "servers" or "mcpServers" in VS Code?
mcpServers for the current Copilot harness, in mcp-config.json and .mcp.json. servers is the older editor format used in .vscode/mcp.json, which VS Code deprecated in version 1.146.
Do I need GitHub Copilot to use MCP servers in VS Code?
MCP servers in VS Code are used by its chat agents. You need AI features enabled and a chat session; VS Code's MCP guide is written for the Copilot harness.
Can I copy an MCP config from Claude Desktop or Cursor into VS Code?
Usually, into .mcp.json or mcp-config.json, because all of them use the mcpServers key. Add a type field to each entry and move any secrets into environment variables. Pasting the same JSON into .vscode/mcp.json doesn't work, because that file expects servers.
How do I remove an MCP server from VS Code?
Open Chat: Open Customizations > MCP Servers and choose Uninstall from the server's menu, or delete its entry from the config file. For a server that came with a plugin or connector, remove the plugin or disconnect the connector instead.
Will my .vscode/mcp.json stop working?
For now, eligible entries in it are forwarded to Copilot sessions, but the Copilot harness doesn't read the file itself, and the Local harness it was made for will be removed in February 2027. VS Code hasn't said how long forwarding will continue, so moving the entries to .mcp.json or mcp-config.json is the safe choice.
Sources
Checked on November 28, 2026.
- VS Code documentation: Add and use MCP servers, MCP configuration reference, Manage and troubleshoot MCP servers
- VS Code release notes: 1.146 (Local harness deprecated; Skills over MCP preview) and 1.147 (Skills over MCP on by default)
- Claude Code documentation: Connect Claude Code to tools via MCP (
.mcp.json, environment variable expansion, project approvals) - MCPInstall test, November 28, 2026:
code --add-mcpon VS Code 1.146.0 (macOS, arm64) with a temporary--user-data-dir;initializeandtools/listagainst the Microsoft Learn MCP server