Repository: ComposioHQ/composio
Stars: 27813
CLAUDE.md
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
This is the Composio SDK v3 repository containing both TypeScript and Python SDKs. The main development focus is on the TypeScript SDK located in /ts/ directory. The project uses a monorepo structure with multiple packages and examples.
Memories and Notes
- For documentation tasks, refer to docs/CLAUDE.md
Effect.ts Reference Source
The CLI package (@composio/cli) is built on the Effect.ts ecosystem. A local copy of the Effect source code is available as a git submodule:
- Location: ts/vendor/effect/
- Repo: Effect-TS/effect
- Branch: main
When working on CLI code, reference the Effect source for accurate patterns:
- ts/vendor/effect/packages/effect/src/ β core Effect runtime
- ts/vendor/effect/packages/cli/src/ β @effect/cli (Command, Options, Args)
- ts/vendor/effect/packages/platform/src/ β @effect/platform (FileSystem, Terminal)
Important: The submodule is for read-only reference only. Do not modify files in ts/vendor/. The CLI's actual dependencies come from npm via pnpm install.
Clack Reference Source
The CLI uses @clack/prompts for interactive terminal UI. A local copy of the Clack source code is available as a git submodule:
- Location: ts/vendor/clack/
- Repo: bombshell-dev/clack
When working on CLI prompts and terminal UI, reference the Clack source for accurate APIs:
- ts/vendor/clack/packages/prompts/src/ β @clack/prompts (high-level API: text, select, confirm, spinner, etc.)
- ts/vendor/clack/packages/core/src/ β @clack/core (low-level primitives)
See ts/packages/cli/AGENTS.md for detailed Clack usage guidelines.
Important: The submodule is for read-only reference only. Do not modify files in ts/vendor/. The CLI's actual @clack/prompts dependency comes from npm via pnpm install.
Common Development Commands
Build and Development
Build all packages
pnpm buildBuild only TypeScript packages
pnpm build:packagesClean build artifacts
pnpm clean
pnpm clean:workspaceLint code
pnpm lint
pnpm lint:fixFormat code
pnpm formatRun tests
pnpm testPackage Management
Install dependencies
pnpm installCheck peer dependencies
pnpm check:peer-depsUpdate peer dependencies
pnpm update:peer-depsCreating New Components
Create a new provider
pnpm create:provider <provider-name> [--agentic]Create a new example
pnpm create:example <example-name>Release Management
Create changeset for releases
pnpm changesetVersion packages
pnpm changeset:versionPublish packages
pnpm changeset:releaseProject Architecture
Repository Structure
composio/
βββ ts/ # TypeScript SDK (main development)
β βββ packages/
β β βββ core/ # Core SDK functionality
β β βββ providers/ # AI provider integrations (OpenAI, Anthropic, etc.)
β β βββ cli/ # Command-line interface
β β βββ json-schema-to-zod/ # Schema conversion utility
β β βββ ts-builders/ # TypeScript code generation utilities
β βββ examples/ # Usage examples for different providers
βββ python/ # Python SDK
βββ docs/ # Documentation (Fumadocs)
βββ examples/ # Cross-platform examplesCore Packages
@composio/core - Main SDK functionality:
- src/composio.ts - Main Composio class
- src/models/ - Core models (Tools, Toolkits, ConnectedAccounts, etc.)
- src/provider/ - Base provider implementations
- src/services/ - Internal services (telemetry, pusher)
- src/types/ - TypeScript type definitions
- src/utils/ - Utility functions and helpers
Provider Packages - AI integrations:
- @composio/openai - OpenAI integration
- @composio/anthropic - Anthropic integration
- @composio/google - Google GenAI integration
- @composio/langchain - LangChain integration
- @composio/vercel - Vercel AI integration
- @composio/mastra - Mastra integration
Key Concepts
Tools - Individual functions that can be executed (e.g., GITHUB_CREATE_REPO, GMAIL_SEND_EMAIL)
Toolkits - Collections of related tools grouped by service (e.g., github, gmail, slack)
Connected Accounts - User authentication/authorization for external services
Auth Configs - Configuration for different authentication methods
Custom Tools - User-defined tools with custom logic
Providers - Integrations with AI frameworks (OpenAI, Anthropic, etc.)
Modifiers - Middleware to transform tool inputs/outputs
Development Workflow
For Tool Development
1. Tools are auto-generated from OpenAPI specifications
2. Custom tools can be created using the Custom Tools API
3. Tool execution happens through the main Composio class
For Provider Development
1. Use
pnpm create:provider <name> to scaffold new providers2. Implement required methods:
wrapTool, wrapTools3. For agentic providers, also implement execution handlers
4. Add comprehensive tests and documentation
Testing
- Unit tests use Vitest
- Run tests with
pnpm test- Tests are located in
test/ directories within each package- Mock implementations are available in
test/utils/mocks/Code Quality
- ESLint configuration in
eslint.config.mjs- Prettier for code formatting
- TypeScript strict mode enabled
- Comprehensive TSDoc documentation required
- Husky pre-commit hooks for quality checks
Environment Variables
COMPOSIO_API_KEY # Required: Your Composio API key
COMPOSIO_BASE_URL # Optional: Custom API base URL
COMPOSIO_LOG_LEVEL # Optional: Logging level (silent, error, warn, info, debug)
COMPOSIO_DISABLE_TELEMETRY # Optional: Set to "true" to disable telemetry
DEVELOPMENT # Development mode flag
CI # CI environment flagKey Files and Locations
- Main SDK Entry: ts/packages/core/src/index.ts
- Core Composio Class: ts/packages/core/src/composio.ts
- Type Definitions: ts/packages/core/src/types/
- Error Classes: ts/packages/core/src/errors/
- Examples: ts/examples/ and examples/
- Documentation: docs/
- Build Configs: turbo.jsonc, tsconfig.base.json, tsdown.config.base.ts
- E2E Tests: ts/e2e-tests/
Maintenance Tasks
When Updating GitHub Actions
When modifying files in .github/workflows/, update the "Prerequisites" section in ts/docs/internal/release.md with the current tool versions:
- Node.js: cat .nvmrc
- Bun: cat .bun-version
- pnpm: cat package.json | jq -r .packageManager | cut -d'@' -f2
Testing Commands
Run all tests
pnpm testRun tests for core package only
cd ts/packages/core && pnpm testRun tests with UI
pnpm test:uiTypeScript E2E Tests
E2E tests for @composio/core are located in ts/e2e-tests/ and test runtime compatibility across different JavaScript environments.
Run all e2e tests (Node.js + Deno + Cloudflare)
pnpm test:e2eRun only Node.js e2e tests (CJS/ESM compatibility, runs in Docker)
pnpm test:e2e:nodeRun only Deno e2e tests (npm: specifier compatibility, runs in Docker)
pnpm test:e2e:denoRun only Cloudflare Workers e2e tests
pnpm test:e2e:cloudflareRun Node.js tests with a specific Node version
COMPOSIO_E2E_NODE_VERSION=22.12.0 pnpm test:e2e:nodeRun Deno tests with a specific Deno version
COMPOSIO_E2E_DENO_VERSION=2.6.7 pnpm test:e2e:denoE2E Test Structure:
ts/e2e-tests/
βββ _utils/ # Shared Docker infrastructure
βββ runtimes/
β βββ node/ # Node.js runtime tests
β β βββ cjs-basic/ # CommonJS compatibility
β β βββ esm-basic/ # ESM compatibility
β βββ deno/ # Deno runtime tests
β β βββ esm-basic/ # npm: specifier compatibility
β βββ cloudflare/ # Cloudflare runtime tests
β βββ cf-workers-basic/ # Cloudflare Workers tests
βββ README.md # E2E test documentationNote: When adding new e2e tests, update ts/e2e-tests/README.md with the new test information.Common Patterns
Tool Execution
const composio = new Composio({ apiKey: 'your-key' });
const result = await composio.tools.execute('TOOL_NAME', {
userId: 'user-id',
arguments: { / tool args / }
});Provider Integration
import { OpenAIProvider } from '@composio/openai';
const provider = new OpenAIProvider({ apiKey: 'openai-key' });
const tools = await composio.tools.get('user-id', { toolkits: ['github'] });
const wrappedTools = provider.wrapTools(tools);Custom Tool Creation
import { z } from 'zod';const customTool = await composio.tools.createCustomTool({
name: 'My Tool',
description: 'Tool description',
slug: 'MY_TOOL',
inputParams: z.object({
param: z.string().describe('Parameter description')
}),
execute: async (input) => {
// Implementation
return {
data: { result: input.param },
error: null,
successful: true
};
}
});
This monorepo uses pnpm workspaces and Turbo for efficient builds and development.
Python SDK Development
Setup
The Python SDK is located in the
/python/ directory and uses uv for dependency management and nox for automation.Environment Setup
Create and setup Python development environment
cd python
make env
source .venv/bin/activatePython Development Commands
Setup environment (creates virtual env with all dependencies)
make envSync dependencies (when in an existing environment)
make syncInstall provider packages
make providerFormat code using ruff
make fmt
Or directly: nox -s fmt
Check linting and type issues
make chk
Or directly: nox -s chk
Fix linting issues
nox -s fixRun tests (requires implementing tst session)
make tst
Or directly: nox -s tst
Run sanity tests (requires implementing snt session)
make snt
Or directly: nox -s snt
Clean build artifacts
make clean-buildBump version
make bumpBuild packages
make buildPython Project Structure
python/
βββ composio/ # Main SDK package
βββ providers/ # Provider implementations
βββ tests/ # Test suite
βββ examples/ # Usage examples
βββ scripts/ # Development scripts
βββ config/ # Configuration files
β βββ pytest.ini # Pytest configuration
β βββ mypy.ini # MyPy type checking config
β βββ ruff.toml # Ruff linter/formatter config
β βββ codecov.yml # Code coverage config
βββ Makefile # Development shortcuts
βββ noxfile.py # Nox automation sessions
βββ pyproject.toml # Project configurationPython Code Quality
- Formatter: Ruff (Black-compatible, 88 char line length)
- Linter: Ruff with custom configuration
- Type Checker: mypy with strict optional typing
- Test Framework: pytest with custom markers (core, openai, langchain, agno)
- Python Version: >=3.10, <4
- Dependency Managers: uv
Python Testing
Run tests with pytest markers
pytest -m core # Run core tests only
pytest -m openai # Run OpenAI provider tests
pytest -m langchain # Run LangChain provider tests
pytest -m agno # Run Agno provider testsPython Package Dependencies
- Core:
pysher, pydantic>=2.6.4, composio-client==1.4.0, typing-extensions>=4.0.0, openai- Dev:
nox, pytest, ruff, langchain_openai, fastapi, twine, click, semverPython Environment Variables
Same as TypeScript SDK, with additional:
OPENAI_API_KEY # Required for OpenAI provider examplesREADME.md
<div align="center">
<img src="https://raw.githubusercontent.com/ComposioHQ/composio/next/public/cover.png" alt="Composio Logo" width="auto" height="auto" style="margin-bottom: 20px;"/>
Composio SDK
Skills that evolve for your Agents
π Website β’ π Documentation




