Understanding the Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open standard initiated by Anthropic that lets LLM assistants like Claude Desktop and Cursor securely connect to external data sources, local filesystems, and APIs.
Where is the config file?
Claude Desktop reads MCP servers from a JSON file called claude_desktop_config.json. Here's where to find it:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json— press Win + R, paste the path, press Enter. - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json— in Finder press Cmd + Shift + G, paste the path.
How Claude Desktop Configurations Work
The config file tells the client what command to run, what arguments to supply, and what environment variables to inject for each MCP server.
Anatomy of a Server Block
{
"mcpServers": {
"my-server-name": {
"command": "node",
"args": ["/absolute/path/to/server.js"],
"env": {
"API_KEY": "your-key-here"
}
}
}
} Common Configuration Pitfalls
- Trailing Commas: Standard JSON forbids trailing commas (e.g.
"args": ["a", "b",]). This tool auto-strips them. - Unquoted Keys: JSON keys must always be in double quotes.
- Invalid Nesting: Server commands must live under the
"mcpServers"key. The merger fixes this automatically. - Duplicate Server Names: The merger flags conflicts so you can overwrite, rename, or skip them.