TypeScript and Python SDK examples
Use these examples to try a specific Composio feature in your own project. Start with a walkthrough for complete setup instructions, or open a source file alongside its guide.
Start with a walkthrough
Run an agent on Cloudflare Workers
Build, test, and deploy an authenticated HTTP endpoint that runs an OpenAI agent with Composio tools.
Select tools with TypeSafe
Choose a tool, fill its arguments, and handle incomplete decisions before execution.
Use CrewAI and LangChain with MCP
Give either Python framework access to a Composio session through its MCP client.
Analyze a CSV and download a report
Turn the session files API into an agent that produces a downloadable report.
Use multiple accounts in one agent
Connect work and personal Gmail and require explicit account selection.
Combine your own tools with Composio
Run local application tools alongside remote Composio tools.
Run an agent when an email arrives
Connect trigger setup, webhook verification, and agent execution.
Find source code by task
These are selected examples from ts/examples, python/examples, and the Python TypeSafe provider. The directories also contain experiments and older API examples. Use the linked guide for the current setup and API choices.
| Task | TypeScript source | Python source | Guide |
|---|---|---|---|
| Run an agent on Cloudflare Workers | OpenAI Worker, Mastra Worker | Not available | Worker setup and deployment |
| Select and shortlist tools with TypeSafe | TypeSafe examples | TypeSafe demo | TypeSafe walkthrough |
| Connect an agent over MCP | Vercel AI SDK | CrewAI, LangChain | Python MCP walkthrough, sessions via MCP |
| Preload tools in a session | Preload tools | Preload tools | Custom tools walkthrough |
| Control which tools a session exposes | Direct tools | Direct tools | Custom tools walkthrough, configure sessions |
| Change a session's configuration | Update a session | Update a session | Sessions |
| Upload and download sandbox files | See guide | Session files | CSV report walkthrough, remote sandbox |
| Connect an app for a user | Connected accounts | Authorize a session | Authentication |
| Use multiple accounts in one agent | Multi-account agent | See walkthrough | Multiple accounts walkthrough |
| Create triggers and receive events | Trigger examples | Triggers | Email-triggered agent, receive events |
Run a repository example
Follow the TypeScript setup or Python setup to install the workspace and configure credentials. Check the selected example for its model provider key and connected-account requirements. Scripts that create connections or triggers make changes in your Composio project.
The LangChain MCP script declares its own dependencies. From the repository root, use uv run --script python/examples/tool_router/langchain_agent.py as shown in the walkthrough.
For a standalone project, use a walkthrough above. To choose a framework first, see SDKs and frameworks.