How to Add an MCP Server to VS Code
How to add an MCP server to VS Code: the Command Palette flow, the .vscode/mcp.json schema, and where to copy real command values from instead of guessing.
VS Code has had built-in MCP support since it reached general availability in version 1.102 (July 2025): open the Command Palette and run "MCP: Add Server", or create a .vscode/mcp.json file in your project with a servers block holding a command and args (for a local server) or a url (for a remote one). Reload the window and GitHub Copilot Chat's Agent Mode picks up the new tools automatically — no extension beyond Copilot Chat itself is required.
Three ways to add a server, and which one to use
VS Code gives you three entry points, and they write to the same place. The first is the Command Palette: press Ctrl/Cmd+Shift+P, run "MCP: Add Server", choose Workspace (writes to .vscode/mcp.json, shareable with your team via git) or Global (writes to your user profile, private to you), and follow the guided prompts for command, arguments and any secrets. This is the path to use if you don't already have the server's exact configuration memorized.
The second is editing .vscode/mcp.json by hand, or running "MCP: Open User Configuration" from the Command Palette to open the equivalent user-level file. This is the fastest path once you already have a config block copied from somewhere — a README, a teammate's message, or a directory listing — and just need to paste it in.
The third, less commonly documented, is the command line: code --add-mcp '{"name":"my-server","command":"npx","args":["-y","some-mcp-package"]}' adds a server without opening the editor at all, useful in a dotfiles script or a new-machine onboarding checklist. All three end up in the same underlying config, so pick whichever fits the moment rather than treating one as more "correct" than the others.
What a server entry actually needs
Every entry under servers is one of two shapes. A local server runs over stdio and needs a command plus an args array — for example npx and ["-y", "@some-org/mcp-server"] — exactly like the command/args pair Claude Code or Cursor would use for the same package. A remote server skips command and args entirely and instead takes a single url, pointing at a Streamable HTTP or SSE endpoint the server operator hosts and manages; GitHub's own Copilot MCP endpoint, for instance, is exposed this way rather than as an installable package.
The detail that trips people up moving between clients: VS Code nests everything under a top-level servers key, while Claude Code and Cursor both use mcpServers for the identical inner structure. Copy a config block from a Claude Code guide into .vscode/mcp.json without renaming that outer key, and VS Code will silently ignore the whole file — no error, just no tools.
For anything that needs a token or API key, VS Code's schema has an inputs array — entries of type promptString (optionally password: true to mask it), pickString for a fixed set of choices, or command to shell out to a credential helper. You reference the resolved value inside a server's env block as ${input:your-id}. This keeps a real secret out of the file entirely, which matters once .vscode/mcp.json is checked into a shared repo.
A worked example, straight from the MCPizy directory
Rather than retype a command from memory, MCPizy's directory catalogues 344 MCP servers, and most listings carry a ready-to-paste install command — though not every one does, so check the fiche before assuming. Open any fiche — /directory/linear, for instance — and the value shown there is the same command/args pair (or, for a remote server, the same url) you drop straight into VS Code's servers block; only the outer key changes.
Take a stdio example. The Context7 fiche lists its install command as npx -y @upstash/context7-mcp; the executable becomes "command" and everything after it becomes "args", which gives you this in .vscode/mcp.json: { "servers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] } } }.
A remote example looks different because there's no package to run locally — just a url the server operator hosts, which is the shape you'll see for any MCP server shipped as a hosted service rather than an npm package.
Turning the server on in Copilot Chat
Adding a server to mcp.json doesn't invoke it by itself — VS Code needs GitHub Copilot Chat installed and signed in, since that's the surface where MCP tools actually get called. The free tier of Copilot works for this (it has request limits, not a feature gate on MCP), so a paid plan isn't a prerequisite.
Once the extension is active, switch Copilot Chat to Agent Mode and reload the window; the server's tools appear in the tool picker without any extra registration step, and Agent Mode decides on its own which tool to call based on your prompt, the same way it would for a built-in file-edit tool.
Mistakes that keep a server from loading
Almost every "it's not working" report traces back to one of three things. First, the servers-versus-mcpServers key mismatch described above — check that exact spelling before anything else. Second, a hardcoded secret that got typo'd or expired silently; move it into inputs and you'll at least get a visible prompt instead of a silent auth failure.
Third, expecting an install command to configure VS Code automatically: MCPizy's own CLI (mcpizy install <slug>) currently writes only to Claude Code's ~/.claude.json, so for VS Code you still copy the command/args or url from a directory fiche into .vscode/mcp.json by hand — there's no one-line install for this client yet. Knowing that up front saves a few minutes of assuming you did something wrong.
Frequently asked questions
Do I need GitHub Copilot to use MCP in VS Code?
Yes — MCP support itself is built into VS Code for free, but the surface that calls MCP tools is Copilot Chat's Agent Mode, which needs the Copilot extension and a signed-in account. The free Copilot tier is enough; it limits your request volume, not which MCP features you can use.
What's the difference between .vscode/mcp.json and my Claude Code or Cursor config?
The inner shape is identical — command, args, env, or url per server. The only difference is the outer key: VS Code uses servers, Claude Code and Cursor both use mcpServers. Renaming that one key is the entire migration in either direction.
Can I add a remote MCP server without installing anything locally?
Yes. A remote server entry skips command and args and uses a url instead, pointing at a hosted Streamable HTTP or SSE endpoint the server operator runs — nothing gets installed on your machine, and VS Code connects to it directly (with an OAuth prompt if the server requires authentication).
Why isn't my newly added server showing up in Copilot Chat?
Reload the VS Code window first — config changes aren't always picked up live. If it still doesn't appear, re-check the outer key is servers (not mcpServers), that the JSON is valid, and that you're in Agent Mode rather than Ask or Edit mode, since only Agent Mode surfaces MCP tools.
Does MCPizy's "mcpizy install" command set up VS Code for me?
Not yet — it writes to ~/.claude.json for Claude Code only. For VS Code, grab the command/args (or url) from the server's MCPizy directory page and paste it into .vscode/mcp.json under servers yourself.