MCP + Your Editor = Superpowers
The Model Context Protocol turns your editor's AI assistant from a generic chatbot into a context-aware development partner. By connecting MCP servers, your AI can read your files, query your database, check your Git history, search the web, remember context across sessions, and interact with your infrastructure - all without you copy-pasting context into chat windows.
If you have ever wished your AI coding assistant understood your actual project rather than just the snippet you pasted, MCP is the answer. It creates a standardized bridge between AI clients and the tools developers already use, and the ecosystem has matured rapidly since its introduction. Today there are dozens of production-ready servers covering everything from cloud infrastructure to design systems.
This guide covers setup for the three most popular MCP-compatible clients - Cursor, VS Code (with GitHub Copilot), and Claude Desktop - plus newer entrants like Claude Code (CLI), Windsurf, and Cline. We will configure five essential servers in each: Filesystem, GitHub, PostgreSQL, Brave Search, and Memory. By the end, you will have a fully wired AI development environment regardless of which client you prefer.
Client Feature Comparison
Before diving into setup, it helps to understand what each client supports. The table below summarizes the key differences you will encounter when configuring MCP servers across clients.
| Feature | Claude Desktop | Cursor | VS Code (Copilot) |
|---|---|---|---|
| MCP support level | Native, first-party | Native, first-party | Via Copilot Chat extension |
| Config file location | claude_desktop_config.json (global only) | .cursor/mcp.json (project) or ~/.cursor/mcp.json (global) | .vscode/settings.json (project) or User settings (global) |
| Max recommended servers | 10-12 | 8-10 | 5-8 |
| Transport support | stdio, SSE | stdio, SSE | stdio, SSE |
| Auto-reconnect on crash | Yes (with retry backoff) | Yes | Manual restart required |
| GUI for adding servers | No (JSON only) | Yes (Settings panel) | No (JSON only) |
| Tool approval prompts | Per-tool confirmation | Yolo mode available | Per-tool confirmation |
| Project-level config | No | Yes | Yes |
As you can see, each client has different strengths. Claude Desktop offers the most polished standalone MCP experience. Cursor has the richest IDE integration with project-level configs and a dedicated settings panel. VS Code brings MCP into the Copilot ecosystem but requires a bit more manual configuration. Choose based on your existing workflow, or use multiple - the same MCP servers work identically across all clients.
Claude Desktop Setup
Configuration File Location
Claude Desktop reads MCP server configuration from a single global JSON file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
If the file does not exist yet, create it manually. Claude Desktop will read it on startup.
Finding MCP Settings in the UI
Claude Desktop does not have a graphical panel for MCP configuration - all setup is done by editing the JSON config file directly. However, once servers are connected, you will see a small hammer-and-wrench icon in the bottom-left corner of the chat input area. Clicking this icon reveals a panel listing all connected servers and their available tools. A green dot next to a server name indicates a healthy connection, while a red dot means the server failed to start or has crashed. You can hover over any tool name to see its description and expected parameters.
Full Configuration Example (5 Servers)
Here is a complete configuration with all five essential servers - filesystem, GitHub, PostgreSQL, Brave Search, and Memory:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"],
"env": {}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://user:pass@localhost:5432/mydb"],
"env": {}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA_your_key_here"
}
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {}
}
}
}
After saving, fully quit Claude Desktop (not just close the window - use Cmd+Q on macOS or exit from the system tray on Windows) and relaunch it. You will see the MCP tools icon appear in the chat input area. For detailed Claude integration patterns, see our Claude Integration Tutorial.
Verifying the Connection
Ask Claude: "What MCP tools are available?" It should list the resources and tools from each configured server. If a server fails to connect, check the logs at ~/Library/Logs/Claude/mcp*.log on macOS or %APPDATA%\Claude\logs\ on Windows. You can also look for specific error indicators: if the hammer icon shows a number badge like "3/5," it means only three of your five servers connected successfully. Click the icon to see which ones failed.
Cursor Setup
Finding MCP Settings in the UI
Cursor provides the most visual MCP setup experience of any client. To access it, open Cursor and navigate to Settings (Cmd+, on macOS, Ctrl+, on Windows/Linux), then scroll down to the MCP section in the left sidebar. You will see a dedicated panel where each configured server appears as a card showing its name, status (a green "Running" badge or red "Error" badge), and the number of tools it exposes. There is an "Add Server" button at the top that opens a form for command, args, and environment variables - though most developers find editing the JSON file directly to be faster for bulk configuration.
In the Composer panel (Cmd+I), connected MCP tools appear as available actions. When the AI decides to use an MCP tool, you will see a tool-use block in the conversation showing which server and tool were invoked, along with the parameters and result.
Full Configuration Example (5 Servers)
Create or edit .cursor/mcp.json in your project root:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://user:pass@localhost:5432/mydb"],
"env": {}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA_your_key_here"
}
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {}
}
}
}
Pro Tips for Cursor
- Project-level configs: Put
.cursor/mcp.jsonin your project root for project-specific servers - Global configs: Use
~/.cursor/mcp.jsonfor servers you want everywhere - Combine with rules: Add a
.cursorrulesfile that references your MCP servers for better AI behavior - Database access: Add the PostgreSQL or SQLite server for AI-assisted query writing
- SSE transport: For remote servers, use the
"url"key instead of"command"- e.g.,"url": "http://localhost:3001/sse" - Restart servers individually: In the MCP settings panel, each server has a restart button so you do not need to reload the entire editor
VS Code Setup (GitHub Copilot)
Prerequisites
MCP support in VS Code requires:
- VS Code 1.99+ (Stable channel - MCP graduated from Insiders in early 2026)
- GitHub Copilot extension (v1.250+)
- GitHub Copilot Chat extension (v0.25+)
Finding MCP Settings in the UI
VS Code does not have a dedicated MCP settings panel like Cursor. Instead, you configure servers through standard VS Code settings JSON. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and search for "Preferences: Open Workspace Settings (JSON)" to edit the project-level config, or "Preferences: Open User Settings (JSON)" for global config. Once servers are configured and running, you can see their status by opening Copilot Chat (Ctrl+Shift+I) and clicking the tools icon at the top of the chat panel. Each connected server shows a checkmark, and you can click on any server to see its available tools. If a server is not running, you will see a warning triangle icon next to its name.
Full Configuration Example (5 Servers)
Add MCP servers to your VS Code settings (.vscode/settings.json):
{
"github.copilot.chat.mcp.servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://user:pass@localhost:5432/mydb"],
"env": {}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA_your_key_here"
}
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {}
}
}
}
Using MCP in Copilot Chat
Once configured, Copilot Chat can access MCP tools. Use the @workspace agent and ask questions that require MCP data - Copilot will automatically use the available tools. You can also explicitly reference tools by typing # in the chat to see a list of available MCP tools. For example, typing #brave-search will let you ask Copilot to search the web for documentation before answering your question.
Claude Code (CLI) Setup
Claude Code is Anthropic's terminal-based AI coding agent, and it has full MCP support. Unlike the other clients, Claude Code runs entirely in your terminal, making it ideal for remote development, SSH sessions, and CI/CD pipelines.
Configuration
Claude Code reads MCP configuration from .claude/settings.json in your project root (project-level) or ~/.claude/settings.json (global). The format nests server definitions under an "mcpServers" key:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgres://user:pass@localhost:5432/mydb"],
"env": {}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA_your_key_here"
}
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {}
}
}
}
You can also add servers interactively using the /mcp slash command inside a Claude Code session. This opens a guided flow that writes to the settings file for you. To verify connected servers, type /mcp and you will see a list with status indicators.
Why Use Claude Code for MCP?
Claude Code is especially powerful with MCP because it can chain tool calls autonomously - for example, reading your filesystem, checking git status, querying your database, and searching documentation all in a single reasoning loop. It also supports background agent mode with --background, allowing long-running MCP-powered workflows to continue while you work on other things.
Windsurf and Cline
While Claude Desktop, Cursor, and VS Code are the most popular MCP clients, two other notable clients deserve mention.
Windsurf
Windsurf (formerly Codeium's editor) added MCP support in its 2.x releases. Configuration lives in .windsurf/mcp.json in your project root, and the format is identical to Cursor's - a top-level "mcpServers" object with named server entries. Windsurf's "Cascade" AI agent can use MCP tools during its multi-step reasoning, making it a strong choice if you are already in the Windsurf ecosystem. To add servers, open Settings and navigate to the Cascade section, where you will find an MCP configuration panel similar to Cursor's.
Cline
Cline is an open-source VS Code extension that provides autonomous AI coding with MCP support. It stores MCP configuration in its extension settings and provides a visual panel for managing servers. Cline's approach to MCP is distinctive: it shows every tool call in a step-by-step approval flow, giving you fine-grained control over what the AI does. This makes it excellent for learning how MCP works, since you can observe every interaction between the AI and your servers. Configure servers through the Cline settings panel in VS Code's sidebar, or edit the extension settings JSON directly.
Essential MCP Servers for Every Setup
Regardless of which client you use, these servers provide the most value:
- Filesystem Server: Let AI read and navigate your project files. This is the most fundamental server - without it, your AI cannot see your code.
- GitHub Server: Repository browsing, issue management, PR reviews, and code search across your organization
- Git Server: Commit history, diffs, branch management, and blame annotations
- PostgreSQL or SQLite: Database access for query help, schema exploration, and data analysis. See our database servers comparison
- Brave Search: Web search for documentation, error messages, and up-to-date library information
- Memory Server: Persistent context across conversations - remembers your preferences, project conventions, and past decisions
Advanced: Project-Level vs Global Configs
Most MCP clients support both project-level and global configurations, and knowing when to use each can save you significant time and prevent security issues.
When to Use Global Config
Global configs apply to every project you open. They are ideal for:
- General-purpose servers like Brave Search and Memory that are useful regardless of project
- Personal productivity servers like calendar or email integrations
- Servers that do not need project-specific parameters - if the server works the same everywhere, configure it globally
Global config locations by client:
- Cursor:
~/.cursor/mcp.json - VS Code: User Settings JSON (Cmd+Shift+P → "Open User Settings (JSON)")
- Claude Desktop: Global only (see config paths above)
- Claude Code:
~/.claude/settings.json
When to Use Project-Level Config
Project-level configs are scoped to a single workspace. Use them for:
- Database servers where connection strings differ per project - your e-commerce app connects to a different Postgres instance than your analytics service
- Filesystem servers with restricted paths relevant to that project only
- Custom or internal MCP servers specific to a team or codebase
- Servers with project-specific API keys - for example, a staging vs production environment
Project-level config locations by client:
- Cursor:
.cursor/mcp.jsonin the project root - VS Code:
.vscode/settings.jsonin the project root - Claude Code:
.claude/settings.jsonin the project root
Precedence Rules
When the same server name appears in both global and project-level configs, the project-level config wins. This means you can define a default "postgres" server globally that connects to a dev database, then override it in specific projects to point at project-specific databases. This layered approach keeps your config DRY while allowing per-project customization.
Performance Tuning: How Many Servers Is Too Many?
A common question from developers new to MCP is how many servers they can run simultaneously. The answer depends on your hardware, the servers themselves, and how your client handles them.
Startup Time Impact
Each MCP server is a separate process that your client spawns on startup (for stdio transport) or connects to (for SSE transport). With npx-based servers, each one also performs a package resolution step on first launch. Here is what to expect:
- 1-3 servers: Negligible startup overhead. Servers are ready within 2-5 seconds.
- 4-7 servers: Noticeable but acceptable. Expect 5-15 seconds for all servers to initialize, primarily due to npx package resolution.
- 8-12 servers: You may see 15-30 seconds of startup time. Consider globally installing frequently-used packages (
npm install -g @modelcontextprotocol/server-filesystem) to skip npx resolution. - 13+ servers: Diminishing returns. Some clients may time out waiting for servers. Consider using SSE transport for remote servers to avoid local process overhead.
Memory Consumption
Each stdio-based MCP server runs as a Node.js process consuming approximately 30-80 MB of RAM. With 10 servers, that is 300-800 MB dedicated to MCP alone. On machines with 8 GB RAM, this can noticeably impact editor performance. If you are hitting memory limits:
- Disable servers you are not actively using
- Use project-level configs so only relevant servers start for each project
- Consider SSE-based remote servers that run on a separate machine or container
- Pre-install packages globally to reduce Node.js resolver memory spikes
Practical Recommendation
For most developers, 5-8 servers is the sweet spot. This gives you comprehensive coverage (filesystem, git, database, search, memory, plus 1-3 specialized servers for your stack) without noticeable performance degradation. If you find yourself configuring more than 10, ask whether some can be consolidated or whether you truly need all of them in every session.
Troubleshooting Common Issues
Even with correct configuration, MCP servers can fail in surprising ways. Here are real error scenarios with their solutions.
Server Won't Start: "npx: command not found"
This error appears when your client cannot find the npx binary, typically because the PATH in the client's environment differs from your terminal's PATH.
Error: spawn npx ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
Fix: Use the full path to npx in your config. Find it by running which npx in your terminal (e.g., /usr/local/bin/npx or /opt/homebrew/bin/npx), then replace "command": "npx" with the full path. Alternatively, on macOS, launching your client from the terminal (open -a "Claude" or cursor .) ensures it inherits your shell's PATH.
Server Starts But Immediately Crashes
[ERROR] MCP server "postgres" exited with code 1
stderr: Error: connect ECONNREFUSED 127.0.0.1:5432
Fix: The MCP server process started but could not connect to its backing service. For database servers, ensure the database is actually running. Run pg_isready for PostgreSQL or check docker ps if your database runs in a container. For GitHub, verify your token has not expired by running curl -H "Authorization: token ghp_your_token" https://api.github.com/user.
JSON Parse Error in Config
[ERROR] Failed to parse MCP config: Unexpected token '}' at position 342
Fix: This almost always means a trailing comma in your JSON. JSON does not allow trailing commas after the last item in an object or array. Paste your config into a JSON validator like jsonlint.com, or use VS Code's built-in JSON validation (which underlines errors with red squiggles). Common culprits: a comma after the last server definition, or a missing closing brace.
Server Connects But No Tools Appear
You see the server listed as "connected" in your client, but when you ask the AI to use its tools, nothing happens or the AI says it has no matching tools.
- Restart your client after config changes - some clients cache the tool list from the initial handshake
- Check server arguments: Some servers require specific arguments to expose tools. The filesystem server needs at least one directory path; without it, it starts but exposes zero tools
- Version mismatch: Older server versions may not implement the latest MCP tool-listing protocol. Update with
npx -y @modelcontextprotocol/server-filesystem@latest - Verify manually: Run the server command directly in your terminal and check its stdout for the initialization handshake. You should see a JSON-RPC message listing capabilities
Environment Variable Not Picked Up
[ERROR] MCP server "github" tool call failed: HttpError: Bad credentials
at /node_modules/@octokit/request/dist-src/fetch-wrapper.js:88:21
Fix: The server started but its API token was not set or is invalid. Double-check that your "env" block uses the exact environment variable name the server expects (e.g., GITHUB_PERSONAL_ACCESS_TOKEN, not GITHUB_TOKEN). Also verify the token value has no leading/trailing whitespace - copying from a password manager sometimes adds invisible characters. Test the token independently: GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx npx -y @modelcontextprotocol/server-github.
Timeout During Tool Execution
[WARN] MCP tool call timed out after 30000ms: postgres.query
Fix: The server is connected but a specific tool call is taking too long. For database servers, this usually means a slow query. Add query timeouts to your connection string: postgres://user:pass@localhost:5432/mydb?statement_timeout=10000. For filesystem servers accessing large directories, restrict the path to a more specific subdirectory.
Permission Denied Errors
[ERROR] MCP server "filesystem" tool error: EACCES: permission denied, scandir '/etc/ssl'
Fix: The filesystem server is trying to access a directory your user does not have permission to read. Restrict the allowed paths in your config to only the directories the AI actually needs. Never configure the filesystem server to access / or your entire home directory - scope it to your project directory.
Security Reminders
Before configuring MCP servers in any client, review our complete MCP security guide. Key points:
- Never commit config files with API tokens to version control
- Add
claude_desktop_config.json,.cursor/mcp.json, and.vscode/settings.jsonto.gitignore - Use environment variables for sensitive values - most clients support referencing system environment variables in config
- Restrict file system access to project directories only - never grant access to
/,~, or sensitive directories like~/.ssh - Audit third-party MCP servers before installing - check the source code, verify the npm package publisher, and prefer official Anthropic-maintained servers when available
- Rotate API tokens regularly, especially if they are stored in config files on shared machines
What's Next
Now that your editor is connected to MCP, explore what's possible:
- Best database MCP servers - connect AI to your data
- Build your own MCP server in Python - create custom integrations
- Browse all 40+ MCP servers - find the right tools for your workflow
- MCP tutorials - from beginner to advanced
