How to Set Up MCP Servers in Claude Desktop, Cursor IDE & VS Code
The definitive technical walkthrough for installing, configuring, testing, and debugging Model Context Protocol servers across major AI development environments.
1. Prerequisites & Environment Verification
Before configuring Model Context Protocol servers in your IDE or desktop assistant, ensure your local development workstation satisfies the following foundational runtime dependencies:
- Node.js 18.0.0+ or Node.js 20 LTS: Required to execute `npx` packages for TypeScript-based MCP servers. Verify via
node -v. - Python 3.10+ (with `uv` or `pip`): Required for Python-based servers. Install `uv` via
curl -LsSf https://astral.sh/uv/install.sh | sh. - Target AI Client Host: Claude Desktop (v0.7+), Cursor IDE (v0.40+), VS Code with Cline/Roo Code extension, or Zed Editor (v0.160+).
- Target Service API Keys: API tokens for services you intend to link (e.g. GitHub Personal Access Token, Stripe Secret Key, or PostgreSQL connection URI).
2. Claude Desktop Complete Setup Guide
Claude Desktop reads MCP server declarations from a single configuration file named claude_desktop_config.json upon application startup.
Step 2.1: Locate the Config Path
- macOS Path:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows Path:
%APPDATA%\Claude\claude_desktop_config.json - Linux Path:
~/.config/Claude/claude_desktop_config.json
Quick terminal command to open in VS Code: code ~/Library/Application\ Support/Claude/claude_desktop_config.json
Step 2.2: Add Multi-Server JSON Configuration
Populate your configuration file with the following multi-server JSON recipe connecting GitHub, PostgreSQL, and Stripe simultaneously:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourPersonalAccessTokenHere"
}
},
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://username:password@localhost:5432/my_database"
]
},
"stripe": {
"command": "npx",
"args": ["-y", "@mcp/stripe-server"],
"env": {
"STRIPE_SECRET_KEY": "sk_test_51Mz..."
}
}
}
}Step 2.3: Restart & Verify Handshake
Fully quit Claude Desktop (Cmd+Q on macOS or right-click Exit in Windows system tray) and reopen the app. A hammer tool icon will appear in the lower-right corner of the chat input box. Clicking the icon reveals all registered tools.
3. Cursor IDE Setup (Global vs Workspace `.cursor/mcp.json`)
Cursor IDE provides native, deeply integrated Model Context Protocol support. You can configure MCP servers globally across all editor windows or configure project-specific servers checked into Git version control.
Option A: Workspace Root `.cursor/mcp.json`
Create a .cursor/mcp.json file at the root of your project directory. This enables team members to share tool configurations seamlessly.
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": ["-y", "@mcp/server-supabase"],
"env": {
"SUPABASE_URL": "https://xyz.supabase.co",
"SUPABASE_SERVICE_ROLE_KEY": "eyJ..."
}
}
}
}Option B: Cursor Settings UI
Navigate to Cursor Settings → Features → MCP Servers. Click “Add New MCP Server”, assign a server name, select transport type (stdio), and enter your launch command.
Name: filesystem
Type: stdio
Command: npx -y @modelcontextprotocol/server-filesystem /path/to/repo
4. VS Code (Cline / Roo Code) & Zed Editor
For developers working in VS Code or high-speed editors like Zed:
VS Code via Cline Extension
Install the Cline or Roo Code extension in VS Code. Open the MCP tab in the extension sidebar and click “Configure MCP Servers”. This opens cline_mcp_settings.json.
Zed Editor Settings
In Zed Editor, open settings (Cmd+,) and declare servers under context_servers:
{
"context_servers": {
"github": {
"command": {
"path": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN" }
}
}
}
}5. Testing & Diagnostic Inspection via MCP Inspector
When developing or debugging an MCP server, use the official MCP Inspector graphical debugging UI:
# Run the MCP Inspector against any local server executable npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
The inspector spins up a local web server at http://localhost:5173 allowing you to manually trigger tools, view JSON schemas, and inspect raw JSON-RPC 2.0 messages.
6. Error Resolution & Troubleshooting Guide
| Error Symptom | Probable Cause | Resolution Action |
|---|---|---|
| Stdio pipe closed | Server process crashed immediately on startup | Run the install launcher command in terminal to inspect stderr crash traces. |
| command not found: npx | GUI client PATH does not inherit shell PATH variables | Specify absolute path to binary (e.g. /usr/local/bin/npx or C:\Program Files\nodejs\npx.cmd). |
| JSON-RPC -32601 | Requested tool method does not exist in schema | Restart client to flush cached tool definitions. |
| 401 Unauthorized | Missing or invalid environment secret variable | Verify credentials in the env block of your client JSON config. |
Find Pre-Built MCP Server Configurations
Browse our curated directory of over 115+ tested MCP server configurations with one-click copy snippets: