claude-worker-delegation
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-worker-delegation Summarize the errors in debug.log and save the report to summary.md"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-worker-delegation
An MCP server that turns Claude Code into an architect that hands bulk work to cheap worker models on OpenRouter.
Premium models are great at planning and review, but paying premium rates for them to read a 300 KB log or write boilerplate is wasteful. This server gives Claude Code three tools that offload that work. The big file contents go straight from disk to the worker model, so they never enter Claude's context.
┌──────────────────────────┐
you ──────▶│ Claude Code (architect) │ plans, decides, reviews, runs commands
└────────────┬─────────────┘
│ MCP (stdio)
┌────────────▼─────────────┐
│ workers MCP server │ tiers · budget cap · path sandbox · cost log
└────────────┬─────────────┘
│ OpenRouter API
┌──────────┬────────┴──┬────────────┐
▼ ▼ ▼ ▼
fast code reason long
(summaries) (diffs/tests) (2nd opinion) (1M-token files)Tools
Tool | What it does |
| Run one task on a worker tier. Pass |
| Run several independent jobs in parallel (concurrency set in config). |
| Token and cost totals for today and all time, broken down by tier. |
Related MCP server: claude-openrouter-delegate-mcp
Features
Tiered models in
models.json:fast,code,reason, andlong. Each tier has a description the architect uses to pick one.Daily budget cap. Calls are refused once the day's spend reaches
daily_budget_usd.Cost logging. Every call is appended to
usage.jsonlwith its tokens, dollar cost, and latency.Path sandbox. Workers can only read and write files under the session's working directory, plus any extra roots set in
WORKERS_ALLOWED_ROOTS.Guard-railed worker prompt. Workers are told to answer tersely, return unified diffs for code, and never invent file contents they weren't shown.
Provider settings. OpenRouter routing sorts by price, allows fallbacks, and denies data collection.
Large-read hook (
hooks/delegate-large-reads.js). A Claude CodePreToolUsehook that blocks whole-file reads over 50 KB, whether throughRead,cat, orGet-Content, and points Claude todelegateinstead.
Real usage
The first 12 calls cost $0.09 total, and three of them fed about 363K input tokens of logs and files to the long tier. All of that input would otherwise have gone through the premium model's context.
Setup
npm install
export OPENROUTER_API_KEY=sk-or-... # Windows: setx OPENROUTER_API_KEY "sk-or-..."
claude mcp add workers -- node /path/to/claude-worker-delegation/server.jsThen:
Add the rules in
examples/CLAUDE.mdto your~/.claude/CLAUDE.mdso Claude knows what to delegate.Optionally add the hook and permissions from
examples/settings.jsonto~/.claude/settings.json.Run
npm run smoketo check that the tools, every tier, and the path sandbox all work.
Config (models.json)
"tiers": {
"fast": { "model": "deepseek/deepseek-v4-flash", "use": "summaries, extraction, boilerplate" },
"code": { "model": "qwen/qwen3-coder-next", "use": "code, tests, diffs" },
"reason": { "model": "deepseek/deepseek-v4-pro", "use": "debugging, second-opinion reviews" },
"long": { "model": "google/gemini-3.1-flash-lite", "use": "very large files (1M context)" }
},
"daily_budget_usd": 3.0,
"concurrency": 4To change models, edit this file. You don't need to change any code.
Stack
Node.js · Model Context Protocol SDK · zod · OpenRouter API · Claude Code hooks
License
MIT
Available Tools
3 toolsdelegateA
Hand a self-contained subtask to a cheap worker model (OpenRouter). Use for bulk reading/summarizing, boilerplate, tests, mechanical edits as diffs, first drafts, or a second opinion. Review the result before acting on it.
Inputs: task (required), tier, files, write_to, +1 more.
delegate_batchA
Run several independent worker jobs in parallel. Returns one result block per job.
Inputs: jobs (required).
worker_statsA
Worker token/cost totals: today and all-time, by tier.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
worker_stats is clearly a metrics-only tool, while delegate and delegate_batch are distinguished by single vs. parallel execution. There is no meaningful overlap between the tools.
delegate and delegate_batch share a clear prefix and action-oriented style, but worker_stats breaks the pattern by using a noun-based name. The inconsistency is minor given the small tool count.
Three tools is appropriate for a focused worker-delegation server. Each tool serves a distinct purpose without unnecessary redundancy.
The core delegation workflow is fully covered: single delegation, batch delegation, and usage statistics. Since results are returned directly, no additional retrieval or status tools appear necessary.
Related MCP Connectors
AI coding plan limits (Claude Code, Codex, Cursor, Copilot): router, picker, status, budget check
Route, roster, and track work in a Fivexer workspace from Claude Code and other agentic tools
Multi-agent coordination outside your LLM context: dedupe parallel work, per-agent budgets, handoff
Token guard and rate limiter preventing runaway API cost spikes for OpenAI and Anthropic.
Related MCP Servers
- AlicenseCqualityBmaintenanceRoutes coding tasks across multiple AI CLIs (Copilot, Claude Code, Gemini, etc.) with cost-aware tier routing and parallel wave orchestration.552Apache 2.0
- AlicenseAqualityDmaintenanceLets Claude Code delegate tasks to OpenRouter-backed Claude Code sessions in isolated child processes, keeping Anthropic and OpenRouter credentials separate. It adds a model catalog, per-job cost tracking, and API-key management for running tasks on 400+ OpenRouter models.730 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate tasks to free OpenRouter models as callable tools while keeping the Anthropic endpoint for the orchestrator, with optional sandboxed file and shell access.MIT
- AlicenseAqualityCmaintenanceEnables Claude Code to offload small coding tasks to local Ollama machines and free or paid AI providers, choosing the cheapest available option while enforcing quotas, budgets, and Claude's final review.11MIT