Skip to content

ComposioHQ/tool-router-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Tool Router Agents

A collection of AI agents built with Composio's Tool Router, available in both Python and TypeScript/JavaScript.

🎯 What is Tool Router?

Composio's Tool Router is an experimental feature that provides AI agents access to 500+ integrated apps through the Model Context Protocol (MCP). It automatically discovers, authenticates, and executes the right tools for any task—from finding relevant tools across integrations to managing authentication and parallel execution.

Learn more about Tool Router →

🚀 Quick Start

Prerequisites

Installation

Python:

cd python
uv sync  # or: pip install -r requirements.txt

JavaScript:

cd js
npm install

Configuration

Create a .env file in the respective directory (python/ or js/):

COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_email@example.com

🤖 Available Agents

Agent Description Python JavaScript
Content Generator Creates social media content with AI videos python agents/content_generator.py npm run content-generator
Customer Service Helps with Composio docs and integration queries python agents/customer_service_agent.py npm run customer-service
Developer Autonomous coding agent that opens PRs python agents/developer_agent.py npm run developer
Twitter Lead Gen Extracts and enriches Twitter leads python agents/twitter_lead_gen_agent.py npm run twitter-lead-gen
Deep Research Researches topics and creates detailed reports in Google Docs python agents/deep_research_agent.py npm run deep-research
Fullstack Developer Builds fullstack apps with Supabase + Next.js and deploys on Vercel python agents/fullstack_developer_agent.py npm run fullstack-dev

💻 Usage

Python Example

from claude_agent_sdk import query, ClaudeAgentOptions
from composio import Composio
from dotenv import load_dotenv

load_dotenv()

composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
session = composio.experimental.tool_router.create_session(
    user_id=os.getenv("USER_ID")
)

options = ClaudeAgentOptions(
    system_prompt="Your agent instructions",
    permission_mode='bypassPermissions',
    mcp_servers={"tool-router": {'type': 'http', 'url': session.get('url')}}
)

async for message in query(prompt="Your task", options=options):
    print(message)

TypeScript Example

import { query } from '@anthropic-ai/claude-agent-sdk';
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });
const session = await composio.experimental.toolRouter.createSession(
  process.env.USER_ID!
);

for await (const message of query({
  prompt: "Your task",
  options: {
    systemPrompt: "Your agent instructions",
    permissionMode: 'bypassPermissions',
    mcpServers: { 'tool-router': { type: 'http', url: session.url } }
  }
})) {
  console.log(message);
}

🔧 Tool Router Features

The Tool Router exposes six meta tools through MCP:

  • COMPOSIO_SEARCH_TOOLS - Discover tools across 500+ apps
  • COMPOSIO_GENERATE_PLAN - Create step-by-step execution plans
  • COMPOSIO_CREATE_CONNECTION - Manage app authentication
  • COMPOSIO_EXECUTE_TOOLS - Run up to 20 tools in parallel
  • COMPOSIO_PYTHON_SANDBOX - Execute Python code in a sandbox
  • COMPOSIO_BASH - Run bash commands in a remote sandbox

Restricting Toolkits

Limit which apps agents can access:

# Python
session = composio.experimental.tool_router.create_session(
    user_id="user@example.com",
    toolkits=["github", "slack", "notion"]
)
// TypeScript
const session = await composio.experimental.toolRouter.createSession(
  "user@example.com",
  { toolkits: ["github", "slack", "notion"] }
);

📁 Project Structure

tool-router-agents/
├── python/                  # Python agents
│   ├── agents/             # Agent implementations
│   │   └── utils/          # Message formatter
│   └── pyproject.toml
└── js/                     # TypeScript/JavaScript agents
    ├── agents/             # Agent implementations
    │   └── utils/          # Message formatter
    ├── package.json
    └── tsconfig.json

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📚 Resources & References

Composio

Claude Agent SDK

Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published