Registry / llm-agents / composio-crewai

composio-crewai

JSON →
library0.13.1pypypiunverified

Composio-crewai is a Python library that integrates Composio's extensive array of tools with CrewAI agents. It allows AI agents to connect to over 250 external services and applications, providing enterprise-grade authentication, full observability, and a streamlined way to empower AI workflows with real-world actions. The current version is 0.11.5, and the project demonstrates a rapid release cadence with frequent updates across the core Composio ecosystem.

pip install composio composio-crewai crewai crewai-tools[mcp] python-dotenv
INSTALL
IMPORT
SIG · COMPOSIO-CREWAI
C
composio-crewai
llm-agentspythonv0.13.1
Install
40.6s avg
Import
5209ms
Disk
905MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 49.48s
py 3.11
✕ build_error
✓ 42.55s
py 3.12
✕ build_error
✓ 35.15s
py 3.13
✕ build_error
✓ 35.33s
py 3.9
✕ build_error
✕ build_error
905MB installed
● package 905MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Composio
from composio import Composio
CrewAIProvider
from composio_crewai import CrewAIProvider
This provider adapts Composio tools for CrewAI's native tool format.
Agent
from crewai import Agent
Task
from crewai import Task
Crew
from crewai import Crew
MCPServerHTTP
from crewai.mcp import MCPServerHTTP
Used for Model Context Protocol integration, common in Composio-CrewAI examples.

This quickstart demonstrates how to set up a CrewAI agent with Composio tools using the Model Context Protocol (MCP). It initializes Composio, creates a session for a user, and then exposes Composio's tools to a CrewAI agent via an `MCPServerHTTP` instance. The agent is then given a task to use these tools. Ensure `COMPOSIO_API_KEY`, `COMPOSIO_USER_ID`, and `OPENAI_API_KEY` are set as environment variables. You must also authorize the desired toolkits (e.g., 'gmail', 'github') within your Composio dashboard or via the CLI for them to be available to the agent.

import os from crewai import Agent, Task, Crew from crewai.mcp import MCPServerHTTP from composio import Composio from dotenv import load_dotenv load_dotenv() # Load environment variables from .env file COMPOSIO_API_KEY = os.environ.get('COMPOSIO_API_KEY', '') COMPOSIO_USER_ID = os.environ.get('COMPOSIO_USER_ID', '') OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY', '') if not COMPOSIO_API_KEY: raise ValueError("COMPOSIO_API_KEY environment variable not set.") if not COMPOSIO_USER_ID: raise ValueError("COMPOSIO_USER_ID environment variable not set.") if not OPENAI_API_KEY: raise ValueError("OPENAI_API_KEY environment variable not set.") # Initialize Composio client and create a session composio_client = Composio(api_key=COMPOSIO_API_KEY) # Specify the toolkits your agent needs access to (e.g., 'gmail', 'github', 'composio') # Ensure these toolkits are authenticated in your Composio dashboard. session = composio_client.create(user_id=COMPOSIO_USER_ID, toolkits=['composio']) # Create an MCPServerHTTP instance from the Composio session mcp_server = MCPServerHTTP( url=session.mcp.url, headers=session.mcp.headers, ) # Define the agent with Composio MCP tools researcher = Agent( role="Research Analyst", goal="Gather and summarize information using available tools.", backstory="An expert at finding and synthesizing information from various sources.", verbose=True, allow_delegation=False, llm=os.environ.get('OPENAI_MODEL_NAME', 'gpt-4o-mini'), # Use an LLM, e.g., OpenAI's mcps=[mcp_server] ) # Define a task that leverages Composio tools (e.g., 'composio' toolkit offers general Composio actions) task = Task( description="List all available toolkits connected to Composio and summarize their purpose.", expected_output="A concise list of all connected Composio toolkits and a one-sentence summary for each.", agent=researcher ) # Create and run the Crew crew = Crew(agents=[researcher], tasks=[task], verbose=True) result = crew.kickoff() print("\n\n------------------------") print("Crew Work Results:") print(result)
Debug
Known issues
breakingComposio utilizes the Model Context Protocol (MCP) for tool integration. Older, non-MCP based integration patterns might be deprecated or require a different setup. Always refer to the latest Composio and CrewAI documentation for the recommended integration method.
fix
Migrate to the MCP-based integration using `crewai.mcp.MCPServerHTTP` as shown in current quickstart examples. Ensure `crewai-tools[mcp]` is installed.
affects: <0.11.0 (earlier versions may use different patterns)
gotchaAuthentication to individual service providers (e.g., Gmail, GitHub, Neon) connected via Composio is separate from authenticating to the Composio platform itself. You need to link your accounts within the Composio dashboard or via the `composio add <toolkit>` CLI command.
fix
After setting `COMPOSIO_API_KEY`, log into your Composio dashboard and connect the specific third-party accounts (e.g., Gmail, GitHub) your agents will use. Alternatively, use `composio add <toolkit>` via the Composio CLI.
affects: All versions
gotchaThe `COMPOSIO_USER_ID` environment variable is crucial for scoping the Composio session and correctly identifying the user for whom tools are being provided. Without it, Composio might not be able to retrieve or manage tools for the session.
fix
Ensure `COMPOSIO_USER_ID` is consistently set and passed to `composio_client.create(user_id=...)`. This ID should ideally be a stable identifier for your user.
affects: All versions
gotchaCrewAI's `Agent` class requires an `llm` parameter. If not explicitly provided, it might default to a non-existent or unsupported LLM, leading to errors. Additionally, using `gpt-4o-mini` or similar models requires `OPENAI_API_KEY` to be set.
fix
Always provide an `llm` argument to your `Agent` instances, typically by importing and configuring an LLM from `langchain_openai` (e.g., `ChatOpenAI`) or passing the model name if using OpenAI directly. Ensure the relevant API key (e.g., `OPENAI_API_KEY`) is set.
affects: All versions
Upgrade
Version history
0.13.1latest on PyPI · released May 14, 2026
Audit
Dependencies
composiorequiredCore Composio SDK for tool management and API interaction.
crewairequiredThe multi-agent framework to which Composio tools are integrated.
crewai-toolsoptionalProvides MCP (Model Context Protocol) helpers for CrewAI, often used with Composio's MCP server.
python-dotenvoptionalUtility for loading environment variables from .env files, commonly used for API keys.
Agent activity
42 hits · last 30 days
node
36
OpenAI (training)
1
Resources
composio-crewai — pip install composio-crewai · libregistry