Guide · Open source
How to use Composio: install the SDK and connect AI agents to apps
Updated · written with AI from the project's own documentation and checked against our catalogue data
Composio is an open-source TypeScript and Python SDK, plus a command-line tool, that lets AI agents use third-party apps on a user's behalf. This guide shows you how to install it, get an API key, create a per-user session and hand its tools to an agent. It is aimed at developers who already build agents and want them to read or act in services such as email.
Quick start
- 1Check prerequisites. Confirm Node 22+ for TypeScript or Python 3.10+ for Python, and get a COMPOSIO_API_KEY from the Composio dashboard.
- 2Install the packages. Run npm install or pip install for @composio/core or composio, plus your provider package and your agent framework.
- 3Create a Composio client. Instantiate Composio with the provider that matches your agent framework, such as OpenAIAgentsProvider.
- 4Create a session for a user. Call composio.create() with a user ID so the session is scoped to one of your users.
- 5Pass the tools to your agent. Call session.tools() and give the result to your agent's tools parameter, then run the agent with a request.
- 6Optionally use the CLI or MCP. Install the CLI with the curl command, or set mcp: true and connect an MCP client to session.mcp.url.
What you need before installing Composio
Composio is a developer tool. The README describes an SDK and a CLI, not a finished end-user app. Check these prerequisites first.
- Node 22+ for the TypeScript SDK (@composio/core)
- Python 3.10+ for the Python SDK (composio)
- A COMPOSIO_API_KEY, which you get from the Composio dashboard at dashboard.composio.dev/settings
Install the Composio SDK with npm or pip
Install the SDK with the provider package for your agent framework. The README's examples use the OpenAI Agents provider. Other providers are listed in the README's provider table, including LangChain, Vercel AI SDK and LlamaIndex.
- TypeScript: install @composio/core, @composio/openai-agents and @openai/agents with npm.
- Python: install composio, composio-openai-agents and openai-agents with pip.
npm install @composio/core @composio/openai-agents @openai/agents
pip install composio composio-openai-agents openai-agentsCreate a session for one user and load its tools
Create a Composio client with an OpenAI Agents provider, then create a session for one of your users. Each session is scoped to that user, so app connections stay separate between users. Pass the session's tools to your agent.
By default a session gets meta tools that discover, authenticate and execute app tools at runtime, so you do not load hundreds of tool definitions into the model's context. Store session.session_id and reuse it with composio.use() across turns.
import { Composio } from "@composio/core";
import { OpenAIAgentsProvider } from "@composio/openai-agents";
import { Agent, run } from "@openai/agents";
const composio = new Composio({ provider: new OpenAIAgentsProvider() });
// Each session is scoped to one of your users
const session = await composio.create("user_123");
const tools = await session.tools();
const agent = new Agent({
name: "Personal Assistant",
instructions: "You are a helpful assistant. Use Composio tools to take action.",
tools,
});
const result = await run(agent, "Summarize my emails from today");
console.log(result.finalOutput);Run the Python version of the same flow
The Python SDK follows the same pattern. Create the Composio client with the provider, create a session with a user_id, call tools() and pass the result to your agent. The README uses Runner.run_sync for a synchronous run.
from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner
composio = Composio(provider=OpenAIAgentsProvider())
# Each session is scoped to one of your users
session = composio.create(user_id="user_123")
tools = session.tools()
agent = Agent(
name="Personal Assistant",
instructions="You are a helpful assistant. Use Composio tools to take action.",
tools=tools,
)
result = Runner.run_sync(starting_agent=agent, input="Summarize my emails from today")
print(result.final_output)Use the Composio CLI from your shell
The composio CLI runs Composio from your terminal and gives coding agents such as Claude Code a local tool surface. Install it with the curl command below. The installer puts composio on your PATH for future terminals, so open a new terminal and then log in.
- composio search finds tools.
- composio execute runs them.
- composio link connects accounts.
- composio run scripts workflows in TypeScript.
curl -fsSL https://composio.dev/install | sh
composio loginExpose Composio tools to MCP clients
Every session also exposes a hosted MCP endpoint. Pass mcp: true to composio.create() and point an MCP client such as Claude, Cursor or another MCP client at session.mcp.url. The README says this is an alternative to using a provider.
To restrict which toolkits, auth configs or connected accounts a session can use, read the configuring sessions page in the Composio docs at docs.composio.dev.
What people use it for
- Letting an agent summarise a user's emails from today, as in the README example.
- Scripting app workflows from a terminal with composio search, composio execute and composio link.
- Exposing a user's connected app tools to Claude or Cursor through a hosted MCP endpoint.
- Adding per-user app access to an agent built on LangChain, Vercel AI SDK or LlamaIndex using a provider adapter.
Frequently asked questions
Is Composio free and open source?
The Composio repository is licensed under MIT, and the README lists the TypeScript and Python SDKs and the CLI as packages published from it. The README does not state pricing for the hosted service, so check the Composio dashboard and docs for that.
What do I need to install Composio?
You need Node 22+ for the TypeScript SDK, Python 3.10+ for the Python SDK, and a COMPOSIO_API_KEY from the Composio dashboard. The quickstart depends on that API key.
Can I run Composio fully self-hosted?
The README's quickstart relies on a Composio API key and dashboard, so it is not presented as a fully self-hosted setup. If you need that, check the Composio docs before you commit.
Which agent frameworks does Composio support?
The README's provider table lists adapters for OpenAI Agents, Claude Agent SDK, Vercel AI SDK, LangChain, LangGraph, LlamaIndex, CrewAI, AutoGen, Mastra and others. If your framework is not listed, the README says you can build a custom provider or connect over MCP.
How is Composio different from LangChain or LlamaIndex?
LangChain and LlamaIndex are agent and retrieval frameworks. Composio is an SDK for giving agents access to third-party apps, and it provides adapters for frameworks including LangChain and LlamaIndex. The two can be used together.
Why does my session not show the tools I expect?
The README says a session can be restricted to specific toolkits, auth configs and connected accounts, and it points to the configuring sessions page in the Composio docs. Check those settings and confirm the user has connected the app.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Composio suits developers who are building AI agents that need to read or act in third-party apps, especially if they already use a supported framework such as OpenAI Agents, LangChain or Vercel AI SDK. It is a poor fit for non-developers wanting a finished app, or for teams that need a fully self-hosted setup, since the quickstart depends on a Composio API key and dashboard.
Install options & downloads