og.cc.cd / guides / how-to-set-up-mcp-servers

How to Set Up MCP Servers in Claude Desktop, Cursor and VS Code

By og.cc.cd · Published · Updated · 4 min read

TL;DR: Claude Desktop, Cursor and VS Code each read a JSON file, but with different file names, locations and top-level keys (mcpServers vs servers); copy the right shape for your app and restart it.

Updated · All sources ↓

The three most popular MCP hosts all read a JSON file, but the file names, locations and top-level keys differ. Here is exactly what each one expects, checked against the official docs, plus the fixes for the problems people hit most.

Generate your MCP config →All guides

At a glance

AppFileTop-level keyRemote URL servers
Claude Desktopclaude_desktop_config.jsonmcpServersVia Settings → Connectors
Cursor.cursor/mcp.json · ~/.cursor/mcp.jsonmcpServersYes: url + headers
VS Code.vscode/mcp.json · user-profile mcp.jsonserversYes: "type": "http"
VS Code / Copilot (portable).mcp.json · ~/.copilot/mcp-config.jsonmcpServersYes

Before you start

  • Install the runtime the server needs. Many servers run with npx and need Node.js (the Playwright server needs Node.js 18 or newer); Python servers often use uvx; some ship as Docker images.
  • Run the command once in a terminal. If npx -y @modelcontextprotocol/server-filesystem ~/Desktop fails there, it will fail inside the app too.
  • Use absolute paths in arguments. The Claude Desktop troubleshooting list specifically says paths must be valid, absolute and not relative.

Claude Desktop

  1. Open the Claude menu in your system menu bar → Settings… → Developer → Edit Config. This creates the file if it does not exist.
  2. The file lives at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows.
  3. Add your servers under mcpServers with command, args and optional env.
  4. Quit Claude Desktop completely and start it again. The server’s tools then appear under “Add files, connectors, and more” → Connectors.
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/Projects"]
    },
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    }
  }
}

Remote servers: the config file is for local servers. To connect a server by URL, open Settings → Connectors → Add → Add custom connector, paste the URL and complete the sign-in the server asks for (remote servers guide).

Cursor

Cursor reads mcp.json from two places: .cursor/mcp.json inside a project for project-specific tools, and ~/.cursor/mcp.json in your home folder for tools available everywhere (Cursor MCP docs). Local servers use command/args/env; remote servers use url and optional headers.

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    },
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": { "Authorization": "Bearer ${env:GITHUB_TOKEN}" }
    }
  }
}

Cursor resolves variables in command, args, env, url and headers: ${env:NAME} for environment variables, ${userHome}, ${workspaceFolder} and a few more. That is the clean way to keep tokens out of a project file you commit. Stdio servers can also load an envFile.

VS Code

The quickest route is the Command Palette → MCP: Add Server, then choose Command (stdio) or HTTP and give the server an ID (Add MCP servers in VS Code). If you prefer editing JSON, VS Code’s own format lives in .vscode/mcp.json (workspace) or the user-profile mcp.json (open it with MCP: Open User Configuration). It differs from the others in two ways: the top-level key is servers, and each entry states its type.

{
  "servers": {
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    },
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Newer VS Code docs also describe a portable format read directly by Copilot harness sessions: a workspace-root .mcp.json, or ~/.copilot/mcp-config.json for your user, both with a top-level mcpServers object. The guided flow now labels .vscode/mcp.json and the profile file as deprecated destinations kept for compatibility, though they remain the only places that support VS Code input variables, envFile and per-server sandboxing (MCP configuration reference).

For secrets in the VS Code format, reference ${input:variable-id} and declare it in the inputs array: VS Code prompts for the value when the server first starts and stores it securely.

Popular servers and their launch commands

ServerLaunchNeeds
Filesystemnpx -y @modelcontextprotocol/server-filesystem <dir>…Node.js
Fetchuvx mcp-server-fetchuv (Python)
Playwrightnpx @playwright/mcp@latestNode.js 18+
GitHubRemote https://api.githubcopilot.com/mcp/, or Docker image ghcr.io/github/github-mcp-serverSign-in or a personal access token

Sharing a setup with your team

Project-level files — .cursor/mcp.json, .vscode/mcp.json or a workspace-root .mcp.json — can be committed so everyone who opens the repository gets the same servers. Global files (~/.cursor/mcp.json, the VS Code user profile, Claude Desktop’s config) stay personal. Before you commit:

  • Replace every token with a reference: ${env:NAME} in Cursor, ${input:id} in VS Code’s format. VS Code’s docs say plainly that a personal configuration file is not a secret store.
  • Use ${workspaceFolder} instead of an absolute path to your own checkout, so the file works on every machine.
  • Pin versions where the publisher offers them, and note required runtimes (Node.js, uv, Docker) in your README or AGENTS.md.

Troubleshooting

  • Server does not appear. Check the JSON syntax, the top-level key (servers vs mcpServers), and restart the app completely.
  • Read the logs. Claude Desktop writes MCP logs to ~/Library/Logs/Claude (macOS) or %APPDATA%\Claude\logs (Windows): mcp.log for connections and mcp-server-NAME.log for each server’s stderr. In VS Code, open the server output from the MCP server list.
  • Windows ENOENT with ${APPDATA} in a path. The official fix is to add the expanded APPDATA value to the server’s env, and make sure npm is installed globally.
  • Docker servers exit immediately. VS Code’s reference notes that stdio servers in Docker must not use the detach flag (-d); keep -i so the container talks over stdin.
  • Tools are listed but never used. Ask for them explicitly at first (“use the Playwright MCP server to open …”) and expand the tool call to confirm it came from the server you added.

Do not want to hand-write JSON? The MCP config generator builds the file for any of these apps from presets, warns about placeholders, and tells you where to save it.

Sources

Vendor features and prices were checked against these official pages on 2026-10-20. Products change; if something here no longer matches, the official page is right.

Related guides