This guide walks you through adding Task Orchestrator to your Claude Code setup. No complex hooks required - the MCP server works standalone.
- Python 3.10 or higher
- Claude Code CLI installed
- At least one LLM API key:
GOOGLE_API_KEY- Gemini (Recommended: Free tier available)OPENAI_API_KEY- GPT-4o, GPT-4o-mini (alternative)
# 1. Clone the repository
git clone https://github.com/TC407-api/task-orchestrator.git
# 2. Install dependencies
cd task-orchestrator && pip install -r requirements.txt
# 3. Configure environment
cp .env.example .env.local
# Edit .env.local and add your API keys (see below)
# 4. Add to Claude Code
claude mcp add task-orchestrator python mcp_server.pygit clone https://github.com/TC407-api/task-orchestrator.git
cd task-orchestrator
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt# Create local config from template
cp .env.example .env.localEdit .env.local and add your keys:
# REQUIRED: Generate a JWT secret
# Run: python -c "import secrets; print(secrets.token_hex(32))"
JWT_SECRET_KEY=your-generated-secret-here
# REQUIRED: At least ONE LLM provider key
# Option A: Gemini (Recommended - has free tier)
GOOGLE_API_KEY=your-gemini-api-key
# Option B: OpenAI (alternative)
OPENAI_API_KEY=your-openai-api-key
# OPTIONAL: Langfuse for observability
# LANGFUSE_PUBLIC_KEY=your-key
# LANGFUSE_SECRET_KEY=your-keyGetting API Keys:
- Gemini: https://aistudio.google.com/apikey (free tier available)
- OpenAI: https://platform.openai.com/api-keys
Option A: Using CLI (Recommended)
# Run from the task-orchestrator directory
claude mcp add task-orchestrator python mcp_server.pyOption B: Manual Configuration
Add to your Claude Code MCP configuration file:
{
"mcpServers": {
"task-orchestrator": {
"command": "python",
"args": ["/absolute/path/to/task-orchestrator/mcp_server.py"],
"env": {
"PYTHONPATH": "/absolute/path/to/task-orchestrator"
}
}
}
}Restart Claude Code, then test these commands:
# Check if the server is responding
mcp__task-orchestrator__healing_status
# Check immune system
mcp__task-orchestrator__immune_status
Or run the verification script:
python scripts/verify_install.pyOnce installed, you'll have access to these MCP tools:
| Tool | Description |
|---|---|
spawn_agent |
Spawn an AI agent safely |
spawn_parallel_agents |
Run multiple agents concurrently |
tasks_list |
List tasks by priority |
tasks_add |
Create a new task |
healing_status |
Check self-healing system |
request_tool |
Load additional tool categories |
| Tool | Description |
|---|---|
immune_status |
Check immune system health |
immune_check |
Pre-check a prompt for risks |
immune_failures |
List recent failure patterns |
immune_dashboard |
View health metrics |
| Tool | Description |
|---|---|
cost_summary |
View API costs |
cost_set_budget |
Set daily/monthly limits |
| Tool | Description |
|---|---|
inbox_status |
View pending approvals |
approve_action |
Approve or reject actions |
Task Orchestrator supports multiple LLM providers. The ModelRouter automatically selects the best model based on task type:
| Task Type | Default Provider | Model |
|---|---|---|
| Fast tasks | Gemini | gemini-2.5-flash |
| Complex reasoning | Gemini | gemini-3-pro-preview |
| Code generation | Gemini | gemini-3-flash-preview |
| Fallback | OpenAI | gpt-4o-mini |
To use a specific provider:
# The spawn_agent tool accepts a model parameter
mcp__task-orchestrator__spawn_agent(
prompt="Your task here",
model="gemini-3-flash-preview" # or "gpt-4o"
)Ensure PYTHONPATH is set correctly in your MCP config:
{
"env": {
"PYTHONPATH": "/absolute/path/to/task-orchestrator"
}
}- Check that
.env.localexists and has your keys - Verify the file is in the project root directory
- Make sure there are no typos in key names
- Check if Python is available:
python --version - Test the server directly:
python mcp_server.py - Check for import errors in the output
Task Orchestrator includes dynamic tool loading to reduce context usage:
# Load only the tools you need
mcp__task-orchestrator__request_tool(
category="immune",
reason="Need to check health"
)For production tracing, add Langfuse credentials to .env.local:
LANGFUSE_HOST=https://cloud.langfuse.com # or your self-hosted URL
LANGFUSE_PUBLIC_KEY=pk-...
LANGFUSE_SECRET_KEY=sk-...Task Orchestrator works without hooks, but advanced users can add:
- Pre/post verification hooks
- Automatic cost tracking
- Custom approval workflows
See examples/hooks/ for examples.