Skip to main content
Tool Router is an experimental feature that provides intelligent tool routing, automatic connection management, and MCP server integration.
Tool Router creates isolated sessions for users with automatic connection management, toolkit access control, and MCP server support.

Quick Start

Creating Sessions

create()

Create a new Tool Router session for a user:
string
required
External user ID from your database
ToolRouterCreateSessionConfig

Session Object

The session object provides access to tools, connections, and MCP:

Using Sessions

get tools()

Get tools wrapped for your provider:

authorize()

Initiate toolkit authorization:

toolkits()

List toolkit connection states:

Using Existing Sessions

use()

Retrieve an existing session:

MCP Server Integration

Each session provides an MCP server URL:

MCP Client Configuration

For Claude Desktop or Cursor:

Tool Access Control

Control which tools are available:

Workbench Mode

Enable workbench mode for testing:

Complete Example

Best Practices

  1. Session Reuse: Store session IDs and reuse them
  2. Connection Management: Enable manageConnections for user-driven auth
  3. Tool Restrictions: Disable dangerous tools in production
  4. Error Handling: Handle connection failures gracefully
  5. Session Cleanup: Delete sessions when no longer needed

Limitations

  • Sessions are experimental and API may change
  • MCP integration requires MCP-compatible clients
  • Some features may not work in all environments

Next Steps

MCP

Learn about MCP servers

Tools API

Learn about tools

Connected Accounts

Manage connections

Composio Class

Main SDK reference