</div>
This repository contains the official Software Development Kits (SDKs) for Composio, providing seamless integration capabilities for Python and Typescript Agentic Frameworks and Libraries.
Getting Started
TypeScript SDK Installation
Using npm
npm install @composio/coreUsing yarn
yarn add @composio/coreUsing pnpm
pnpm add @composio/core#### Quick start:
import { Composio } from '@composio/core';
// Initialize the SDK
const composio = new Composio({
// apiKey: 'your-api-key',
});#### Simple Agent with OpenAI Agents
npm install @composio/openai-agents @openai/agentsimport { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, run } from '@openai/agents';const composio = new Composio({
provider: new OpenAIAgentsProvider(),
});
const userId = '[email protected]';
const tools = await composio.tools.get(userId, {
toolkits: ['HACKERNEWS'],
});
const agent = new Agent({
name: 'Hackernews assistant',
tools: tools,
});
const result = await run(agent, 'What is the latest hackernews post about?');
console.log(JSON.stringify(result.finalOutput, null, 2));
// will return the response from the agent with data from HACKERNEWS API.
Python SDK Installation
Using pip
pip install composioUsing poetry
poetry add composio#### Quick start:
from composio import Composiocomposio = Composio(
# api_key="your-api-key",
)
#### Simple Agent with OpenAI Agents
pip install composio_openai_agents openai-agentsimport asyncio
from agents import Agent, Runner
from composio import Composio
from composio_openai_agents import OpenAIAgentsProviderInitialize Composio client with OpenAI Agents Provider
composio = Composio(provider=OpenAIAgentsProvider())user_id = "[email protected]"
tools = composio.tools.get(user_id=user_id, toolkits=["HACKERNEWS"])
Create an agent with the tools
agent = Agent(
name="Hackernews Agent",
instructions="You are a helpful assistant.",
tools=tools,
)Run the agent
async def main():
result = await Runner.run(
starting_agent=agent,
input="What's the latest Hackernews post about?",
)
print(result.final_output)asyncio.run(main())
will return the response from the agent with data from HACKERNEWS API.
For more detailed usage instructions and examples, please refer to each SDK's specific documentation.
Open API Specification
To update the OpenAPI specifications used for generating SDK documentation:
Pull the latest API specifications from the backend
pnpm api:pullThis command pulls the OpenAPI specification from https://backend.composio.dev/api/v3/openapi.json and updates the local API documentation files.
This is pulled automatically with build step.
Available SDKs
TypeScript SDK (/ts)
The TypeScript SDK provides a modern, type-safe way to interact with Composio's services. It's designed for both Node.js and browser environments, offering full TypeScript support with comprehensive type definitions.
For detailed information about the TypeScript SDK, please refer to the TypeScript SDK Documentation.
Python SDK (/python)
The Python SDK offers a Pythonic interface to Composio's services, making it easy to integrate Composio into your Python applications. It supports Python 3.10+ and follows modern Python development practices.
For detailed information about the Python SDK, please refer to the Python SDK Documentation.
Provider Support
The following table shows which AI frameworks and platforms are supported in each SDK:
| Provider | TypeScript | Python |
|----------|:----------:|:------:|
| OpenAI | β
| β
|
| OpenAI Agents | β
| β
|
| Anthropic | β
| β
|
| LangChain | β
| β
|
| LangGraph | β
* | β
|
| LlamaIndex | β
| β
|
| Vercel AI SDK | β
| β |
| Google Gemini | β
| β
|
| Google ADK | β | β
|
| Mastra | β
| β |
| Cloudflare Workers AI | β
| β |
| CrewAI | β | β
|
| AutoGen | β | β
|
\ LangGraph in TypeScript is supported via the @composio/langchain package.*
Don't see your provider? Learn how to build a custom provider to integrate with any AI framework.
Packages
Core Packages
| Package | Version |
|---------|---------|
| TypeScript | |
| @composio/core | !npm version |
| Python | |
| composio | !PyPI version |
Provider Packages
| Package | Version |
|---------|---------|
| TypeScript | |
| @composio/openai | !npm version |
| @composio/openai-agents | !npm version |
| @composio/anthropic | !npm version |
| @composio/langchain | !npm version |
| @composio/llamaindex | !npm version |
| @composio/vercel | !npm version |
| @composio/google | !npm version |
| @composio/mastra | !npm version |
| @composio/cloudflare | !npm version |
| Python | |
| composio-openai | !PyPI version |
| composio-openai-agents | !PyPI version |
| composio-anthropic | !PyPI version |
| composio-langchain | !PyPI version |
| composio-langgraph | !PyPI version |
| composio-llamaindex | !PyPI version |
| composio-crewai | !PyPI version |
| composio-autogen | !PyPI version |
| composio-gemini | !PyPI version |
| composio-google | !PyPI version |
| composio-google-adk | !PyPI version |
Utility Packages
| Package | Version |
|---------|---------|
| @composio/json-schema-to-zod | !npm version |
| @composio/ts-builders | !npm version |
_if you are looking for the older sdk, you can find them here_
Rube
Rube is a Model Context Protocol (MCP) server built with Composio. It connects your AI tools to 500+ apps like Gmail, Slack, GitHub, and Notion. Simply install it in your AI client, authenticate once with your apps, and start asking your AI to perform real actions like "Send an email" or "Create a task."
It integrates with major AI clients like Cursor, Claude Desktop, VS Code, Claude Code and any custom MCPβcompatible client. You can switch between these clients and your integrations follow you.
Contributing
We welcome contributions to both SDKs! Please read our contribution guidelines before submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions about the SDKs:
- Open an issue in this repository
- Contact our support team
- Check our documentation