Nov 21, 2026
4 min read
8 views
In VS Code, an MCP server is added with the "MCP: Add Server" command or picked from "MCP: Browse MCP Servers", and a server shared with a team now goes in a .mcp.json file at the workspace root under a top-level mcpServers key. The older .vscode/mcp.json file with a servers key still exists but is the editor-managed format that VS Code's configuration reference marks as deprecated, which is why guides disagree on the file name. Personal servers for Copilot go in ~/.copilot/mcp-config.json. The notes below are from Microsoft's documentation as of November 2026, with how Claude Code, Cursor and Codex store the same settings for comparison; none of the steps was followed for this page.
"MCP: Add Server" offers a remote server over HTTP (HTTP or Server-Sent Events) or a local server started by a command over stdio, and can also add a server from another application already on the machine. (VS Code documentation: MCP servers)
"MCP: Browse MCP Servers" opens the server gallery; the page says availability also depends on organization policy. (same page)
"Chat: Open Customizations", then MCP Servers, shows the servers already configured and lets a server be added to the User group. (same page)
Before a server starts, VS Code may ask for trust; the page says to review each trust request before accepting it, to approve only actions that are understood, and not to paste credentials into chat or into shared configuration. (same page)
Workspace, shared with the team: .mcp.json at the workspace root, top-level key mcpServers. The configuration reference calls this the portable Copilot format and says new Copilot configurations should not use .vscode/mcp.json. (VS Code documentation: MCP configuration reference)
Personal, every workspace: $COPILOT_HOME/mcp-config.json, or ~/.copilot/mcp-config.json when COPILOT_HOME is not set. The "MCP: Open User Configuration" command opens a different file, the editor-managed profile mcp.json, not this Copilot user file. (same page)
Editor-managed, deprecated: the servers format in .vscode/mcp.json. Only this format supports an inputs array with ${input:...} prompts for secrets, an envFile field and VS Code's own sandbox settings for stdio servers on macOS and Linux. (same page)
Fields in the portable format: type, command, args, env and cwd for a local server; type, url, headers and oauthClientId for a remote one. Secrets are referenced as environment variables with ${NAME} or ${NAME:-default}, since input variables are not supported there. A tools list can narrow which of a server's tools are available, which the page says does not bypass tool approvals. (same page)
Remote and Dev Container sessions: the user configuration is read from the home directory where the agent runs, so a server has to be configured in that environment. (same page)
The setting chat.mcp.discovery.enabled lets VS Code pick up servers configured in Claude Desktop, GitHub Copilot CLI, Cursor (global and workspace) and Windsurf. Discovery from Copilot CLI is on by default; the others are off by default. (VS Code documentation: MCP configuration reference)
Claude Code: a project server goes in .mcp.json at the project root under mcpServers and is shared through version control; local and user servers are stored in ~/.claude.json. Servers are added with claude mcp add, environment variables are written ${VAR} or ${VAR:-default}, and Claude Code asks for approval before it uses project servers in an interactive session. (Claude Code documentation: MCP)
Cursor: .cursor/mcp.json in the project or ~/.cursor/mcp.json for every project, also under mcpServers, with command for local servers and url for remote ones. Variables are written ${env:NAME}, and Cursor asks for approval before using MCP tools by default. (Cursor documentation: MCP)
Codex: a [mcp_servers.<server-name>] table in ~/.codex/config.toml, or in a project's .codex/config.toml for trusted projects only, added with codex mcp add. The page says the ChatGPT desktop app, Codex CLI and IDE extension share this file. (Codex documentation: MCP)
Per these pages, VS Code's portable workspace file and Claude Code's project file share the name .mcp.json, the root location and the mcpServers key, while the variable syntax differs from Cursor's. Whether one file works unchanged in both tools was not tried for this page.
For the same steps in Claude, see how to add an MCP server to Claude, and before adding any server, whether an MCP server is safe to install.
Both exist as of November 2026. VS Code's configuration reference names .mcp.json at the workspace root with mcpServers as the portable format for Copilot and marks .vscode/mcp.json with servers as the deprecated editor-managed format. Vendor pages written earlier may still show the older file.
Not into chat and not into a shared file, per VS Code's page. The portable format reads them from environment variables written ${NAME}.
Yes, through the chat.mcp.discovery.enabled setting, which is off by default for those two sources.
Compiled by Glasp from public pages read on November 21, 2026. Nothing listed here was installed, connected or run for this page; menu names and file formats change often, so check each vendor's own page before following the steps.