skills/composiohq/skills/composio-tool-router

composio-tool-router

SKILL.md

Composio Tool Router

Comprehensive guide to building AI agents with Composio Tool Router - create isolated, secure tool sessions for your users with seamless authentication and toolkit management.

When to use

Use this skill when:

  • Building AI agents that need access to external tools (Gmail, Slack, GitHub, etc.)
  • Creating multi-user applications with isolated tool access
  • Implementing authentication flows for external services
  • Managing toolkit connections and permissions
  • Integrating with AI frameworks (Vercel AI SDK, LangChain, OpenAI Agents, Claude)
  • Using MCP (Model Context Protocol) for tool discovery
  • Building UI for connection management

Core Concepts

Tool Router creates isolated MCP sessions for users with scoped access to toolkits and tools. It handles:

  • Session-based isolation per user
  • Dynamic toolkit and tool configuration
  • Automatic authentication management
  • MCP-compatible server URLs for any AI framework
  • Connection state querying for UI building

Rules

1. Building Agents with Tool Router

Essential patterns for creating agent sessions and configuring tools:

2. Authenticating Users

Authentication patterns for seamless user experiences:

3. Fetching Toolkits and Connection Status

Build connection UIs and check toolkit states:

Advanced (Coming Soon)

  • Session modifiers and middleware
  • Custom tool configuration
  • Workbench integration
  • Experimental features

Quick Start

import { Composio } from '@composio/core';

// Create a session with Gmail tools
const composio = new Composio();
const session = await composio.create('user_123', {
  toolkits: ['gmail'],
  manageConnections: true
});

// Use with any MCP-compatible framework
console.log('MCP URL:', session.mcp.url);

4. Advanced Features (Triggers & Events)

Real-time event handling and webhook integration patterns:

References

Weekly Installs
17
First Seen
6 days ago
Installed on
claude-code16
cursor12
codex9
opencode8
gemini-cli8
github-copilot8