How to Connect an MCP Server to Claude Desktop
To connect a local MCP server to Claude Desktop, you add an entry to the mcpServers object in the app's JSON configuration file and restart the app. Claude Desktop then launches your server as a child process and talks to it over stdio.
Find the configuration file
Claude Desktop has a settings screen with a Developer section and an option to edit the config. That opens the file for you. By default it is named claude_desktop_config.json and lives in the application support folder for the app:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\Claude\\claude_desktop_config.json
If the file does not exist yet, create it. The location can change between app versions, so prefer using the in-app button to open it.
The mcpServers format
The file contains one top-level key, mcpServers. Each entry is named by you and gives the command to start the server, its arguments and optional environment variables.
{
"mcpServers": {
"slug-server": {
"command": "node",
"args": ["/Users/me/projects/slug-server/build/index.js"]
},
"temperature": {
"command": "/Users/me/projects/temp-server/.venv/bin/python",
"args": ["/Users/me/projects/temp-server/server.py"],
"env": { "UNITS": "metric" }
}
}
}
Rules that prevent most problems
- Use absolute paths. The app does not start your server from your project folder, so relative paths break.
- Use the right interpreter. For Python, point
commandat the virtual environment's Python, or useuvwith the--directoryoption. A barepythonmay not be the one withmcpinstalled. - Keep it valid JSON. No trailing commas, no comments.
- On Windows, double the backslashes in paths, as in
"C:\\Users\\me\\server\\build\\index.js". - The PATH is limited. A desktop app may not inherit your shell's PATH, so tools installed via version managers might not be found by name. Use full paths to
node,npxoruvwhen in doubt.
Using npx and uvx for published servers
Many published servers are run through a package runner so you do not clone anything. The entry is the same shape. The package name below is a placeholder pattern; use the real name from the server's documentation.
{
"mcpServers": {
"some-server": {
"command": "npx",
"args": ["-y", "@scope/some-mcp-server"]
}
}
}
The -y flag tells npx to proceed without asking for confirmation, which matters because there is no terminal for the prompt. Before using any third-party package, check who publishes it, since it will run with your permissions.
Restart and verify
- Save the file.
- Fully quit Claude Desktop and start it again. Closing the window is not always enough.
- Open a new chat and look for the tools indicator near the input box. It lists the connected servers and their tools.
- Ask something that needs the tool, for example "Make a slug for: Hello MCP World". Claude should ask for permission to run the tool, and then show the result.
If the server does not appear
- Validate the JSON in an editor or with
python -m json.tool. - Run the exact command and arguments from a terminal. If it errors there, it will error in the app.
- Look at the app's MCP log files. On macOS they are under
~/Library/Logs/Claude, with files named after each server. The log shows stderr output and startup errors. - Test the server with the Inspector first to rule out server bugs.
- Check that the server does not write anything except protocol messages to stdout.
Security reminder
A configured server runs on your machine with your permissions. Only add servers you trust, review what a tool does before approving a call, and avoid putting real secrets in a file you might share or commit. A later post covers handling secrets in server configuration.
Desktop Claude is only one client. The next post shows the equivalent setup in Claude Code, which uses a command-line workflow instead of editing JSON by hand.
Comments
No comments yet. Have a question or a tip? Be the first to share it.