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
| Feature | TypeScript | Python |
|---|---|---|
| Async Client | Yes | Yes |
| Sync Client | No | Yes |
| OAuth Adapters | Memory, File, Cloud | Memory, File, Cloud |
| Multi-User Sessions | Yes | Yes |
| Typed Results | Zod | Pydantic |
| Vercel AI SDK | Yes | - |
| LangChain | Yes | Yes |
| Google ADK | Yes | Yes |
| Mastra | Yes | - |
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/sdkpip install routermcp
# or with framework integrations
pip install routermcp[langchain]
pip install routermcp[google-adk]
pip install routermcp[all]Choose Your SDK
TypeScript SDK
For Node.js, Bun, and Edge runtimes. Includes adapters for Vercel AI SDK, LangChain, Google ADK, and Mastra.
Python SDK
Async and sync clients for Python 3.10+. Includes adapters for LangChain and Google ADK.
Configuration
Both SDKs support configuration from multiple sources with the following priority:
- Constructor arguments (highest priority)
- Environment variables
- Config file (
routermcp.json)
Environment Variables
| Variable | Description |
|---|---|
ROUTERMCP_URL | RouterMCP server URL |
ROUTERMCP_API_KEY | API key for authentication |
ROUTERMCP_USER_ID | Default user ID for multi-user scenarios |
ROUTERMCP_TIMEOUT | Request timeout in milliseconds (default: 30000) |
ROUTERMCP_DEBUG | Enable 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
}