The Problem

Developers building AI agents must manually stitch dozens of third‑party APIs, write boilerplate request code, and keep authentication in sync. The effort multiplies when the same integrations are needed across TypeScript and Python projects, leading to duplicated logic and fragile maintenance.

What This Does

The repo ships two first‑party SDKs ( /ts and /python ) that expose 100+ curated integrations through a single client object.

  • The TypeScript entry lives in ts/packages/core/src/composio.ts (exported via ts/packages/core/src/index.ts). It builds an HTTP wrapper around the Composio backend and returns typed tool objects.
  • The Python counterpart starts in python/composio/__init__.py (generated from python/composio/core/models/tools.py). It mirrors the same methods (tools.get, tools.run) with async support.

Both SDKs are generated from the OpenAPI spec pulled by the Fern generator (fern/generators/tool_doc_generator/main.py). The spec lives in fern/openapi/ (not listed) and is refreshed via the pnpm api:pull script described in the README.

How It Is Wired

  1. Runtime start – A consumer imports Composio from @composio/core (TS) or composio (Python).
  2. Client construction – ts/packages/core/src/composio.ts creates a BaseClient that holds the API key and optional provider (e.g., OpenAI Agents). The same pattern exists in python/composio/core/client.py.
  3. Tool request – client.tools.get(userId, options) calls src/api/tools.ts (TS) or python/composio/core/endpoints/tools.py. These modules issue a single GET /tools request to the Composio service.
  4. Response handling – The JSON payload is parsed into strongly‑typed classes defined in ts/packages/core/src/types/tool.types.ts and python/composio/core/models/tools.py. These files are among the hub modules: ts/packages/ts-builders/src/Writer has 41 inbound imports, and the core type files are referenced by dozens of other modules, giving them a large blast radius.
  5. Export – The populated tool objects are returned to the caller, who can pass them to an LLM agent (e.g., OpenAIAgentsProvider).

The internal import graph contains 859 modules and 911 edges, with 37 circular dependencies. The most connected module (ts/packages/ts-builders/src/Writer) sits in a cycle, meaning any change there risks widespread breakage.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/composio
cd composio

# Install TypeScript SDK (pnpm is the lockfile manager)
pnpm install   # installs root dev deps and docs/ deps
pnpm add @composio/core   # or use the published package

# Install Python SDK
python -m venv .venv && source .venv/bin/activate
pip install composio   # pulls from PyPI; the repo contains the source for reference

Configuration – Both SDKs read the API key from the client constructor; no external config file is required. Example in docs/components/quickstart/index.tsx shows a minimal new Composio({}) call.

Running a quick test – In TS:

import { Composio } from '@composio/core';
const c = new Composio({ apiKey: process.env.COMPOSIO_KEY });
c.tools.get('user@example.com', { toolkits: ['HACKERNEWS'] })
  .then(console.log);

In Python:

from composio import Composio
c = Composio(api_key=os.getenv("COMPOSIO_KEY"))
tools = c.tools.get(user_id="user@example.com", toolkits=["HACKERNEWS"])
print(tools)

Real‑World Use

A SaaS platform that auto‑generates market‑research reports can instantiate Composio inside an OpenAI‑driven agent. The agent calls tools.get to fetch the latest news via the HACKERNEWS toolkit, then aggregates the data into a structured summary returned to the end user—all without writing any HTTP client code.

Code Health & Issues

Measured findings (static analysis)

  • HIGH – Import cycles – 29 files (e.g., ts/packages/ts-builders/src/Writer.ts) participate in circular imports. Break cycles by extracting shared types.
  • HIGH – Hub module – ts/packages/ts-builders/src/Writer is depended on by 41 modules; keep it stable.
  • MEDIUM – Oversized files – ts/packages/core/src/models/Tools.ts (647 lines) and its Python analogue are hard to maintain; split by responsibility.
  • MEDIUM – High branching density – ts/packages/json-schema-to-zod/src/parsers/parse-schema.ts has 51 branches over 147 lines; consider strategy dispatch.
  • HIGH – Deep nesting – python/composio/core/models/tools.py reaches 8 levels of indentation; flatten with guard clauses.
  • HIGH – Duplicated code blocks – Repeated 6‑line snippets across ~200 UI pages (docs/app/.../page.tsx); extract to shared helpers.

Health audit (CI/CD & ops)

  • CRITICAL – .github/workflows/publish_docs.yml uses permissions: write-all. Limit to required scopes.
  • HIGH – All GitHub Actions reference tags (e.g., softprops/action-gh-release@v2). Pin to commit SHAs.
  • MEDIUM – No explicit permissions in cli.test-installation.yml; add least‑privilege token scopes.
  • MEDIUM – Dockerfile base image debian:bookworm-slim is unpinned; use a digest.
  • MEDIUM – No dependency‑vulnerability scan in CI; add dependency-review-action or osv-scanner.
  • MEDIUM – Large dataset docs/public/data/toolkits.json (6.9 MiB) should be stored via Git LFS or external storage.
  • MEDIUM – checkout step keeps credentials; set persist-credentials: false.
  • MEDIUM – Container runs as root; add a non‑root USER.
  • MEDIUM – preinstall script in package.json runs unreviewed code; disable scripts in CI or move logic to explicit build steps.
  • LOW – Workflow jobs lack timeout-minutes; define realistic limits.

The Bottom Line

Composio delivers a well‑documented, dual‑language SDK that dramatically reduces the boilerplate for integrating third‑party services into LLM agents. The codebase is functional but suffers from import cycles, large hub modules, and several operational security hardening gaps that should be addressed before using it in a production‑critical environment. Teams comfortable fixing structural issues and tightening CI/CD policies will find it a solid foundation for agentic tooling.