Using with MCP clients
Every Tool Router session provides a unique MCP server URL. This URL exposes the exact session you created - with the specific user, toolkits, and auth configs you configured. Any MCP client that supports HTTP transport can connect using just the URL and your API key.
Examples for popular frameworks
Jump to examples for:
- Claude Agent SDK - Python, TypeScript
- OpenAI Agents SDK - Python, TypeScript
- Vercel AI SDK - TypeScript
Claude Agent SDK
Installation
Usage
Create a Tool Router session and execute tasks with Claude:
- Set your
COMPOSIO_API_KEYenvironment variable with your API key from Settings. - Set your
ANTHROPIC_API_KEYenvironment variable with your Anthropic API key.
OpenAI Agents SDK
Installation
Usage
Create a Tool Router session and execute tasks with OpenAI agents:
- Set your
COMPOSIO_API_KEYenvironment variable with your API key from Settings. - Set your
OPENAI_API_KEYenvironment variable with your OpenAI API key.
Vercel AI SDK
Installation
Usage
Use Tool Router with Vercel AI SDK’s generateText for single completions:
- Set your
COMPOSIO_API_KEYenvironment variable with your API key from Settings. - Set your
ANTHROPIC_API_KEYenvironment variable with your Anthropic API key.
TypeScript