Add MCP servers to VS Code
VS Code runs MCP servers for its agent and chat features. Its configuration format differs from most other clients, with a servers object, an explicit type and prompted inputs for secrets. This guide walks through each part with real registry examples.
Choose where to configure servers
.vscode/mcp.jsonin a workspace defines servers in a top-levelserversobject. This is the format the registry's VS Code examples use.- Your user configuration holds servers for every workspace. Open it with the MCP: Open User Configuration command rather than guessing a path, because it lives in your profile folder.
- A portable
.mcp.jsonat the project root uses a top-levelmcpServersobject and is meant to work across several clients. It is a different format; don't pasteserversentries into it. Current VS Code docs label the workspace.vscode/mcp.jsonand user-profilemcp.jsondestinations deprecated in the guided flow while keeping them available for compatibility, and offer the workspace-root.mcp.jsondestination when the experimentalchat.mcp.workspaceRootConfig.enabledsetting is on.
You can also run MCP: Add Server from the Command Palette for a guided flow, or install servers from the Extensions view. Whichever route you take, merge new entries into the existing file instead of replacing it.
Add a remote server
Every entry has a type. Remote servers use "type": "http" and a url:
.vscode/mcp.json{
"servers": {
"notion": {
"type": "http",
"url": "https://mcp.notion.com/mcp"
}
}
}
When the server needs OAuth, VS Code walks you through sign-in the first time it starts the server. If a provider does not support dynamic client registration, VS Code asks for a client ID and secret instead; the provider's documentation tells you what to enter.
Firecrawl and Cloudflare mcp.json examples
Add these entries under servers in .vscode/mcp.json, or merge the generated examples into the file you already use. The Firecrawl MCP server setup explains its keyless and account profiles; this example uses the keyless hosted URL.
.vscode/mcp.json{
"servers": {
"firecrawl": {
"type": "http",
"url": "https://mcp.firecrawl.dev/v2/mcp"
}
}
}
The Cloudflare API MCP server uses the same HTTP shape but needs authorization. Follow the client sign-in flow, then review permissions before account operations. For public documentation without an account, choose Cloudflare Docs MCP. This is configuration syntax, not a claim that the examples have connected to a service.
.vscode/mcp.json{
"servers": {
"cloudflare": {
"type": "http",
"url": "https://mcp.cloudflare.com/mcp"
}
}
}
Add a local server with prompted secrets
Local servers use "type": "stdio" with command, args and env. Rather than writing a token into the file, the registry's examples declare an entry in inputs and refer to it as ${input:NAME}. VS Code prompts for the value the first time the server starts and stores it securely, and inputs marked "password": true are hidden while you type:
.vscode/mcp.json{
"servers": {
"grafana": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-grafana"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "${input:GRAFANA_SERVICE_ACCOUNT_TOKEN}"
}
}
},
"inputs": [
{
"id": "GRAFANA_SERVICE_ACCOUNT_TOKEN",
"type": "promptString",
"description": "GRAFANA_SERVICE_ACCOUNT_TOKEN",
"password": true
}
]
}
Because the file only contains the prompt definition, a .vscode/mcp.json written this way can be committed and shared. Values that are not secret, such as a local URL, can stay as plain strings. One limitation: sessions running on VS Code's Agent Host do not forward servers that need interactive ${input:...} values, so use an environment-based setup if you target that host.
Trust: what VS Code asks before starting a server
A local MCP server is a program that runs with your user account, so VS Code treats starting one as a trust decision. Servers in .vscode/mcp.json follow Workspace Trust: if you trust a workspace, its servers can start. That makes it important to read a repository's MCP configuration before you trust it, exactly as you would read its build scripts.
Servers from other sources get their own trust prompt the first time they start. If you decline, the server does not run and chat continues without its tools. MCP: Reset Trust clears those decisions without changing Workspace Trust.
Sandbox local servers
On macOS and Linux, VS Code can sandbox a local stdio server to limit its access to the file system and network. Set "sandboxEnabled": true on the server entry and describe what it may touch in a sandbox section. Tool calls from a sandboxed server are approved automatically because they run in a controlled environment, so sandboxing is a good fit for servers you call often, such as browser automation or documentation tools.
Manage and debug servers
- MCP: List Servers shows every server with actions to start, stop, enable, disable or show output. Enable and disable choices are stored separately from
mcp.json, so they don't change a shared file. - The MCP output log is the first place to look when a server fails. Open it from the server's Show Output action or from the error notification in chat.
- VS Code can start servers automatically when you send a chat message; the
chat.mcp.autostartsetting controls this. - Settings Sync can copy your user MCP configuration to other machines. Workspace files travel with the repository instead.
Servers to try
These current servers need no account, which makes them a low-risk way to confirm your setup works:
- Cloudflare Docs HTTP · Not required
- Context7 HTTP · Not required
- Exa HTTP · Not required
- Firecrawl HTTP · Not required
- Hugging Face HTTP · Not required
- AWS Knowledge HTTP · Not required
- Microsoft Learn HTTP · Not required
Every registry listing has a VS Code example. For the reasoning behind prompted inputs and least-privilege tokens, read authentication and security basics.
More setup guides
Sources
This guide was written from the official documentation below and last reviewed on 6 November 2026. Client interfaces change often; when a menu or file name here differs from what you see, the upstream documentation wins. Report a correction through the contact page.