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

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

Git Conflict Resolution Framework

A plan-first framework for resolving Git merge conflicts by combining both branches' intent instead of blindly picking a side — categorized resolution patterns for imports, tests, generated files, configs, code logic, and struct definitions, with a mandatory approval step before any file is touched.

5 minutes
Intermediate
Developer Tools

Building Animations in Expo and React Native

A construction discipline for React Native motion: a frequency gate that produces zero lines of code when nothing should animate, a cheapest-tool-that-fits selection table, spring/easing values instead of guesses, and the JS-thread rules that separate 60fps from 20fps on a real device.

10 minutes
Advanced
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
Developer Tools

7-Phase Feature Development Workflow

Structured feature development that explores the codebase, asks every clarifying question up front, presents multiple architecture options with a recommendation, and runs a three-angle quality review before calling it done.

5 minutes
Intermediate
Developer Tools

Ginkgo Table and Dynamic Specs

Parameterize and generate Ginkgo test specs correctly — DescribeTable/Entry, the four ways to name an entry, DescribeTableSubtree for multi-It rows, reusable entry sets, and the one gotcha (Entry params evaluate at construction time, not BeforeEach time) that causes most table-spec bugs.

5 minutes
Intermediate
Developer Tools

Ginkgo Timeouts and Async Testing

Make Ginkgo specs interruptible and test asynchronous behavior correctly — SpecContext cancellation, NodeTimeout/SpecTimeout/GracePeriod, Eventually/Consistently with proper context propagation, and the two goroutine rules (GinkgoRecover, poll-don't-block) that prevent one failed assertion from crashing an entire Go test suite.

5 minutes
Intermediate
Developer Tools

Writing Ginkgo Specs

Author correct Ginkgo specs — container vs. subject vs. setup nodes, the declare-in-container/initialize-in-setup rule that prevents the most common Ginkgo bug, JustBeforeEach for separating creation from configuration, DeferCleanup for restore-not-clear teardown, and GinkgoHelper() for failure locations that point at the caller instead of the helper.

5 minutes
Beginner
Developer Tools

Idea-to-Design Brainstorming Gate

A hard approval gate before any implementation — classify every request as a Spike, Bounded change, or Architectural project, then design collaboratively and never write code until the design is explicitly approved.

5 minutes
Intermediate
Developer Tools

Hookify Guardrails

Create custom Claude Code guardrails with lightweight markdown rule files instead of hand-editing hooks.json — pattern matching, no restart required, rules live-load on the next tool call.

5 minutes
Beginner
Developer Tools

GPT Taste Skill: Strict Anti-Slop UI Rules

A stricter, more deterministic anti-slop frontend ruleset with GSAP motion patterns, despite the GPT-oriented name it works as a standard CLAUDE.md in Claude Code

5 minutes
Intermediate
Developer Tools

GitHub Contributor

A phase-based playbook for shipping pull requests maintainers actually merge — discovery, CONTRIBUTING compliance, PR-size checks, minimal diffs, and post-submission interaction.

20 minutes
Intermediate

Browse all Developer Tools playbooks →