pi-durabletask-mcp
Provides opt-in durable task storage in a local SQLite database: tasks marked durable: true have their history, tool results and pending steering persisted so unfinished work recovers after a bridge restart and finished results stay readable from any session. Includes per-task ownership via a kernel-released lock, configurable per-task history retention (seven days by default) and automatic removal of expired history.
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., "@pi-durabletask-mcpUse Pi to review this repository and report the findings."
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.
English · 简体中文
pi-durabletask-mcp
From Claude Code or Codex, hand reviews and investigations to Pi agents running on any provider — Gemini, Grok, GPT, DeepSeek and more — in the background, and get back their reports.
Quick start · What you can do · Reference
Why
Spend far less of your Claude Code / Codex quota on the same work. The heavy part of a review or investigation — reading code, searching, cross-checking — runs on other providers. Your main agent only plans, waits and judges, and receives compact status and the final report, or just a file path.
Put your other subscriptions to work. Free tiers and plans you already pay for (Gemini, Grok, GPT, DeepSeek…) usually sit half unused. Pi runs on all of them, so that capacity does real work instead of expiring.
Other model families, other blind spots. Reviewers from one family tend to miss the same things. Send one diff to Gemini, Grok and GPT at once and compare.
Built to finish. Every run has turn, time and tool-call budgets with a tool-free last turn for the answer; opt-in model fallback on provider errors; opt-in durable tasks that survive a restart.
Your main agent stays in charge: it plans, chooses models and judges the results.
Related MCP server: pi-agent-mcp
In 30 seconds
Ask your agent:
Use Pi to review the attached diff with Gemini, Grok and GPT in parallel. Don't edit files. Report only real defects with file:line.
It calls spawn_batch with one prompt and three models, waits with wait, and returns three independent reports with token usage and cost. One provider down? With fallback configured, that review continues on another model in the same session.
Quick start
Requires macOS or Linux, Node.js 22.19+ and Pi. CI covers Pi 1.0.0, 1.0.4, 1.1.0 and 1.3.0. Model calls use your own provider credentials.
1 · Install Pi (skip if you have it) and configure a provider:
curl -fsSL https://pi.dev/install.sh | sh
pi # then /login or configure a provider2 · Install the bridge:
npm install -g pi-durabletask-mcp@latestgit clone https://github.com/Nyarlathoteppppp/pi-durabletask-mcp.git
cd pi-durabletask-mcp && npm ci && npm run buildConnect with node /absolute/path/pi-durabletask-mcp/dist/index.js instead of pi-durabletask-mcp below.
3 · Connect. Claude Code:
claude mcp add --scope user pi -- pi-durabletask-mcpCodex (~/.codex/config.toml):
[mcp_servers.pi]
command = "pi-durabletask-mcp"The Codex desktop app starts MCP servers with a minimal PATH (no Homebrew or nvm directories), so it may find neither pi-durabletask-mcp nor the node it runs on. The server then never starts, and the session simply has no Pi tools. Use absolute paths there:
[mcp_servers.pi]
command = "/opt/homebrew/bin/node" # output of `which node`
args = ["/opt/homebrew/lib/node_modules/pi-durabletask-mcp/dist/index.js"] # under `npm root -g`
[mcp_servers.pi.env]
PATH = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" # inherited by what the server startsReconnect the MCP after updating the bridge or Pi. Other clients →
4 · Try it: "Use Pi to check the auth module for missing permission checks. Read only." init shows your models and settings; models lists what each delegate may use.
The skill teaches your agent the workflow. Put SKILL.md in your client's skills directory:
dir="$HOME/.claude/skills/pi-durabletask-mcp" # Claude Code
# dir="$HOME/.agents/skills/pi-durabletask-mcp" # Codex: use instead
mkdir -p "$dir"
curl -fsSL https://raw.githubusercontent.com/Nyarlathoteppppp/pi-durabletask-mcp/main/skills/pi-durabletask-mcp/SKILL.md \
-o "$dir/SKILL.md"What you can do
Delegate
spawnone task,spawn_batchup to four at once by default (PI_DELEGATE_BATCH_MAX; one sharedpromptfor a multi-model review),runfor a quick blocking question.forkFroma finished session: read the code once, then ask several independent questions from the same context.Pass material with
attachments(a diff, notes); add instruction files and skills or web research and MCP tools per task.
Steer and follow up
waitreturns on progress, a question or the end (until: "settled", or any/all of a batch); a wait for the result lasts as long as the server allows (PI_DELEGATE_WAIT_MAX_MS), so you do not poll.statusgives a snapshot withidleMsandphase, so you can tell slow reasoning from a hung request.steera running agent,answerits questions,follow_upa finished one with renewed budgets,abortwhen needed.
Results
Compact results by default;
saveTo/saveDirwrite long reports to files and return the path.answerStateflags empty or cut-off answers;usagereports tokens and cost; finished results name the model that answered, after a fallback too.A run that ends without an answer returns the latest substantial text it wrote as
salvagedText, instead of losing that work.
Reliability
Budgets on turns, time and tool calls, with a wrap-up nudge at 75% (2/3 of the time) and a tool-free last turn. Opt-in for models that keep going:
toolChoice: "none"on that turn (PI_DELEGATE_TOOL_CHOICE_NONE) and a lower thinking level once wrapping up (PI_DELEGATE_FINISH_THINKING).Soft deadline (opt-in,
PI_DELEGATE_DEADLINE_GRACE_MS): at the deadline the tools go, no new tool call starts and the delegate gets a grace period to answer; only a run still without an answer after it is aborted.Model fallback (opt-in): after a provider error that outlasts Pi's retries — gateway timeout, spent quota — the run continues on the next model you list, e.g.
PI_DELEGATE_FALLBACK_MODELS="xai/*:high,antigravity/gemini-*".Durable tasks (opt-in,
durable: true): SQLite checkpoints, recovery after a restart, interrupted side effects never blindly replayed, finished stores compacted;handoffnotes for another window.
Teams (advanced)
An opt-in coordinator that dispatches your planned read-only members, asks follow-ups on disagreements and writes one synthesis with links to the original reports. For most work,
spawn_batchand your own judgment are simpler.
What we get from it
We build this project with it: reviews, design discussions and research for this repo run through these tools every day.
Highlights
Our Claude quota goes to judgment, not reading. In the pre-release review, four agents read about two million tokens of this codebase on Gemini, Grok and a GPT model. Our Claude session received about 7 KB of reports and spent its turns deciding what to fix.
Subscriptions we were already paying for do the heavy lifting. Most runs go to Gemini and Grok plans we had anyway. The four Gemini runs of that review round (one review, three verifications) came to about $0.10 at API prices, and to nothing extra on the plan.
Several model families find more, and verification keeps it honest. Parallel reviews from different families surface different issues; an independent verifier then refutes what does not hold. In that pre-release round, verifiers rejected one reviewer's top "major" and confirmed two real recovery bugs, which we fixed the same day.
Runs finish when a provider does not. Gateway timeouts and spent quotas used to cost us a manual rescue each. With fallback configured, a Codex quota error now continues on Grok within seconds, in the same session.
Read once, ask many. A session forked from one that had already read the code answered in a single turn.
Lessons
Agreement is not proof: two of four reviewers once reported the same false positive. Verify findings before acting (how).
Across providers the prompt cache does not carry over, so a large fork can cost more than you expect.
Some models call a tool even after their tools are gone; the opt-in grace turn keeps that from ending a run with no answer.
Fast models are cheap but take more turns; strong reasoners can think past their deadline. Leave time and keep thinking levels moderate for long reviews.
A deadline guards against a hung provider; it is not a work budget. Turn and tool-call budgets bound the work, and tight deadlines cost us finished reviews, so we run with
PI_DELEGATE_MAX_DURATION_MS=3600000,PI_DELEGATE_SPAWN_DURATION_MS=1800000andPI_DELEGATE_DEADLINE_GRACE_MS=180000(the defaults are 15 and 10 minutes, with no grace).A task's
labelis never sent to the delegate; put what differs between tasks in theirprompt.
Safe defaults
Read-only tools (
read,grep,find,ls) unless the server permits more withPI_DELEGATE_ALLOW_TOOLS. This is not a sandbox: a delegate givenbashcan do anything you can.Secret paths (
.env,~/.ssh, credentials) are refused for attachments, reads and searches;PI_DELEGATE_SECRET_GUARD=0turns this off.Memory sessions by default; they end with the MCP process. Durable storage, fallback, the answer grace turn and the soft deadline are off unless you turn them on.
At most four delegates at once per server process (
PI_DELEGATE_MAX_CONCURRENT).
Documentation
Review and synthesize, including falsifying findings before you act on them
MIT · Built on howznguyen/pi-delegate-mcp and Pi Durable.
This server cannot be deployed
Maintenance
Related MCP Connectors
Project management MCP for AI agents with safe task reads and writes.
- DazbenchOAuthapp.dazbench
Task management your AI agents can actually run. One line becomes a context-ready task over MCP.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
- projectsOAuthcloud.tri2b
Task tracking built for coding agents. Work is leased, so two agents never take the same SubTask.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceDelegates bounded coding tasks from MCP clients to the Pi Coding Agent over stdio. Supports review, verification, implementation, and batch operations with long-running task polling.MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP hosts like Claude Code and Codex to spawn, manage, and interact with persistent, reusable Pi coding-agent sessions, supporting task dispatch, status checks, and session lifecycle control.3 npm-
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate coding implementation and testing to a local pi agent via MCP tools, including dispatching task books, monitoring status, steering or aborting runs mid-execution, and retrieving results and transcripts.15 npm4MIT
- AlicenseBqualityBmaintenanceEnables launching and supervising local Codex and Claude Code agent sessions and one-shot tasks, exposing run, list, stop, and output operations over MCP with session-scoped permissions and sandbox controls.23,029 npm1MIT