Claude Desktop Integration¶
Connect your generated MCP server to Claude Desktop for powerful AI conversations about any codebase.
Prerequisites¶
- Claude Desktop installed
- A generated MCP server (see Quick Start)
- Node.js 18+ installed
Step 1: Generate Your MCP Server¶
First, generate an MCP server for your target repository:
Step 2: Find Your Config File¶
Claude Desktop's configuration file location varies by operating system:
Create if Missing
If the file doesn't exist, create it with an empty JSON object: {}
Step 3: Add Your MCP Server¶
Edit the config file to add your MCP server:
{
"mcpServers": {
"my-repo": {
"command": "node",
"args": ["/Users/yourname/mcp-servers/my-repo/server.mjs"]
}
}
}
Multiple Servers¶
You can add multiple MCP servers:
{
"mcpServers": {
"stripe-sdk": {
"command": "node",
"args": ["/Users/yourname/mcp-servers/stripe/server.mjs"]
},
"my-project": {
"command": "node",
"args": ["/Users/yourname/mcp-servers/my-project/server.mjs"]
},
"openai-docs": {
"command": "node",
"args": ["/Users/yourname/mcp-servers/openai/server.mjs"]
}
}
}
Step 4: Restart Claude Desktop¶
After editing the config:
- Quit Claude Desktop completely
- Relaunch Claude Desktop
- Look for the tools icon in the chat input
Step 5: Verify Connection¶
You should see your MCP tools available in Claude. Click the tools icon (🔧) to see:
get_readme- Get the repository READMElist_files- Browse files and directoriesread_file- Read file contentssearch_code- Search for code patterns- Plus any extracted tools from the repo
Using MCP Tools in Conversations¶
Once connected, Claude can use your tools automatically:
Example: Explore a Codebase¶
You: What does this repository do?
Claude: Uses
get_readmetool Based on the README, this is a...
Example: Find Code¶
You: Show me how authentication is implemented
Claude: Uses
search_codetool I found authentication in these files... Usesread_filetool Here's the implementation...
Example: Navigate Structure¶
You: What's in the src directory?
Claude: Uses
list_filestool The src directory contains...
Troubleshooting¶
Tools Not Appearing¶
- Check the config path - Make sure you edited the correct file
- Validate JSON - Use a JSON validator to check syntax
- Check absolute paths - Paths must be absolute, not relative
- Restart Claude - Fully quit and relaunch
Server Errors¶
Check the server works standalone:
Permission Issues¶
Ensure the server file is executable:
View Logs¶
Enable MCP logging in Claude Desktop:
- Open Claude Desktop
- Go to Settings → Developer
- Enable "Show MCP Logs"
Advanced Configuration¶
Environment Variables¶
Pass environment variables to your server:
{
"mcpServers": {
"my-repo": {
"command": "node",
"args": ["/path/to/server.mjs"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxx",
"DEBUG": "true"
}
}
}
}
Working Directory¶
Set the working directory:
{
"mcpServers": {
"my-repo": {
"command": "node",
"args": ["server.mjs"],
"cwd": "/path/to/my-repo"
}
}
}
Using Python Servers¶
For Python-generated servers:
Best Practices¶
- Use descriptive names - Name servers after their repositories
- Keep servers updated - Regenerate when the source repo updates
- Organize servers - Keep all servers in a dedicated directory
- Document your setup - Note which servers you've added
Next Steps¶
- Cursor Integration - Use MCP with Cursor IDE
- Custom Tools - Extend your generated tools
- API Reference - Programmatic server generation