Home
cd ../playbooks
Developer ToolsAdvanced

Composio SDK with Claude Code: Connect 250+ APIs in Minutes

Connect Claude Code to 250+ APIs using Composio SDK. Build AI agents that send emails, create GitHub issues, and post to Slack — not just generate text.

15 minutes
By ComposioSource
#composio#sdk#ai-agents#integrations#tools#api#gmail#slack#github#automation

You want Claude to actually send emails, create GitHub issues, and post to Slack — not just tell you what to type. But building API integrations for every tool means weeks of auth flows, error handling, and rate limiting.

Who it's for: developers building AI agents that interact with real tools, automation engineers connecting AI to business workflows, indie hackers building AI-powered products, teams integrating Claude into existing toolchains, AI application developers

Example

"Build an AI agent that monitors GitHub PRs and posts review summaries to Slack" → Working agent with Composio SDK connecting Claude to GitHub and Slack APIs, handling auth, and executing real actions — not just generating text

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Composio SDK

Build AI agents and applications with access to 200+ external tools. Composio provides two primary approaches for integration.

## Two Development Approaches

### Tool Router (Agent Development)

For chat-based or autonomous agents that need access to external tools like Gmail, Slack, and GitHub.

**Features:**
- Session-based user isolation
- Dynamic toolkit configuration
- Automatic authentication management
- MCP-compatible server URLs
- Real-time event handling with triggers

**Best for:**
- Multi-user AI agents
- Chat-based assistants
- Autonomous workflows
- Framework integration (Vercel AI SDK, LangChain)

### Direct Execution (App Development)

For traditional applications requiring manual tool control.

**Features:**
- Manual tool execution control
- CRUD operations for accounts and configs
- Custom tool creation
- Pre/post-execution hooks
- Event-driven workflows

**Best for:**
- CRUD applications
- Automation workflows
- Multi-tenant systems
- Custom integrations

## Core Concepts

### User Sessions

```python
# Create isolated session per user
session = composio.create_session(user_id="user_123")

# Each user has separate:
# - Authentication tokens
# - Tool access
# - Data isolation
```

### Authentication Flows

**Automatic Auth:**
- Tool Router handles OAuth flows
- Users authorize once per app
- Tokens managed automatically

**Manual Auth:**
- Direct control over auth process
- Custom connection management
- Explicit token handling

### Toolkit Configuration

Query available tools dynamically:
- List connected apps
- Check authentication status
- Filter by capabilities
- Build dynamic UIs

### Triggers (Event-Driven)

React to external events:
- Webhook-based notifications
- Real-time event handling
- Automated responses
- Event filtering

## Supported Integrations

### Communication
- Gmail, Outlook, SendGrid
- Slack, Discord, Teams, Telegram
- WhatsApp, Intercom

### Development
- GitHub, GitLab, Bitbucket
- Jira, Linear, Asana
- Confluence, Notion

### Productivity
- Google Drive, Dropbox, OneDrive
- Google Sheets, Airtable
- Notion, Coda

### CRM & Sales
- Salesforce, HubSpot
- Pipedrive, Close
- Zendesk, Freshdesk

### Analytics
- Mixpanel, Amplitude
- Google Analytics, PostHog
- Segment, Datadog

## Quick Start

### Tool Router Setup

```python
from composio import ToolRouter

# Initialize with API key
router = ToolRouter(api_key="your_key")

# Create user session
session = router.create_session(user_id="user_123")

# Get MCP-compatible URL
mcp_url = session.get_mcp_url()

# Configure toolkit
session.configure_toolkit(["gmail", "slack", "github"])
```

### Direct Execution Setup

```python
from composio import Composio

# Initialize client
client = Composio(api_key="your_key")

# Get available tools
tools = client.get_tools()

# Execute specific tool
result = client.execute(
    tool="gmail_send_email",
    params={"to": "user@example.com", "subject": "Hello"}
)
```

## Common Patterns

### Multi-User Agent

```python
# Handle multiple users with isolated sessions
def handle_user_request(user_id, request):
    session = router.get_or_create_session(user_id)

    # Check if user has authorized required apps
    if not session.is_authorized("gmail"):
        return session.get_auth_url("gmail")

    # Execute tool with user's credentials
    return session.execute(request)
```

### Event-Driven Workflow

```python
# Set up trigger for new emails
@composio.trigger("gmail_new_email")
def on_new_email(event):
    # Process incoming email
    email = event.data

    # Take action (e.g., create issue)
    composio.execute("github_create_issue", {
        "title": f"Email from {email.sender}",
        "body": email.content
    })
```

## Best Practices

1. **Use Tool Router for agents**: Simplifies multi-user management
2. **Handle auth gracefully**: Guide users through OAuth flows
3. **Implement session isolation**: Never mix user credentials
4. **Check rate limits**: External APIs have constraints
5. **Use triggers sparingly**: Monitor webhook costs
6. **Cache tool lists**: Don't query on every request

## Resources

- Documentation: platform.composio.dev/docs
- API Reference: platform.composio.dev/api
- Tool Catalog: platform.composio.dev/tools

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Build AI agents and applications with access to 200+ external tools like Gmail, Slack, GitHub, and more. Choose between Tool Router for agent development or Direct Execution for traditional applications.


