Composio
Comprehensive guide to building AI agents and applications with Composio. Choose between:
- Tool Router - Create isolated, secure MCP sessions for AI agents with automatic authentication
- Direct Execution - Build traditional apps with manual tool execution and CRUD operations
When to use
Use this skill when:
Building AI Agents:
- Building chat-based or autonomous agents that need access to external tools (Gmail, Slack, GitHub, etc.)
- Creating multi-user applications with isolated tool access per session
- Implementing automatic authentication flows for external services
- Integrating with AI frameworks (Vercel AI SDK, LangChain, OpenAI Agents, Claude)
- Using MCP (Model Context Protocol) for dynamic tool discovery
- Building event-driven agents with triggers
Building Traditional Applications:
- Creating CRUD applications that execute tools directly
- Building automation workflows without agent frameworks
- Managing connected accounts and authentication configurations
- Creating custom tools with specific authentication requirements
- Implementing multi-tenant applications with session isolation
- Building tools with pre/post-execution hooks and modifiers
1. Building Agents
Use Tool Router to build interactive chat-based agents or autonomous long-running task agents. Tool Router creates isolated MCP sessions for users with scoped access to toolkits and tools.
Key Features:
- 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
- Real-time event handling with triggers
1.1 Session Management & Configuration
Essential patterns for creating agent sessions and configuring tools:
- User ID Best Practices - Choose user IDs for security and isolation
- Creating Basic Sessions - Initialize Tool Router sessions
- Session Lifecycle Best Practices - When to create new sessions vs reuse
- Session Configuration - Configure toolkits, tools, and filters
- Using Native Tools - Prefer native tools for performance and control
- Framework Integration - Connect with Vercel AI, LangChain, OpenAI Agents
1.2 Authentication Flows
Authentication patterns for seamless user experiences:
- Auto Authentication in Chat - Enable in-chat authentication flows
- Manual Authorization - Use session.authorize() for explicit flows
- Connection Management - Configure manageConnections, waitForConnections, and custom callback URLs
1.3 Toolkit Querying & UI Building
Build connection UIs and check toolkit states:
- Building Chat UIs - Build chat applications with toolkit selection, connection management, and session handling
- Query Toolkit States - Use session.toolkits() to check connections, filter toolkits, and build connection UIs
1.4 Event-Driven Agents (Triggers)
Real-time event handling and webhook integration patterns:
- Creating Triggers - Set up trigger instances for real-time events
- Subscribing to Events - Listen to trigger events in real-time
- Webhook Verification - Verify and process incoming webhook payloads
- Managing Triggers - Enable, disable, update, and list triggers
2. Building Apps with Composio Tools
Use Composio for traditional applications where tools are executed manually without agent frameworks. This approach gives you full control over tool execution, authentication, and resource management.
Key Capabilities:
- Direct tool execution with manual control
- CRUD operations on connected accounts, auth configs, and toolkits
- Custom tool creation with authentication
- Session isolation for multi-tenant apps
- Pre/post-execution hooks and modifiers
- Event-driven workflows with triggers
2.1 Core Operations
Fundamental patterns for fetching and executing tools:
- Fetching Tools - Get tools with filters and search
- Direct Tool Execution - Execute tools manually with parameters
- Tool Version Management - Version pinning strategies for stability
2.2 Resource Management (CRUD Patterns)
Manage authentication and connections programmatically:
- Connected Accounts CRUD - Create, read, update, delete connected accounts
- Auth Config Management - Manage authentication configurations
- Toolkit Management - Query toolkits, categories, and auth requirement
1---2name: composio3description: Build AI agents and apps with Composio - access 200+ external tools with Tool Router or direct execution4---567# Composio89Comprehensive guide to building AI agents and applications with Composio. Choose between:10- **Tool Router** - Create isolated, secure MCP sessions for AI agents with automatic authentication11- **Direct Execution** - Build traditional apps with manual tool execution and CRUD operations1213## When to use1415Use this skill when:1617**Building AI Agents:**18- Building chat-based or autonomous agents that need access to external tools (Gmail, Slack, GitHub, etc.)19- Creating multi-user applications with isolated tool access per session20- Implementing automatic authentication flows for external services21- Integrating with AI frameworks (Vercel AI SDK, LangChain, OpenAI Agents, Claude)22- Using MCP (Model Context Protocol) for dynamic tool discovery23- Building event-driven agents with triggers2425**Building Traditional Applications:**26- Creating CRUD applications that execute tools directly27- Building automation workflows without agent frameworks28- Managing connected accounts and authentication configurations29- Creating custom tools with specific authentication requirements30- Implementing multi-tenant applications with session isolation31- Building tools with pre/post-execution hooks and modifiers3233### 1. Building Agents3435Use **Tool Router** to build interactive chat-based agents or autonomous long-running task agents. Tool Router creates isolated MCP sessions for users with scoped access to toolkits and tools.3637**Key Features:**38- Session-based isolation per user39- Dynamic toolkit and tool configuration40- Automatic authentication management41- MCP-compatible server URLs for any AI framework42- Connection state querying for UI building43- Real-time event handling with triggers4445#### 1.1 Session Management & Configuration4647Essential patterns for creating agent sessions and configuring tools:4849- [User ID Best Practices](rules/tr-userid-best-practices.md) - Choose user IDs for security and isolation50- [Creating Basic Sessions](rules/tr-session-basic.md) - Initialize Tool Router sessions51- [Session Lifecycle Best Practices](rules/tr-session-lifecycle.md) - When to create new sessions vs reuse52- [Session Configuration](rules/tr-session-config.md) - Configure toolkits, tools, and filters53- [Using Native Tools](rules/tr-mcp-vs-native.md) - Prefer native tools for performance and control54- [Framework Integration](rules/tr-framework-integration.md) - Connect with Vercel AI, LangChain, OpenAI Agents5556#### 1.2 Authentication Flows5758Authentication patterns for seamless user experiences:5960- [Auto Authentication in Chat](rules/tr-auth-auto.md) - Enable in-chat authentication flows61- [Manual Authorization](rules/tr-auth-manual.md) - Use session.authorize() for explicit flows62- [Connection Management](rules/tr-auth-connections.md) - Configure manageConnections, waitForConnections, and custom callback URLs6364#### 1.3 Toolkit Querying & UI Building6566Build connection UIs and check toolkit states:6768- [Building Chat UIs](rules/tr-building-chat-ui.md) - Build chat applications with toolkit selection, connection management, and session handling69- [Query Toolkit States](rules/tr-toolkit-query.md) - Use session.toolkits() to check connections, filter toolkits, and build connection UIs7071#### 1.4 Event-Driven Agents (Triggers)7273Real-time event handling and webhook integration patterns:7475- [Creating Triggers](rules/triggers-create.md) - Set up trigger instances for real-time events76- [Subscribing to Events](rules/triggers-subscribe.md) - Listen to trigger events in real-time77- [Webhook Verification](rules/triggers-webhook.md) - Verify and process incoming webhook payloads78- [Managing Triggers](rules/triggers-manage.md) - Enable, disable, update, and list triggers7980### 2. Building Apps with Composio Tools8182Use Composio for traditional applications where tools are executed manually without agent frameworks. This approach gives you full control over tool execution, authentication, and resource management.8384**Key Capabilities:**85- Direct tool execution with manual control86- CRUD operations on connected accounts, auth configs, and toolkits87- Custom tool creation with authentication88- Session isolation for multi-tenant apps89- Pre/post-execution hooks and modifiers90- Event-driven workflows with triggers9192#### 2.1 Core Operations9394Fundamental patterns for fetching and executing tools:9596- [Fetching Tools](rules/app-fetch-tools.md) - Get tools with filters and search97- [Direct Tool Execution](rules/app-execute-tools.md) - Execute tools manually with parameters98- [Tool Version Management](rules/app-tool-versions.md) - Version pinning strategies for stability99100#### 2.2 Resource Management (CRUD Patterns)101102Manage authentication and connections programmatically:103104- [Connected Accounts CRUD](rules/app-connected-accounts.md) - Create, read, update, delete connected accounts105- [Auth Config Management](rules/app-auth-configs.md) - Manage authentication configurations106- [Toolkit Management](rules/app-toolkits.md) - Query toolkits, categories, and auth requirement