Claude Desktop is currently the premier client for the Model Context Protocol. It offers a seamless native integration that makes adding servers as easy as editing a text file. This guide will walk you through everything you need to know to connect Claude to your local tools and data.
1. Why Claude Desktop?
While many AI interfaces are web-based, Claude Desktop runs natively on your machine. This is critical for MCP because it allows the AI to:
- Communicate with localhost ports: Access local servers and services running on your machine
- Read local files: Access your project files, documents, and data directly
- Execute local commands: Run scripts and tools installed on your system
- Maintain persistent connections: Keep server connections alive across conversations
These capabilities are blocked by browser security sandboxes in web-based interfaces, making the desktop app essential for MCP functionality.
What You Can Do with MCP + Claude
- Read and analyze your local project files
- Query your databases directly
- Search the web and fetch current information
- Interact with GitHub repositories
- Access your notes and documents
- Control smart home devices
- And much more...
2. How MCP Works with Claude
Understanding the architecture helps you make the most of MCP:
- Claude Desktop reads your config file on startup to discover available servers
- It spawns each server as a subprocess using the command you specify
- Servers communicate via stdio (standard input/output) using JSON-RPC
- When you ask a question, Claude decides which tools might help
- Claude calls the appropriate server and incorporates the results into its response
This architecture means servers run locally on your machine, keeping your data private and enabling fast responses.
3. Locating the Config File
Claude Desktop looks for a specific JSON file to know which servers to run. You can find this file manually, or open it via the Claude menu:
Method 1: Via Claude Menu (Recommended)
- Open Claude Desktop
- Click on Claude (macOS) or File (Windows) in the menu bar
- Select Settings...
- Click on Developer in the sidebar
- Click Edit Config
This will open the claude_desktop_config.json file in your default code editor.
Method 2: Manual Location
The config file is located at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
If the file doesn't exist, create it with this minimal content:
{
"mcpServers": {}
}4. Adding Your First Server
Let's add the FileSystem server, which allows Claude to read your project files. This is one of the most useful servers for developers.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Documents",
"/Users/username/Projects"
]
}
}
}Understanding the Configuration
"filesystem"- A unique name you choose for this server"command"- The executable to run (npx, node, python, etc.)"args"- Arguments passed to the command- The paths at the end specify which directories Claude can access
Important: Replace Paths
Replace /Users/username/... with the actual paths you want Claude to access. Use absolute paths—don't use ~ as it won't be expanded.
5. Using the Integration
Once you've saved the config file:
- Restart Claude Desktop completely. Quit the app (Cmd+Q on Mac, or right-click the taskbar icon on Windows) and open it again.
- Look for the tools indicator. You should see a hammer icon or similar indicator showing tools are available.
- Try a test query: Ask Claude something like "Can you list the files in my Documents folder?"
If connected correctly, Claude will briefly show a "Using tool..." indicator and then respond with the information.
Example Interactions
Here are some things you can ask Claude once the filesystem server is connected:
- "What files are in my Projects folder?"
- "Read the README.md file in my current project"
- "Summarize the contents of my notes folder"
- "Find all TypeScript files in my project"
6. Managing Multiple Servers
You can add as many servers as you want to the mcpServers object. Claude will automatically decide which tool to use based on your question.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your_api_key_here"
}
}
}
}Pro Tip: Tool Chaining
Claude can combine tools in a single response. For example, it might read a file from your filesystem, search the web for related documentation, and then create a GitHub issue—all in one turn.
7. Advanced Configuration
Environment Variables
Many servers require API keys or other configuration. Use the env property:
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-your-token",
"SLACK_TEAM_ID": "T01234567"
}
}
}
}Disabling Servers Temporarily
To disable a server without removing its configuration, you can rename it or comment it out (JSON doesn't support comments, so you'd need to remove it temporarily).
Server-Specific Arguments
Each server has its own arguments. Check the server's documentation for available options. Common patterns include:
- Paths to grant access to
- Database connection strings
- API endpoints
- Feature flags
8. Troubleshooting Connections
If the tools indicator doesn't appear or servers aren't working:
Check JSON Syntax
- No trailing commas after the last item in objects or arrays
- All strings must be in double quotes
- Use a JSON validator to check your file
Verify Prerequisites
- Ensure
nodeandnpxare installed and in your system PATH - Run
which npxin terminal to verify - Try running the npx command manually to see if it works
Check the Logs
Claude Desktop logs MCP activity. Check the logs for errors:
# macOS
tail -f ~/Library/Logs/Claude/mcp*.log
# Windows
type %APPDATA%\Claude\Logs\mcp*.logCommon Issues
- Server not found: Check that the package name is correct
- Permission denied: Ensure paths exist and are accessible
- Environment variable not set: Verify API keys are correct
- Port already in use: Another process may be using the same port
For more detailed troubleshooting, see our Debugging MCP Servers guide.
Outdated Content Warning
This guide was last updated on January 14, 2025 (12 months ago).
The information presented here may be significantly outdated. Technologies, APIs, and best practices may have changed since this content was written.
We strive to keep our content current, but with rapidly evolving technologies, some details may no longer be accurate.
Last updated
January 14, 2025
372 days ago
This content may be outdated
This content may contain outdated information. Please verify details before use.