Quick Start

Step 1: Create a Composio Project

mkdir -p ~/Projects/composio-agent

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Projects/composio-agent/

Step 3: Start Building

cd ~/Projects/composio-agent
claude

Then say: "Help me build an AI agent that can send emails and create GitHub issues"


Two Approaches

Approach Best For Features
Tool Router AI Agents Session isolation, auto-auth, MCP-compatible
Direct Execution Traditional Apps Manual control, CRUD operations, webhooks

Tool Router (Agent Development)

For chat-based or autonomous agents:

  • Session-based user isolation
  • Dynamic toolkit configuration
  • Automatic authentication management
  • MCP-compatible server URLs
  • Real-time event handling with triggers

Direct Execution (App Development)

For traditional applications:

  • Manual tool execution control
  • CRUD operations for accounts
  • Custom tool creation
  • Pre/post-execution hooks
  • Event-driven workflows

Supported Integrations

Category Examples
Communication Gmail, Slack, Discord, Teams
Development GitHub, GitLab, Jira, Linear
Productivity Notion, Google Docs, Confluence
CRM Salesforce, HubSpot, Pipedrive
Storage Google Drive, Dropbox, OneDrive

Example Prompts

  • "Create an agent that monitors GitHub PRs and posts to Slack"
  • "Build a workflow that syncs Notion with Google Sheets"
  • "Set up an agent to auto-respond to Gmail inquiries"
  • "Create a multi-tool agent with calendar and email access"

Key Concepts

User Sessions

  • Isolate tool access per user
  • Manage authentication flows
  • Handle multi-tenant scenarios

Triggers

  • React to external events
  • Webhook-based notifications
  • Real-time event handling

Tips

  • Start with Tool Router: Easier for agent development
  • Handle auth flows: First-time users need OAuth
  • Use session isolation: Keep user data separate
  • Check rate limits: External APIs have constraints

Frequently Asked Questions

What is the Composio SDK for Claude Code?

Composio SDK is an integration layer that connects Claude Code to 200+ external tools like Gmail, Slack, GitHub, Notion, Salesforce, and more. It lets you build AI agents that automate workflows across multiple apps from a single CLAUDE.md configuration.

How do I connect Claude Code to Gmail, Slack, or GitHub using Composio?

Download the Composio SDK CLAUDE.md template, place it in your project folder, and launch Claude Code. Then tell Claude what you want to build — for example, "Create an agent that monitors GitHub PRs and posts to Slack." Composio handles the OAuth authentication flows automatically.

What is the difference between Tool Router and Direct Execution in Composio?

Tool Router is designed for AI agent development with features like session isolation, auto-authentication, and MCP compatibility. Direct Execution is for traditional applications where you need manual control over tool execution, CRUD operations, and webhook-based workflows.

$Related Playbooks

Developer Tools

Distinctive Frontend Design

Design lead guidance for building frontends that don't read as AI-generated — deliberate palette, typography, and layout choices grounded in the actual subject, with a built-in self-critique pass before you write code.

5 minutes
Intermediate
Developer Tools

Network Issue Debugging

Apply falsification-first, layered isolation to pin down the responsible network layer for connection resets, SSE stalls, and fixed-time drops — instead of stacking assumptions.

20 minutes
Advanced
Developer Tools

Docs Cleaner

Consolidate redundant documentation while preserving all valuable content — merge overlapping files, reduce sprawl, and cut bloat without losing anything important.

10 minutes
Beginner
Developer Tools

Database Sync Manager

Automate database synchronization, replication, migration, and cross-platform data integration

10 minutes
Advanced
Developer Tools

Developer Presentation Builder

Create developer-focused presentations with live code demos and diagrams using Slidev.

10 minutes
Advanced
Developer Tools

DevOps Automation Assistant

DevOps and IT Ops automation - CI/CD, monitoring, incident management, and infrastructure workflows

10 minutes
Advanced
Developer Tools

Discord Bot Builder

Discord bot development - community management, moderation, notifications, and AI integration

10 minutes
Advanced
Developer Tools

ETL Pipeline Builder

Design and automate Extract, Transform, Load data pipelines for data integration and analytics

10 minutes
Advanced
Developer Tools

DevOps Server Manager

Manage servers, Docker containers, VMs, and network infrastructure through Claude Code via SSH. Keep your entire infrastructure documented in markdown files.

15 minutes
Advanced
Developer Tools

Docker Containerization

Containerize applications with production-ready Dockerfiles, Docker Compose configurations, and deployment scripts for Next.js, React, and Node.js projects.

15 minutes
Intermediate
Developer Tools

Error Message Explainer — Decode Any Error in Plain English

Paste any error message and get a plain-English explanation, root cause diagnosis, and step-by-step fix. Works with Python, JavaScript, Docker, Git, and any CLI error.

5 minutes
Beginner
Developer Tools

Explanatory Coding Mode

Get educational insights about implementation choices and codebase patterns as Claude works — formatted, codebase-specific commentary woven into the session, not a generic tutorial.

2 minutes
Beginner

Browse all Developer Tools playbooks →