RouterMCP
Client Integrations

Claude Code Integration - CLI and VS Code

Connect Claude Code (CLI/VS Code) to RouterMCP using HTTP transport.

Claude Code

Claude Code supports MCP servers via HTTP Streamable transport. This works with both the CLI version and the VS Code extension.

Prerequisites

  • Claude Code installed
  • A RouterMCP project (Cloud) or CLI running in HTTP mode

Server URL Format

{base_url}/v1/mcp/{project_slug}/request

Examples:

  • Local: http://localhost:8787/v1/mcp/my-project/request
  • Production: https://gateway.routermcp.com/v1/mcp/my-project/request

The URL must include /v1/ (not just /1/) and end with /request.

Setup Methods

Without Authentication

claude mcp add routermcp \
  --type streamable-http \
  --url https://gateway.routermcp.com/v1/mcp/my-project/request

With API Key

claude mcp add routermcp \
  --type streamable-http \
  --url https://gateway.routermcp.com/v1/mcp/my-project/request \
  --header "Authorization: Bearer rmc_your_api_key"

Remove Server

claude mcp remove routermcp

Add to your Claude config file:

Without Authentication

{
  "mcpServers": {
    "routermcp": {
      "type": "streamable-http",
      "url": "https://gateway.routermcp.com/v1/mcp/my-project/request"
    }
  }
}

With API Key

{
  "mcpServers": {
    "routermcp": {
      "type": "streamable-http",
      "url": "https://gateway.routermcp.com/v1/mcp/my-project/request",
      "headers": {
        "Authorization": "Bearer rmc_your_api_key"
      }
    }
  }
}

Verify Connection

Test the connection with cURL:

curl -i -X POST 'https://gateway.routermcp.com/v1/mcp/my-project/request' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer rmc_your_api_key' \
  -H 'mcp-protocol-version: 2025-03-26' \
  -d '{
    "jsonrpc": "2.0",
    "id": "0",
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {"name": "curl", "version": "0"}
    }
  }'

Troubleshooting

IssueCauseSolution
404 Not FoundWrong URL pathUse /v1/mcp/ prefix and /request suffix
401 UnauthorizedMissing or invalid API keyAdd Authorization: Bearer {key} header
Connection refusedWrong hostUse the Worker API URL, not the Dashboard URL

Claude Code calls initialize first, then tools/list. If the initialize succeeds but tools/list fails, check your project has servers configured.

On this page