RouterMCP
SDKs

SDKs

Official SDKs for integrating RouterMCP into your AI applications.

RouterMCP SDKs

Build AI applications with RouterMCP using our official SDKs. Connect to aggregated MCP tools, manage OAuth for multiple users, and integrate with popular AI frameworks.

Features

FeatureTypeScriptPython
Async ClientYesYes
Sync ClientNoYes
OAuth AdaptersMemory, File, CloudMemory, File, Cloud
Multi-User SessionsYesYes
Typed ResultsZodPydantic
Vercel AI SDKYes-
LangChainYesYes
Google ADKYesYes
MastraYes-

Quick Start

import { RouterMCPClient } from '@routermcp/sdk';

const client = new RouterMCPClient({
  url: 'https://gateway.routermcp.com/v1/mcp/my-project',
  apiKey: 'rmc_...',
});

await client.connect();
const tools = await client.listTools();
const result = await client.callTool('github_create_issue', { title: 'Bug report' });
await client.disconnect();
from routermcp import RouterMCPClient

async with RouterMCPClient(
    url='https://gateway.routermcp.com/v1/mcp/my-project',
    api_key='rmc_...',
) as client:
    tools = await client.list_tools()
    result = await client.call_tool('github_create_issue', {'title': 'Bug report'})

Installation

npm install @routermcp/sdk
# or
bun add @routermcp/sdk
# or
yarn add @routermcp/sdk
pip install routermcp
# or with framework integrations
pip install routermcp[langchain]
pip install routermcp[google-adk]
pip install routermcp[all]

Choose Your SDK

Configuration

Both SDKs support configuration from multiple sources with the following priority:

  1. Constructor arguments (highest priority)
  2. Environment variables
  3. Config file (routermcp.json)

Environment Variables

VariableDescription
ROUTERMCP_URLRouterMCP server URL
ROUTERMCP_API_KEYAPI key for authentication
ROUTERMCP_USER_IDDefault user ID for multi-user scenarios
ROUTERMCP_TIMEOUTRequest timeout in milliseconds (default: 30000)
ROUTERMCP_DEBUGEnable debug logging (true/false)

Config File

Create routermcp.json in your project root or ~/.routermcp/config.json:

{
  "url": "https://gateway.routermcp.com/v1/mcp/my-project",
  "apiKey": "rmc_...",
  "timeout": 60000
}

On this page