Overview
Once you’ve generated an API key, you can configure MCP-compatible clients to connect to PromptRepo. This page covers setup for:- Claude Desktop (Anthropic’s native app)
- Claude Code (VS Code extension and web editor)
- Generic MCP clients (cURL, Postman, custom scripts)
All configurations require your deployed PromptRepo URL (e.g.,
https://your-app.vercel.app) and a valid API key.Claude Desktop Configuration
Claude Desktop reads MCP server configurations from a JSON file in your home directory.Locate Config File
The config file location depends on your operating system:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add PromptRepo Server
Edit the file to include your PromptRepo MCP server:Replace:
claude_desktop_config.json
your-app.vercel.app→ Your actual deployment URLpr_live_abc123...→ Your API key from/profile
Claude Code Configuration
Claude Code (the VS Code extension and web editor) uses the same configuration format.VS Code Extension
Open Settings
Press
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux) and search for “Claude Code: Edit MCP Settings”.Web Editor (claude.ai/code)
Add Server
Click “Add Server” and fill in:
- Name:
promptrepo - URL:
https://your-app.vercel.app/api/mcp - Headers:
Multiple Servers (Advanced)
You can connect multiple PromptRepo instances (e.g., production and staging) or other MCP servers:claude_desktop_config.json
Environment Variable Substitution
Some MCP clients support environment variable expansion in config files:claude_desktop_config.json
Testing with cURL
You can test your MCP server without an AI client using cURL:Expected Response Format
Troubleshooting
Error: Invalid API key
Error: Invalid API key
Cause: The API key is incorrect, revoked, or improperly formatted.Solution:
- Verify the key in
/profile(check last 8 characters) - Ensure no extra spaces or line breaks in the config file
- Generate a new key and update the config
Error: Method not found
Error: Method not found
Cause: The
method field in the JSON-RPC request doesn’t match a supported tool.Solution:- Use
"method": "tools/call"for all tool invocations - Pass the actual tool name in
params.name(e.g.,"list_prompts") - Supported tools:
list_prompts,get_prompt,resolve_prompt,search_prompts
Claude doesn't call MCP tools
Claude doesn't call MCP tools
Cause: The MCP server isn’t registered or Claude doesn’t recognize the request.Solution:
- Restart Claude Desktop/VS Code after editing config
- Use explicit phrasing: “Search my PromptRepo for…”
- Check Claude’s developer console for connection errors
CORS errors in browser-based clients
CORS errors in browser-based clients
Cause: PromptRepo’s MCP endpoint has CORS enabled, but your deployment might have middleware blocking it.Solution:
- Verify
Access-Control-Allow-Origin: *in response headers - Check that
/api/mcpis excluded from auth middleware (seesrc/middleware.ts)
Connection timeout
Connection timeout
Cause: Your deployment URL is incorrect or the server is down.Solution:
- Test the endpoint with cURL (see examples above)
- Verify the URL has no typos or trailing slashes
- Check deployment status in Vercel/Railway dashboard
Production Environment Variables
The MCP endpoint requires theSUPABASE_SERVICE_ROLE_KEY environment variable to bypass RLS and authenticate users via API keys.
Get Service Role Key
In your Supabase dashboard:
- Go to Settings → API
- Copy the
service_rolekey (not theanonkey)
Add to Deployment
In Vercel/Railway/Render:
- Navigate to your project settings
- Add environment variable:
- Name:
SUPABASE_SERVICE_ROLE_KEY - Value:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...(your service role key)
- Name:
INTERNAL_ERROR for all authenticated requests.
Implementation Reference
The MCP route handler is implemented insrc/app/api/mcp/route.ts:
src/app/api/mcp/route.ts
src/app/api/mcp/route.ts:71-138.
Next Steps
Overview
Learn about MCP protocol and available tools
API Reference
Detailed JSON-RPC schemas and error codes