Skip to content

Instantly share code, notes, and snippets.

@danielrosehill
Created December 2, 2025 12:53
Show Gist options
  • Select an option

  • Save danielrosehill/d6d4890f6194167e91bede76050c1c56 to your computer and use it in GitHub Desktop.

Select an option

Save danielrosehill/d6d4890f6194167e91bede76050c1c56 to your computer and use it in GitHub Desktop.
Adding MCP Router to Claude Code CLI

Adding MCP Router to Claude Code CLI

MCP Router allows you to manage MCP servers across multiple AI applications from a single interface.

Installation Command

claude mcp add mcp-router --scope user -e "MCPR_TOKEN=your_token_here" -- npx -y @mcp_router/cli@latest connect

Parameters Explained

Parameter Value Description
mcp-router Server name The name to identify this MCP server in Claude Code
--scope user Scope Adds to user-level config (~/.claude.json) so it's available across all projects
-e "MCPR_TOKEN=..." Environment variable Your MCP Router authentication token
-- Separator Separates Claude CLI options from the command to run
npx -y @mcp_router/cli@latest connect Command The actual command to start the MCP Router CLI

Resulting Configuration

This adds the following to your ~/.claude.json:

{
  "mcpServers": {
    "mcp-router": {
      "command": "npx",
      "args": [
        "-y",
        "@mcp_router/cli@latest",
        "connect"
      ],
      "env": {
        "MCPR_TOKEN": "your_token_here"
      }
    }
  }
}

Getting Your Token

  1. Install and run MCP Router from https://github.com/mcp-router/mcp-router
  2. Generate a token from the MCP Router UI
  3. Replace your_token_here with your actual token

Scope Options

  • --scope local (default): Project-level config (.mcp.json in current directory)
  • --scope user: User-level config (~/.claude.json)
  • --scope project: Project config in .claude/settings.json

This gist was generated by Claude Code. Please verify the information and consult the official MCP Router documentation for the most up-to-date instructions.

Comments are disabled for this gist.