RouterMCP
Reference

Architecture Overview - CLI and Cloud Components

System design and component overview for RouterMCP.

Architecture

RouterMCP consists of two main products that share core gateway logic.

Components

┌─────────────────────────────────────────────────────────────┐
│                      MCP Clients                            │
│         (Claude, VS Code, Cursor, Windsurf, etc.)          │
└─────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────┐
│                     RouterMCP Gateway                        │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │  • Tool aggregation and namespacing                     │ │
│  │  • Request routing to upstream servers                   │ │
│  │  • Authentication (API keys, OAuth)                      │ │
│  │  • Filtering (tools, resources, prompts)                 │ │
│  │  • Code Mode sandbox (optional)                          │ │
│  └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────┐
│                    Upstream MCP Servers                      │
│    GitHub    Linear    Notion    Filesystem    Custom...    │
└─────────────────────────────────────────────────────────────┘

RouterMCP CLI

The CLI runs locally on your machine:

  • Runtime: Node.js
  • Transport: Stdio (default) or HTTP
  • Configuration: routermcp.jsonc file
  • Process: Single process aggregating multiple upstream servers

RouterMCP Cloud

Cloud is a hosted service:

  • API: Cloudflare Workers (Hono)
  • Database: Neon Postgres (Drizzle ORM)
  • Dashboard: Next.js (Vercel)
  • Auth: WorkOS AuthKit

Data Flow

Tool Call Flow

  1. Client sends tools/call request to RouterMCP
  2. RouterMCP parses tool name to extract server alias
  3. Request is routed to the appropriate upstream server
  4. Response is returned to the client

Tool Listing Flow

  1. Client sends tools/list request
  2. RouterMCP queries all configured upstream servers
  3. Tools are aggregated with namespace prefixes
  4. Filtered list is returned based on allow/deny rules

Transport Protocols

ProtocolDirectionUse Case
StdioClient → GatewayLocal processes (Claude Desktop)
HTTP StreamableClient ↔ GatewayRemote connections
SSEClient ← GatewayStreaming responses
StdioGateway → UpstreamLocal MCP servers
HTTPGateway → UpstreamRemote MCP servers

Session Management

In HTTP mode, RouterMCP manages sessions:

  • Each client connection gets a unique session
  • Sessions maintain state for upstream connections
  • Sessions timeout after configurable inactivity
  • Multiple clients can connect simultaneously

On this page