Claude Desktop supports the Model Context Protocol (MCP), allowing it to query and resolve your PromptRepo prompts directly during conversations—no copy-paste required.
Prerequisites
- Claude Desktop installed (download here)
- A PromptRepo deployment (local or production)
- An API key from your PromptRepo
/profile page
Step 1: Generate an API Key
- Navigate to your PromptRepo instance
- Go to Profile (
/profile)
- Click Create API Key
- Copy the generated key (it will only be shown once)
Store your API key securely. Anyone with this key can access your prompts.
Step 2: Locate the Configuration File
Claude Desktop stores its configuration in claude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json
If the file doesn’t exist, create it with an empty JSON object:
Step 3: Add PromptRepo Server
Edit claude_desktop_config.json and add the MCP server configuration:
{
"mcpServers": {
"my-prompts": {
"url": "https://your-app-url/api/mcp",
"headers": {
"x-api-key": "YOUR_API_KEY_HERE"
}
}
}
}
Replace:
your-app-url with your PromptRepo deployment URL (e.g., promptrepo.vercel.app)
YOUR_API_KEY_HERE with the key you generated in Step 1
For local development, use http://localhost:3000/api/mcp as the URL.
Alternative: Bearer Token Authentication
You can also use the Authorization header:
{
"mcpServers": {
"my-prompts": {
"url": "https://your-app-url/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY_HERE"
}
}
}
}
Step 4: Restart Claude Desktop
- Quit Claude Desktop completely
- Relaunch the application
- The MCP server will be loaded automatically
Step 5: Verify Connection
In a new Claude Desktop conversation, try using the MCP tools:
Claude will automatically invoke the list_prompts tool and display your PromptRepo library.
Once connected, Claude Desktop can use these tools:
| Tool | Description |
|---|
list_prompts | Returns your prompts (or public prompts if no API key) |
get_prompt | Fetches a specific prompt by ID |
resolve_prompt | Substitutes {{variable}} placeholders with provided values |
search_prompts | Full-text search across your prompt library |
Example Usage
List All Prompts
Search for Prompts
Search my prompts for "code review"
Resolve a Prompt with Variables
Resolve the prompt "api-documentation" with language="Python" and endpoint="/users"
Troubleshooting
Cause: Configuration file syntax error or incorrect location.
Fix:
- Validate your JSON using a tool like JSONLint
- Ensure the file is in the correct location for your OS
- Restart Claude Desktop after making changes
”Invalid API key” error
Cause: The API key is incorrect, revoked, or expired.
Fix:
- Generate a new API key from
/profile
- Update
claude_desktop_config.json with the new key
- Restart Claude Desktop
Connection timeout or network errors
Cause: The MCP endpoint is unreachable.
Fix:
- Verify your PromptRepo URL is correct and accessible
- If using local development, ensure the dev server is running (
npm run dev)
- Check firewall settings if connecting to a self-hosted instance
Empty prompt list
Cause: No prompts exist for your user, or you’re connecting anonymously.
Fix:
- Verify the API key is correctly configured
- Create at least one prompt in PromptRepo
- Check that the prompt isn’t archived
Security Best Practices
- Never commit
claude_desktop_config.json to version control
- Rotate API keys regularly from the
/profile page
- Revoke keys immediately if compromised
- Use environment-specific keys (separate keys for dev/prod)
Next Steps