This guide walks you through connecting Claude Desktop to your MCP servers through Latch.
Prerequisites
Latch server running (via Docker or locally)
Claude Desktop installed
An MCP server you want to protect (or use the example below)
Step 1: Get Your API Key
Open the Latch dashboard (http://localhost:3000 or your hosted URL)
Create a workspace if you haven’t already
Go to Settings → API Keys
Click Create API Key and copy it
Step 2: Create an Upstream
An upstream represents the MCP server you want to protect.
Go to Upstreams in your workspace
Click Create Upstream
Choose your transport type:
Stdio : For MCP servers that run as local processes (most common)
HTTP : For MCP servers that run as web services
Give it a name (e.g., filesystem, grep-server, my-mcp-server)
The upstream name is used in your Claude Desktop config. Choose something descriptive but short.
Claude Desktop reads its MCP server configuration from:
Using the Latch CLI Wrapper
The Latch CLI wraps your MCP server command, routing all tool calls through Latch.
Breaking down the args:
Important: Arguments in --upstream-args must be comma-separated, not space-separated. This is because shell argument parsing can’t handle spaces inside a single argument value.
Example: Filesystem Server
Example: Grep Server
After configuring Claude Desktop, sync the tools to Latch:
This registers all available tools from the upstream with Latch so you can create rules targeting specific tools.
Step 5: Restart Claude Desktop
After editing the config file:
Fully quit Claude Desktop (Cmd+Q, not just close the window)
Reopen Claude Desktop
You should see your server in Claude’s MCP server list
Step 6: Create Your First Rule
Go to Rules in the Latch dashboard
Click Create Rule
Create a simple test rule:
Name: “Approve all external writes”
Effect: Require Approval
Action Class: External Write
Upstream: (your upstream name)
Save the rule
Step 7: Test It
Ask Claude to do something that triggers your rule. For example, with a filesystem server:
“Create a file called test.txt with some content”
You should see:
The request appears in the Latch dashboard
If it requires approval, you’ll see a notification (or approve in dashboard)
After approval, Claude completes the action
Troubleshooting
Server Not Appearing in Claude
Check the config file path:
Verify JSON is valid:
Common mistakes:
Missing comma between servers
Wrong path to config file
Server name contains invalid characters
”Connection refused” Errors
Make sure Latch is running and accessible:
If using Docker:
Node.js Version Issues
Claude Desktop bundles its own Node.js, but uses your system’s npx. If you see errors like:
TypeError: args.at is not a function
SyntaxError: node:fs/promises issues
Solution: Ensure your default Node.js is v18.4.0 or higher:
If using nvm:
If you have old Node versions in ~/.nvm/versions/node/, Claude Desktop might find them. Remove versions older than v18.4.0 to prevent conflicts.
CLI Connection Issues
Test the CLI connection manually:
After adding an upstream, sync its tools:
Go to Upstreams in the dashboard to verify tools were discovered (Tools count + synced timestamp).
Security Best Practices
Use specific API keys for each client/use case
Start with “Require Approval” rules and relax as you trust the setup
Enable Telegram notifications for real-time alerts
Review the audit log regularly to understand agent behavior
Use LLM-evaluated policies for nuanced conditions like “block searches for credentials”
Next Steps