deputy
Connects to Ollama as a local worker model server, enabling delegation of tasks to locally served models with sandboxing, verification, structured results, and token-savings reporting.
Uses OpenAI-compatible API endpoints as worker model backends, letting an orchestrator delegate tasks to those models and receive verified results with evidence and metrics.
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., "@deputy Have a worker summarize README.md and check every claim against cited lines."
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.
deputy
Your frontier model plans and reviews. A cheaper model does the long reading and the code changes that tests can check. Code checks every result.
deputy is an MCP server that lets your coding agent (Claude Code, or any MCP client) keep its tokens for planning and review. It takes two kinds of work off the frontier model:
Code changes that tests or linters can check. A local agent makes them on your own model (llama.cpp), in a private copy of the repository, one change per short conversation, until the project's checks pass. Your agent gets a patch to review and apply.
Long reading. "Summarise this 900-line document", "what changed in the last ten commits, and why": a cheaper model (local, or any OpenAI-compatible API) reads, code proves every quoted line, and your agent reads a short answer, not the files.
Status: alpha, in daily use. It works end to end, is tested and measured on real repositories, and is used to develop a real multi-app project. Expect breaking changes. Verified with Claude Code; GitHub Copilot, Cursor and Codex are configured by the installer but not yet verified. The local agent needs Claude Code.
When it pays, and when it does not
Hand over | Do it yourself |
Code changes you can state and check: a list of small changes with their tests, removals, renames, mechanical edits across files | A change of a few lines you are waiting for: a local model takes minutes where a hosted one takes seconds |
Long reads: summaries, inventories, cross-references, facts with their lines | A change that needs analysis nobody has done yet: on a real issue the local model did the mechanical steps and not the hard one |
Big logs and test output ( | Lookups in a short file or one line (deputy flags these as |
Questions about git history ( | Searches that only list files: you would see the same list |
What was measured, with its limits, is on the evidence page. In short:
Code changes. Eight small changes to this repository (code, tests and documentation each): Claude Sonnet 5.5 alone spent about 137,000 weighted tokens in 2.5 minutes; handing them to Qwen3.8 27B in eight steps it spent 77,660, about 43 % fewer, and waited 88 minutes. Both results passed the tests, the linter, the formatter and the type checker. One run, on a laptop.
Reading. On 21 everyday tasks on two real repositories, run twice with a local 27B worker, every answer was correct, confirmed by a frontier model reading the files. Reading tasks saved about 4,800 to 5,600 frontier tokens each; lookups and searches saved about nothing.
Where your tokens really go. On one real project the large reads were at most 7 % of what the sessions spent, the subagents that edit code 43 %, and reading again a context above 200,000 tokens 38 %.
deputy discoverprints the same table for your own sessions, so you know which of the three is worth your time.
Related MCP server: DZ23 Subagents Universal MCP
Quick start
curl -LsSf https://raw.githubusercontent.com/tommasomarchionni/deputy/main/install.sh | sh
deputy init # point it at your model server
deputy doctor # check that it answers, and what the local agent can use
deputy install claude-code --apply # once: the MCP server, the skill and the hintsFor Claude Code that one command does everything, for every project: it registers the MCP server,
installs the skill that teaches the agent when to delegate (~/.claude/skills/deputy/, loaded only
when relevant, kept current by deputy on each update), and adds two hints: one line before a large
read, and a few lines with each request that send checkable code changes to the local agent, so
you do not have to ask for it (deputy hook off turns both off; code_changes = "frontier" in the
configuration leaves code changes to your agent's choice).
Codex: deputy install codex --apply keeps its guide current too. Copilot and Cursor read the
guide from files in the project: deputy install vscode|cursor --apply, then
deputy instructions --for copilot|cursor --apply in each project (deputy doctor says when a
copy needs refreshing).
The local agent needs the claude command, a git repository and a llama.cpp server whose context
holds at least 110,000 tokens (--ctx-size 131072); what else to set on the server is in
install.
deputy keeps itself current: a newer compatible release is installed when the server starts, only
after its build provenance is verified, never a new major version or a release marked as breaking
(auto_update in the configuration; notify or off to opt out).
A session that is already open keeps the version it started with until you reconnect the server
(in Claude Code: /mcp).
How it works
A code change (delegate with agent=true):
Your agent writes what the changes share in
task, one change per item ofsteps, and the project's own test and lint commands as checks. It does not read the code first.deputy copies the repository (a git worktree, with your uncommitted changes to tracked files) and runs Claude Code's own agent loop on your local model, confined to that copy: its file tools cannot leave it, and its shell has no network, cannot read your keys and writes only there. Each step gets a conversation of its own.
The checks run on the copy. Failures go back to the local agent, up to three times. A step it cannot do is undone, its draft is kept apart, and the answer names it.
Your agent waits with
deputy wait <run_id>(one turn, no polling), reads the patch, applies it withgit apply, and does only what was left.
A question about files (digest, or delegate with your own checks):
Your agent names the files and the question; deputy adds the checks (every quoted line must be in that file at that line), or you declare them: contain these facts, stay under 1,500 characters, pass this command.
The worker reads inside that folder only. It has no shell, no network and cannot read secret-looking files. Its tools:
read_file,write_file,grep,list_files, read-onlygit,summarise_log(a model-free summary of a big log) andscan_file(a file larger than the model's context, read in parts).The server runs the checks. A failing answer gets one correction round; if it still fails, the result says
needs_frontierand your agent does the task itself.
Either way the result is short: status, answer, a one-line check summary, and files or flags
only when there are any.
Commands
Command | What it does |
| write a starter configuration; check it, the backends and what the local agent can use |
| connect an agent; print or write the delegation guide |
| the Claude Code hints |
| wait for a local agent's run and print its result |
| where your agent's reading and tokens went in past Claude Code sessions, and how much a delegation could take |
| what deputy did for you: runs, pass rate, tokens saved, per kind of task |
| your model on the built-in suite, or your own tasks with |
| measure, then recommend or apply request settings that measure better |
| check for a newer release and upgrade |
Documentation
Full site: https://tommasomarchionni.github.io/deputy/ (source in docs/).
Topic | Page |
Install and connect an agent | |
Configuration, backends, routing, updates | |
The tools, the local agent, the checks and the flags | |
Security model | |
Measured results | |
Benchmark, tuning and where your tokens go | |
Design, state, local model speed | |
Roadmap | roadmap and the project board |
Works well with rtk
rtk shortens the output of shell commands your agent runs (git, test runners); deputy takes long reads and checkable code changes off your agent. They do not overlap, and measured numbers for both are on the evidence page.
Contributing
See CONTRIBUTING.md and the Code of Conduct. Report security issues privately: SECURITY.md.
License
Available Tools
5 toolscollectC
Result of a background delegation (waits 20 s); cancel=True stops it.
Inputs: run_id (required), cancel.
delegateA
Run a task on a worker in the absolute workdir, verified by checks. wait=False: then collect. agent=True: a local agent changes code in a private copy and returns a patch; one change per item of steps, what they share in task.
Inputs: task (required), workdir (required), wait, agent, +5 more. Returns: What the orchestrator reads: the answer and the verdict.
digestB
Ask about files in the absolute workdir instead of reading them: every line of the answer cites a proven file line.
Inputs: files (required), workdir (required), question (required).
feedbackC
Report whether a result was good.
Inputs: run_id (required), verdict (required), reason.
statusC
Backends and whether they answer.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool maps to a distinct role: delegate launches work, collect retrieves background results, digest interrogates files, status checks backends, feedback records quality. The only soft boundary is delegate (agent=True produces a patch) vs. digest (reads files with citations), both of which operate on `workdir` and could be confused by an agent wanting to inspect code rather than change it. Descriptions mostly resolve that edge case.
Names form a tidy set of single lowercase words with no casing or style drift. The mix of verbs (delegate, digest, collect) and nouns (status, feedback) is a minor deviation from a pure verb_noun convention but stays readable and predictable.
Five tools is a tight, well-scoped surface for a delegation/worker server. Each tool has a distinct lifecycle role (launch, retrieve, cancel, inspect, verify, health-check) with no filler.
The core loop is covered: launch a task, optionally background it, collect or cancel, verify via checks, digest files, check backend health, and give feedback. Gaps are minor but real—there is no way to enumerate or manage multiple concurrent delegations, inspect past results after collection, or list available workers/backends individually.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP gateway for teams deploying AI tools at scale to employee-facing and headless agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables multi-model leader-worker agent orchestration, workflow execution, and deterministic validation via structured MCP tools.Apache 2.0
- AlicenseAqualityBmaintenanceEnables users to delegate text and code tasks across multiple AI models with automatic failover, maintain shared mission memory and checkpoints across MCP harnesses, and coordinate parallel role-based subagents. It also supports model discovery, provider inventory, health checks, and stdio/HTTP tool access while leaving patches and tests to the harness.24MIT
- AlicenseCqualityCmaintenanceAn MCP execution layer that lets capable AI models safely control a developer workstation for file edits, terminal and process execution, Git operations, language-server analysis, browser and Windows UI automation, media processing, job/resource control, and checkpointing. It also coordinates durable single- or multi-agent tasks across providers with leases, dependency graphs, evidence logs, repair loops, and separate verification gates.1281ISC
- AlicenseAqualityCmaintenanceEnables Claude to delegate bounded, isolated units of work to external LLMs such as Z.AI GLM or any OpenAI-compatible endpoint, running single or up to 16 concurrent workers in separate tool-less workspaces. Results come back through normalized MCP tools that list models, launch, poll, cancel, and clean up agents without exposing credentials or leaking worker output as instructions.81MIT