impl

claude_desktop_config.impl.get_default_claude_desktop_config_path() Path[source]

See https://modelcontextprotocol.io/quickstart/user

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%Claudeclaude_desktop_config.json

class claude_desktop_config.impl.ClaudeDesktopConfig(path: pathlib.Path = PosixPath('/home/docs/.config/Claude/claude_desktop_config.json'))[source]
read() dict[str, Any][source]

Read the configuration from the file.

write(config: dict[str, Any])[source]

Write the configuration to the file.

put_mcp_server(name: str, settings: dict[str, Any])[source]

Sample config:

{
    "mcpServers": {
        "your_mcp_server_name": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-remote",
                "https://your-mcp-server.com/sse"
            ]
        }
    }
}
del_mcp_server(name: str)[source]

Remove an MCP server from the configuration. This is an idempotent operation - no error if the server doesn’t exist.