How to install Claude Desktop, add MCP servers, and inspect / validate / repair MCP configuration files. This is the most common and most mechanical task — high success rate when done carefully.
MCP-capable clients each keep their own config. Find the right one first.
| Client | macOS | Windows |
|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json |
%APPDATA%\Claude\claude_desktop_config.json |
| Claude Code (per project) | <project>/.claude/mcp.json or .mcp.json |
same |
| LM Studio | ~/.lmstudio/mcp.json |
%USERPROFILE%\.lmstudio\mcp.json |
| Cursor | ~/.cursor/mcp.json |
%USERPROFILE%\.cursor\mcp.json |
If the file doesn't exist yet, create it with a minimal valid skeleton:
{ "mcpServers": {} }A stdio server entry has a launch command, args, and optional env:
{
"mcpServers": {
"example": {
"command": "npx",
"args": ["-y", "@scope/some-mcp-server"],
"env": { "SOME_API_KEY": "..." }
}
}
}Notes:
- On Windows,
npxsometimes must be invoked ascmd /c npx ...— if a server fails to launch on Windows but works on macOS, try wrapping the command. - Use absolute paths for local scripts;
~is not expanded inside JSON. - Secrets belong in
envhere (or the server's own config), never pasted into chat.
- Confirm prerequisites. Most MCP servers need Node (check
node -v; many need 18+). Some need Python or Docker. Install the runtime if missing. - Back up the config (
claude_desktop_config.json→claude_desktop_config.json.bak). - Add the server block under
mcpServers. Preserve existing entries. - Validate the JSON (parse it; check for trailing commas, unescaped backslashes in Windows paths, missing quotes).
- Fully restart the client. Claude Desktop must be quit and reopened — a window reload is not enough.
- Verify. Confirm the server appears and its tools are listed. If the client shows a "failed" server, read its MCP log.
When a user says MCP "isn't working," diagnose in this order:
- Read the config file and pretty-print it. Most breakages are here.
- Validate JSON. The frequent culprits:
- trailing comma after the last entry
- single backslashes in Windows paths (need
\\or forward slashes) - smart quotes from copy-paste instead of straight quotes
- a server block pasted at the wrong nesting level
- Check the launch command resolves — does
commandexist on PATH? Run it manually in a terminal to see the real error. - Check credentials — is the required
envkey present and valid? - Repair, back up first, restart the client, then re-verify.
Separate the three failure classes so you fix the right thing:
- Config typo → client shows the server as failed immediately on start; the JSON or command is wrong. Fix the file.
- Server down / crashes → server starts then exits; running the command manually reproduces the crash. Fix deps/runtime.
- Auth failure → server starts and lists tools, but calls fail with 401/403. Fix the API key/token.
If Claude Desktop itself isn't installed, point the user to the official download and confirm the app launches before touching MCP config. Don't side-load from unofficial mirrors.
- Only add MCP servers from sources the user trusts; an MCP server runs with the user's privileges.
- Back up before editing; redact secrets in summaries; restart the client to apply changes.