Claude Desktop is the primary desktop application for interacting with Claude. It has built-in MCP support and can connect to any number of MCP servers simultaneously. This chapter covers how to configure Claude Desktop to use your server.
Claude Desktop reads MCP server configuration from a JSON file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonIf this file does not exist, create it. Claude Desktop reads it at startup and each time you restart the application.
For a server that runs as a local process (stdio transport), add it under the mcpServers key:
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["/absolute/path/to/your/server.py"]
}
}
}
"my-server" is the display name in the Claude Desktop UI"command" is the executable to run"args" is the list of argumentsAlways use absolute paths. Claude Desktop does not inherit your shell’s PATH or working directory, so relative paths will fail silently.
If your server has dependencies installed in a virtual environment:
{
"mcpServers": {
"my-server": {
"command": "/absolute/path/to/venv/bin/python",
"args": ["/absolute/path/to/server.py"]
}
}
}
Point "command" directly to the Python interpreter inside the venv.
uv is a fast Python package manager that handles virtual environments automatically. The mcp install command uses uv under the hood:
{
"mcpServers": {
"my-server": {
"command": "uv",
"args": [
"--directory", "/absolute/path/to/server-project",
"run", "server.py"
]
}
}
}
uv creates an isolated environment, installs dependencies from pyproject.toml, and runs the server — all automatically.
mcp installThe MCP CLI can generate the config entry for you:
mcp install /path/to/server.py --name "My Server"
This adds the correct entry to claude_desktop_config.json automatically. If your server uses FastMCP(dependencies=[...]), the required packages are also installed.
Pass environment variables to your server (for API keys, config, etc.):
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["/path/to/server.py"],
"env": {
"DATABASE_URL": "postgresql://localhost/mydb",
"API_KEY": "sk-..."
}
}
}
}
Never hardcode secrets in the config file if it is shared or version-controlled. Use a secrets manager or environment variable injection at the OS level.
For a server running over HTTP/SSE:
{
"mcpServers": {
"remote-server": {
"url": "https://my-mcp-server.example.com/sse"
}
}
}
No command or args are needed — Claude Desktop connects to the running HTTP server directly.
You can connect to multiple servers at once:
{
"mcpServers": {
"database-tools": {
"command": "python",
"args": ["/path/to/db_server.py"]
},
"file-tools": {
"command": "python",
"args": ["/path/to/file_server.py"]
},
"web-search": {
"url": "https://search-mcp.example.com/sse"
}
}
}
Claude Desktop starts all configured servers when it launches and makes all their tools available to Claude simultaneously. Tool names must be unique across all connected servers.
After editing the config:
If a server fails to start, Claude Desktop shows an error notification. Check:
Server not appearing in tools list:
Tools appear but calls fail:
mcp dev server.py to test the server interactively“spawn ENOENT” or similar process errors:
command path is wrong or not executableServer starts but immediately exits:
claude_desktop_config.json to add MCP serverscommand and argsurlenv (not hardcoded in the file)mcp install for automatic config generation| ← Chapter 6: Transports | Table of Contents | Chapter 8: Connecting to Claude Code → |