Composio

repository·next·Indexed 12 days ago

https://github.com/ComposioHQ/composio

Composio provides AI agents with over 1000 pre-authenticated toolkits, per-user sessions, and authentication management, acting as a bridge between LLMs and various applications to turn intent into real-world actions. Version 0.10.0-alpha.1 includes support for the Claude Messages API via AnthropicProvider and Model Context Protocol (MCP) functionality.

Tokens
479.5K
Snippets
1.4K
Records
2.1K
Agent score
98%

What's inside Composio

  1. Overview of Composio TypeScript packages

    next

    The Composio TypeScript workspace consists of several specialized packages:

    • @composio/core: The primary SDK. It includes TypeScript source and SDK documentation, making it inspectable by AI coding agents.
    • @composio/slim: A lightweight version of the SDK with the same API as @composio/core but without the packaged source and docs.
    • composio CLI: A standalone binary for searching, executing, and scripting tools directly from your terminal.
    • @composio/* providers: Adapters designed to format Composio tools for specific agent frameworks like OpenAI, Anthropic, Vercel AI SDK, and LangChain.
    • @composio/experimental: Contains experimental integrations (e.g., the Pi provider).
    • @composio/json-schema-to-zod: A utility for converting JSON Schema to Zod.
  2. Overview of @composio/json-schema-to-effect-schema

    next

    The @composio/json-schema-to-effect-schema package provides an internal, eval-free JSON Schema validation mechanism exposed through Effect Schema.

    Key features include:

    • Eval-free validation: Uses @cfworker/json-schema, making it suitable for runtimes that prohibit dynamic code generation (such as certain edge worker environments).
    • Schema Normalization: It normalizes OpenAPI and Composio schema extensions that were previously handled by Zod-backed tool-input validators, ensuring compatibility with existing tool definitions.
  3. Overview of the Composio CLI

    next
    The Composio CLI is a tool for discovering and executing tools, connecting accounts, scripting workflows, and generating type stubs. It supports root workflows for searching and executing tools, as well as developer-oriented dev commands for managing projects, triggers, logs, and connected accounts.
  4. Composio REST API Overview

    next

    The Composio REST API provides endpoints for managing the full lifecycle of AI agent tool execution. Key functional areas include:

    • Tool Router: A session-based API designed for AI agents to discover and execute tools.
    • Tools: Endpoints to list, search, and execute individual tool actions.
    • Connected Accounts: Management of user OAuth connections to various third-party applications.
    • Auth Configs: Configuration of how users authenticate to specific toolkits.
    • Triggers: Webhook subscription management to receive updates from connected apps.
    • Toolkits: Browsing available applications and their associated tools.
  5. Use @composio/cli-keyring for cross-platform credential storage

    next

    The @composio/cli-keyring package provides a secure, cross-platform way to store sensitive credentials (like API keys) using OS-native credential stores (macOS Keychain or Linux Secret Service) instead of plaintext files.

    Key Features

    • Security: Prevents silent exfiltration by agents via filesystem reads. Accessing keys requires an in-process call to OS security frameworks or a visible shell command.
    • Performance: On macOS with Bun, it uses bun:ffi for extremely low-latency access (~1.4ms).
    • Cross-Platform: Supports macOS (Keychain) and Linux (Secret Service via secret-tool). Throws NoStorageAccess on Windows/BSD.
    • Interoperability: On Linux, it uses attribute keys (service, username, target) compatible with keyring-rs for discovery.
    import { Entry, createDefaultStore, setDefaultStore } from '@composio/cli-keyring';
    
    // One-time process startup:
    setDefaultStore(await createDefaultStore());
    
    // Anywhere:
    const entry = new Entry('com.composio.cli', 'default');
    await entry.setPassword(apiKey);
    const stored = await entry.getPassword();
    await entry.deleteCredential();
  6. Reference Docs and SDK CI/CD Workflows

    next

    The Composio repository utilizes various GitHub Actions workflows to maintain documentation, SDK integrity, and package releases. These workflows are categorized into Docs Workflows, SDK/Build Workflows, and Other Workflows.

    Docs Workflows

    • Update Data: Automatically fetches toolkits data and OpenAPI specs (v3.1 + v3.0) to generate API index pages. Targets the next branch.
    • Sync Connect Clients: Syncs client definitions from the dashboard to composio-connect.mdx.
    • Changelog → Docs: Automatically updates documentation pages based on new changelog entries.
    • Check Links: Validates internal links using bun run scripts/validate-links.ts.
    • Lint + TypeScript: Performs linting (oxlint), type checking, and validates Twoslash code blocks in documentation.
    • Docs Tests: Executes the documentation test suite.
    • Health Check: Monitors the availability of the live documentation site.
    • Doc Review: Allows on-demand documentation reviews via Claude Code by commenting with @claude on PRs.

    SDK/Build Workflows

    • TypeScript (TS): Includes workflows for building (ts.build.yml), testing (ts.test.yml), E2E testing across Node, Deno, and Cloudflare (ts.test-e2e.yml), type checking (ts.typecheck.yml), and releasing packages (ts.release.yml).
    • Python: Includes workflows for linting/type checking (py.check.yaml), testing (py.test.yml), and releasing packages (py.release.yml).
    • CLI: Includes workflows for building binaries (build-cli-binaries.yml) and testing the installation flow (cli.test-installation.yml).

    Other Workflows

    • Claude Code: General-purpose AI assistance for repo-wide tasks triggered by @claude in comments.
    • Security: Includes security.secrets-detection.yml to scan for accidentally committed secrets.
  7. What is a Connected Account in Composio

    next

    A connected account is a single user's authorized connection to a toolkit. It stores their credentials (such as OAuth tokens or API keys) and links them to your specific user_id, allowing your tools to act on that user's behalf.

    Connected accounts are identified by a unique nanoid. You can manage their lifecycle through several operations:

    • Create or link: Start a new connection or generate an auth link session.
    • Refresh: Renew expired authentication tokens.
    • Enable, disable, or update: Modify the account's status or metadata.
    • Revoke or delete: Remove the grant from the provider or delete the account from Composio.

    By default, accounts are PRIVATE (usable only by the owning user). You can mark an account as SHARED to allow other users to access it via a per-connection access control list (ACL).

  8. Overview of Triggers API

    next
    The Triggers API allows you to manage and subscribe to real-time events occurring in your connected accounts. You can use the Composio SDK to list active triggers, create or update trigger instances, enable/disable triggers, and subscribe to real-time event streams.
  9. What is a Composio session?

    next

    A session is the runtime context for an agentic run. It is a scoped environment that an AI agent works in while acting for a specific user. A session ties together the user's identity, available toolkits, authentication, and execution state (logs, tool memory, MCP state, and workbench files).

    By default, a session provides the agent with meta tools. These allow the agent to discover, authenticate, and execute app tools at runtime, preventing the need to load hundreds of tool definitions into the LLM context window.

  10. What is an Auth Config in Composio

    next

    An Auth Config is a blueprint that defines how a toolkit authenticates across all your users. It acts as a template for the authentication method, requested scopes, and the credentials used to execute OAuth or token flows.

    When a user authenticates using an Auth Config, Composio creates a connected account that stores that specific user's tokens and links them to your user ID.

    An Auth Config consists of three main components:

    1. Auth scheme: The method of authentication (e.g., OAuth2, API key).
    2. Scopes: The permissions your tools are allowed to request on the user's behalf.
    3. Credentials: Either Composio's managed app or your own custom OAuth client and secrets.