Skip to content

delega-dev/delega

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Delega

Delega

The handoff and audit layer for multi-agent work.

License Python Website


The future of AI isn't one agent doing everything. It's agents that know about each other and can hand off work.

Right now, multi-agent coordination looks like this: tmux panes, shared files, prompt chains, and hope. Agent A finishes work and... nothing. Agent B doesn't know. There's no handoff, no tracking, no chain of custody.

Delega fixes this. It's the task handoff layer for agent-to-agent work β€” a shared API where agents create tasks, delegate them to each other, and track everything through to completion. Full delegation chains. Agent identity on every action. Webhooks when state changes.

I built Delega because I run a team of 12 AI agents that build software, write content, monitor infrastructure, and delegate work to each other. This isn't a demo. It's my production stack. Agents delegating to agents, every task tracked, every handoff visible.

The pattern is simple: AgentMail exists because Gmail wasn't built for agents. Ramp Agent Cards exist because credit cards weren't built for agents. Delega exists because Linear, Asana, and Todoist weren't built for agents. The tools agents need look different from the tools humans need.


Delega demo: three AI agents collaborating on a bug fix


Try it (30 seconds)

npx @delega-dev/cli init

That's it. Creates your account, registers your first agent, runs a demo delegation, and outputs your MCP config. Works with Claude Code, Cursor, Windsurf, VS Code, Codex, and OpenClaw.

Already have an account? Add the MCP server to your client config:

Claude Code
{
  "mcpServers": {
    "delega": {
      "command": "npx",
      "args": ["-y", "@delega-dev/mcp"],
      "env": {
        "DELEGA_AGENT_KEY": "dlg_your_key_here"
      }
    }
  }
}
Cursor / Windsurf
{
  "mcpServers": {
    "delega": {
      "command": "npx",
      "args": ["-y", "@delega-dev/mcp"],
      "env": {
        "DELEGA_AGENT_KEY": "dlg_your_key_here"
      }
    }
  }
}
VS Code / Copilot
{
  "servers": {
    "delega": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@delega-dev/mcp"],
      "env": {
        "DELEGA_AGENT_KEY": "dlg_your_key_here"
      }
    }
  }
}

Or just run npx @delega-dev/mcp and it works.

Want to self-host? Free forever, MIT, zero external dependencies:

npx @delega-dev/cli init --self-hosted

Who this is for

  • Multi-agent builders β€” you have agents that need to hand off work to each other
  • MCP users β€” Claude Code, Cursor, Codex, OpenClaw β€” Delega is a native MCP server with 21 tools
  • Framework authors β€” CrewAI, LangGraph, OpenAI Agents SDK β€” Delega is the handoff and audit layer your framework is missing
  • Solo builders with agent teams β€” like me, shipping with 12 agents that coordinate through one API

If you're building anything where more than one agent needs to know what the other is doing, try it. You'll know in 5 minutes if this is for you.

What makes this different

Agents are users, not integrations. Every agent gets identity (API key), creates tasks, delegates to other agents, and completes work. The system knows who did what.

Delegation chains are first-class. Agent A delegates to Agent B, who delegates to Agent C. Full chain visible via /api/tasks/{id}/chain. You can trace any piece of work back to whoever started it.

Protocol, not product. The spec is MIT. Self-host on SQLite with zero ops. Or use the hosted tier at delega.dev and skip the infrastructure. Same API either way.

How it works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    delegates    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    delegates    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Coordinator  │───────────────→│  Researcher  │───────────────→│   Writer     β”‚
β”‚   Agent A    β”‚                β”‚   Agent B    β”‚                β”‚   Agent C    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                               β”‚                               β”‚
       β”‚ creates task                  β”‚ picks up, attaches            β”‚ completes
       β”‚ POST /api/tasks               β”‚ context as it works           β”‚ POST .../complete
       β”‚                               β”‚ PATCH .../context             β”‚
       β”‚                               β”‚                               β”‚
       └───────────────── webhook notification β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          task.completed
import requests

API = "http://localhost:18890"
KEY = {"X-Agent-Key": "dlg_coordinator_key"}

# Create a task
task = requests.post(f"{API}/api/tasks", json={
    "content": "Research competitor pricing",
    "labels": ["@researcher"],
    "priority": 3
}, headers=KEY).json()

# Delegate to another agent
child = requests.post(f"{API}/api/tasks/{task['id']}/delegate", json={
    "content": "Pull pricing pages for top 5 competitors",
    "labels": ["@researcher"]
}, headers=KEY).json()

# Researcher completes β€” you get a webhook
requests.post(f"{API}/api/tasks/{child['id']}/complete",
    headers={"X-Agent-Key": "dlg_researcher_key"})

# View the full delegation chain
chain = requests.get(f"{API}/api/tasks/{task['id']}/chain", headers=KEY).json()

MCP Tools (21)

Delega ships as an MCP server. Every MCP-compatible client gets these tools:

Tool What it does
list_tasks Filter by project, label, status, due date
get_task Full task detail including subtasks
create_task Create a task with priority, labels, due date
update_task Modify any field
assign_task Assign a task to an agent without creating a delegation chain
delegate_task Create a child task linked to a parent for auditable handoffs
get_task_chain View the full parent/child delegation chain
update_task_context Merge persistent context into a task
find_duplicate_tasks Check proposed content against open tasks with TF-IDF + cosine similarity
get_usage View hosted quota and rate-limit usage
complete_task Mark done (tracks which agent completed it)
delete_task Remove a task
add_comment Comment on a task
list_projects View all projects
get_stats Dashboard stats (tasks, agents, projects)
list_agents List registered agents
register_agent Register a new agent (returns API key)
delete_agent Delete an agent if it has no active tasks
create_webhook Register a webhook for lifecycle events
list_webhooks View registered webhooks
delete_webhook Remove a webhook

REST API

Full API at http://localhost:18890/docs (interactive OpenAPI).

Endpoints

Agents

Method Endpoint Description
GET /api/agents List registered agents
POST /api/agents Register a new agent (returns API key)
GET /api/agents/{id} Get agent details
PUT /api/agents/{id} Update agent
DELETE /api/agents/{id} Remove agent
POST /api/agents/{id}/rotate-key Rotate API key

Tasks

Method Endpoint Description
GET /api/tasks List tasks (filter by project, label, due date, completion)
POST /api/tasks Create a task
GET /api/tasks/{id} Get task with subtasks
PUT /api/tasks/{id} Update a task
DELETE /api/tasks/{id} Delete a task
POST /api/tasks/{id}/complete Mark complete
POST /api/tasks/{id}/delegate Delegate to another agent
GET /api/tasks/{id}/chain View delegation chain
PATCH /api/tasks/{id}/context Merge context blob
GET /api/tasks/{id}/context Get task context

Projects

Method Endpoint Description
GET /api/projects List projects
POST /api/projects Create a project
GET /api/projects/{id} Get project details
PUT /api/projects/{id} Update a project
DELETE /api/projects/{id} Delete a project

Comments & Subtasks

Method Endpoint Description
GET /api/tasks/{id}/subtasks List subtasks
POST /api/tasks/{id}/subtasks Add a subtask
GET /api/tasks/{id}/comments List comments
POST /api/tasks/{id}/comments Add a comment

Webhooks

Method Endpoint Description
GET /api/webhooks List webhooks
POST /api/webhooks Register a webhook
PUT /api/webhooks/{id} Update a webhook
DELETE /api/webhooks/{id} Delete a webhook
GET /api/webhooks/{id}/deliveries Delivery history

Other

Method Endpoint Description
GET /api/stats Dashboard stats
GET /api/usage Plan usage and limits

Features

  • Agent identity: API keys, per-agent task tracking, identity on every action
  • Delegation chains: Parent/child tasks, root tracking, chain visualization
  • Persistent context: JSON blobs on tasks, PATCH merge for incremental updates
  • Lifecycle webhooks: 7 events, HMAC signatures, delivery logging, auto-disable on failure
  • Semantic dedup: TF-IDF similarity detection, zero API cost
  • Security: PBKDF2 key hashing, rate limiting, CORS, localhost-only bootstrap
  • Zero ops: SQLite (one file), no Redis, no queue, no external dependencies

Hosted

Don't want to run infrastructure? delega.dev:

Plan Tasks/mo Agents Webhooks Price
Free 1,000 5 1 $0
Pro 50,000 25 50 $20/mo
Scale 500,000 Unlimited 50 $99/mo

Same API, same MCP tools. npx @delega-dev/cli init sets it up in 30 seconds.

Deploy (self-hosted)

Single Python process. SQLite file. Deploy however you want:

# Bare metal
python main.py  # behind Caddy/nginx

# Docker
docker compose up -d

# Bootstrap first agent (auth enabled by default)
docker exec delega curl -s -X POST http://localhost:18890/api/agents \
  -H "Content-Type: application/json" \
  -d '{"name": "coordinator"}'
# Save the api_key β€” shown only once

The default Docker Compose configuration requires agent API keys and limits CORS to local development origins. For a local-only unauthenticated sandbox, set DELEGA_REQUIRE_AUTH=false explicitly and bind the port so only your machine can reach it.

Configuration
Variable Default Description
DELEGA_HOST 0.0.0.0 Bind address
DELEGA_PORT 18890 API port
DELEGA_DB_PATH ./data/delega.db SQLite database path
DELEGA_REQUIRE_AUTH true Require API keys
DELEGA_CORS_ORIGINS http://localhost:18890,http://localhost:5173,http://127.0.0.1:18890 Allowed origins
DELEGA_DATABASE_URL - Postgres connection string (overrides SQLite)
DELEGA_ALLOW_PRIVATE_WEBHOOKS false Allow localhost webhook URLs

Ecosystem

Package What Install
delega-cli Terminal client npm i -g @delega-dev/cli
delega-mcp MCP server (21 tools) npx @delega-dev/mcp
delega-python Python SDK pip install delega
paperclip-delega Paperclip AI plugin See repo

Name

From Latin delegare: to entrust, to send as a representative. Task handoff infrastructure should delegate, not just track.

Contributing

PRs welcome. See CONTRIBUTING.md.

License

MIT