Best MCPs for VS Code in 2026 (Agent Mode + .vscode/mcp.json)
The six MCPs every VS Code agent-mode user should install in 2026 are: Filesystem, Context7, GitHub, Git, Postgres MCP Pro, and Fetch. Install snippets, a full .vscode/mcp.json, and FAQ below.
VS Code now ships MCP support inside its built-in chat — no extension required, just a .vscode/mcp.json at the workspace root. The right stack turns Agent mode from a smart autocomplete into a real coding agent that can read repos, run queries, and pull current docs. Here are the six worth installing first.
Why VS Code + MCPs?
VS Code's built-in chat and agent mode are powerful on their own — they understand the open file, the terminal, and basic refactors. What they cannot do without MCP is reach outside the workspace: query a database, look up current third-party docs, run a real browser, or operate on a repo via the GitHub API.
MCP servers fill those gaps with a workspace-scoped config (.vscode/mcp.json) that travels with the repo. Commit it once and every contributor — on macOS, Linux, or Windows — gets the same setup. VS Code adds two niceties on top of the standard MCP shape: ${workspaceFolder} expansion so paths follow the open project, and a password-type inputs system so tokens stay in the OS secret store, never in cleartext.
Setup time
15–25 min for all 6 MCPs
Impact
Same MCPs across every contributor and OS
Cost
All 6 are free or open source
The 6 MCPs every VS Code user should install
Picked for VS Code's mix of editor-driven and agent-mode workflows. Each one is workspace-friendly — pass ${workspaceFolder} where it matters and the MCP scopes itself to the open project automatically.
Filesystem
2 min setupMost AI workflows involve reading or modifying files. This MCP is the standard way to give models that access without exposing the full system.
npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir
Context7
3 min setupModels hallucinate outdated APIs constantly. Context7 eliminates this by grounding every answer in real, current documentation.
npx -y @upstash/context7-mcp
GitHub
5 min setupGitHub is where most code lives. This MCP lets agents interact with that code directly, without copy-pasting between interfaces.
Git
2 min setupDevelopers need Git context to understand code history and changes. This MCP gives models that context directly, improving code assistance quality.
uvx mcp-server-git --repository /path/to/repo
Postgres MCP Pro
5 min setupThe official Postgres MCP is read-only and intentionally minimal. Postgres MCP Pro fills the gap when you want index advice, performance analysis, or write capability under controlled circumstances.
uvx postgres-mcp
Fetch
1 min setupReading web pages is a fundamental research task. This MCP makes any URL readable in a model context without browser overhead.
uvx mcp-server-fetch
Use ${'$'}{`{workspaceFolder}`}, not absolute paths
How to configure MCPs in VS Code
VS Code reads MCP configuration from .vscode/mcp.json (workspace) or settings.json (user-wide). The four-step setup, focused on the workspace path most teams use:
Create .vscode/mcp.json at the repo root
VS Code looks for an mcp.json under .vscode in every workspace. Create the file at your repo root if it does not exist — VS Code picks it up the next time you open the workspace. Commit it to share the same MCPs with every contributor.
.vscode/mcp.json
Add servers under the "servers" key
VS Code uses "servers" instead of Claude Desktop's "mcpServers" — that is the only structural difference. Use ${workspaceFolder} to scope filesystem access to the currently open project so the MCP follows the workspace.
{
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}Use inputs for tokens (not raw env values)
Declare a password-type input, reference it via ${input:id} in env, and VS Code prompts once on first use and stores the value in its encrypted secret storage. The committed mcp.json never contains the token, even in cleartext.
{
"inputs": [
{
"type": "promptString",
"id": "github_pat",
"description": "GitHub personal access token",
"password": true
}
],
"servers": {
"github": {
"command": "npx",
"args": ["@github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_pat}"
}
}
}
}Enable + verify from the Command Palette
Open the Command Palette, run "MCP: List Servers", and toggle each server on. VS Code launches the process and surfaces any startup error inline. Then open the Chat view, switch to Agent mode, and the MCP tools appear in the Tools picker.
Cmd/Ctrl+Shift+P → "MCP: List Servers"
Full .vscode/mcp.json with all 6 MCPs
Copy this into your repo's .vscode/mcp.json. It uses the inputs feature for tokens (so secrets stay in VS Code's secret storage) and ${workspaceFolder} expansion so paths follow the open project.
{
"inputs": [
{
"type": "promptString",
"id": "github_pat",
"description": "GitHub personal access token",
"password": true
},
{
"type": "promptString",
"id": "database_url",
"description": "Postgres connection string",
"password": true
}
],
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"github": {
"command": "npx",
"args": ["@github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_pat}"
}
},
"git": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-git",
"--repository",
"${workspaceFolder}"
]
},
"postgres": {
"command": "uvx",
"args": ["postgres-mcp"],
"env": {
"DATABASE_URI": "${input:database_url}"
}
},
"fetch": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"]
}
}
}Inputs prompt once, then live in OS secret storage
Quick comparison
| MCP | Primary use in VS Code | Setup | Auth |
|---|---|---|---|
| Filesystem | Read/write files outside the open file | 2 min | None |
| Context7 | Up-to-date library documentation | 2 min | None |
| GitHub | PRs, issues, code search across repos | 5 min | GitHub PAT (input) |
| Git | Local git status, diff, stage, commit | 2 min | None |
| PostgreSQL | Read-only schema + queries | 3 min | Connection string (input) |
| Fetch | Pull a URL as clean Markdown | 1 min | None |
Common gotchas
"servers" vs "mcpServers"
VS Code uses "servers" as the top-level key. Claude Desktop, Cursor, and Windsurf use "mcpServers". Copy-pasting between configs is otherwise identical, but the rename is the most common silent failure when migrating.
Workspace config wins over user config
If both .vscode/mcp.json and settings.json define a server with the same name, the workspace file wins. That is usually what you want — but be deliberate when you mix them, especially around tokens.
Inputs are only re-prompted on cache invalidation
Once you enter a token via an input, VS Code remembers it. Use the Command Palette → "MCP: Reset Cached Inputs" to force a re-prompt, for example after rotating a GitHub PAT.
${`{`}workspaceFolder{`}`} is empty without a workspace
If you open a single file in VS Code without opening its parent folder as a workspace, ${`{`}workspaceFolder{`}`} expands to an empty string and the Filesystem MCP launches with no allowlisted directory. Always open the folder, not the file.
Frequently asked questions
Do I need an extension to use MCP in VS Code?
No. Modern VS Code includes MCP support in its built-in chat and agent-mode tooling. If MCP commands do not appear in your Command Palette, update to the latest VS Code release — MCP is part of the core agent features, not a separate extension.
Where does VS Code store its MCP config?
Two places. Workspace config lives at .vscode/mcp.json in your repo root and is the preferred location. User-wide config lives in your settings.json under "mcp.servers" — open it via Cmd/Ctrl+Shift+P → "Preferences: Open User Settings (JSON)".
What is the difference between .vscode/mcp.json and settings.json?
Scope. .vscode/mcp.json is committed with the repo so every contributor gets the same MCPs. settings.json is user-wide and applies across every workspace you open. Use the workspace file for project-shared servers (Postgres, internal APIs) and settings.json for personal tools.
Can I use workspace variables like ${workspaceFolder} in mcp.json?
Yes. VS Code expands variables like ${workspaceFolder}, ${userHome}, and ${env:VAR_NAME} inside args. The cleanest way to scope a Filesystem MCP to the open project is to pass ${workspaceFolder} as the directory argument.
Where do I store API tokens safely in VS Code?
Use the inputs feature: declare a password-type input in mcp.json, reference it in env, and VS Code prompts once and stores the value in its secure secret storage. The token is never written to disk in plain text — far safer than putting it directly in the env block.
Can VS Code and Cursor share the same MCP config?
Not directly — Cursor reads .cursor/mcp.json and VS Code reads .vscode/mcp.json. The JSON shape is nearly identical (Cursor uses "mcpServers", VS Code uses "servers"), so copy-paste works with one rename. Commit both files if your team uses both editors.
How do I see what MCPs are connected in VS Code?
Open the Command Palette → "MCP: List Servers". You see every configured server with its status, the JSON entry, and any errors. From the Chat view (Agent mode), the Tools picker shows every MCP tool currently available to the model.
More for VS Code
See the full VS Code client page for the complete config reference, the latest top picks, and the inputs feature in detail.
More guides
Ranked Guide
Best MCP Servers for Postgres in 2026 (Ranked)
12 min read
Ranked Guide
Best MCP Servers for Browser Automation in 2026 (Ranked)
12 min read
Ranked Guide
Best MCP Servers for Vector Databases in 2026 (RAG-Ready)
11 min read
Ranked Guide
Best MCP Servers for Git in 2026 (GitHub, GitLab, Bitbucket, Local)
11 min read
Ranked Guide
Best MCP Servers for Workflow Automation in 2026 (Ranked)
11 min read
Ranked Guide
Best Free MCP Servers in 2026 (No API Key Required)
10 min read
Comparison
GitHub vs GitLab MCP: Which to Use in 2026
8 min read
Comparison
Pinecone vs Qdrant vs Chroma MCP: Which to Use (2026)
9 min read
Comparison
Playwright vs Browserbase MCP: Local vs Cloud (2026)
8 min read
Comparison
Postgres MCP vs Supabase MCP: Which to Use (2026)
8 min read
Comparison
n8n vs Zapier vs Make MCP: Which to Use (2026)
9 min read
Ranked Guide
Best MCP Servers for Deploying Websites in 2026 (Ranked)
11 min read
Comparison
Vercel vs Netlify vs Cloudflare MCP: Which to Use (2026)
9 min read
Tutorial
Deploy to Vercel With an AI Agent (Vercel MCP, 2026)
7 min read
Tutorial
Deploy to Cloudflare With an AI Agent (Cloudflare MCP, 2026)
7 min read
Strategy
Can an AI Agent Deploy to Production? (Safely, in 2026)
8 min read
Fundamentals
What Is MCP? A Plain-English Guide to Model Context Protocol
6 min read
Setup Guide
Best MCPs for Cursor in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Claude Desktop in 2026 (Ranked + Setup)
9 min read
Setup Guide
Best MCPs for Claude Code in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Codex CLI in 2026 (Ranked + config.toml)
8 min read
Setup Guide
Best MCPs for Windsurf in 2026 (Cascade-Ready Setup)
8 min read
Vertical Guide
Best MCPs for Marketing in 2026 (Ranked + Use Cases)
9 min read
Vertical Guide
Best MCPs for SEO in 2026 (Ranked + Workflows)
9 min read
Vertical Guide
Best MCPs for Data Teams in 2026 (Ranked + Workflows)
9 min read
Vertical Guide
Best MCPs for Security in 2026 (Ranked + Posture Workflows)
10 min read
Strategy
MCP Registry vs Curated Directory: Which Should You Use?
5 min read
Setup Guide
Best MCPs for ChatGPT: The Apps and Connectors Worth Installing
9 min read
Tutorial
How to Add an MCP Server to ChatGPT (Developer Mode + Apps Directory)
7 min read
Security
MCP Security: What to Know Before You Install
9 min read
Role Guide
Best MCPs for Marketers in 2026 (SEO, Email, Analytics)
8 min read
Strategy
Remote vs Local MCP Servers: When to Use Each
7 min read
Fundamentals
MCP vs Function Calling: What’s the Difference?
6 min read
Comparison
MCP Directories Compared: Top MCPs vs mcp.so vs PulseMCP vs mcp.directory
8 min read
Security
MCP Prompt Injection: How Tool-Calling Agents Get Hijacked
8 min read
Security
OAuth 2.1 for MCP: What the Spec Standardised and What You Need to Know
8 min read
Security
Sandboxing MCP Servers: Containers, Least Privilege, and Process Isolation
9 min read
Security
Rotating MCP Credentials: A Practical Guide for Leaks, Expiry, and Routine Hygiene
7 min read
Security
Least-Privilege Scoping for MCPs: How to Grant the Smallest Useful Permission
7 min read
Setup Guide
Best MCP Servers for Databases in 2026 (Ranked + Setup)
10 min read
Setup Guide
Best MCP Servers for Research in 2026 (Search, Scrape, Synthesize)
9 min read
Setup Guide
Best MCP Servers for Design-to-Code in 2026 (Figma → React)
9 min read
Setup Guide
Best MCP Servers for Domains in 2026 (Registrars + DNS)
9 min read
Tutorial
How to Buy a Domain From Claude (Cloudflare MCP, Step by Step)
6 min read
Tutorial
How to Search for Domains With an AI Agent (Cross-Registrar Workflow)
7 min read
Tutorial
How to Deploy a Website With an AI Agent (MCP Workflow)
8 min read