claude_desktop_config.json

The claude_desktop_config.json file is where Claude Desktop reads its MCP server configuration. This guide covers file location, JSON structure, all supported fields, and common mistakes.

File location

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Basic structure

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/you/projects"
      ]
    },
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxx"
      }
    }
  }
}

Common mistakes

  • args as a string — use ["--flag"] not "--flag"
  • env value as a number — use "3000" not 3000
  • Trailing comma — JSON does not allow trailing commas
  • Wrong file path — double-check the path for your OS above

Build yours with the visual tool

Skip the manual editing — use the builder to generate a valid config in seconds.

Open Config Builder →