Pi Durabletask MCP

io.github.Nyarlathotepppppv0.4.3更新於 Oct 4, 2026

Delegate Claude/Codex tasks to configured Pi, with steering and optional SQLite restart recovery.

已驗證STDIO僅桌面Developer ToolsAI & ML

概覽

AI 產生的概覽

讓助理把編碼工作委派給獨立的 Pi Coding Agent 工作階段,支援即時引導、追問,以及選用的 SQLite 復原。

功能
這個橋接讓主代理(例如 Claude Code 或 Codex)在獨立脈絡中把工作交給 Pi Coding Agent。工具包括 spawn 與 spawn_batch 啟動工作(可為每項工作個別選擇模型)、以 wait 搭配 until: "settled" 收集結果、steer 在執行中調整方向、follow_up 在同一工作階段繼續,以及 answer 回覆 Pi 的提問。另外還提供供下一個用戶端視窗讀取的 handoff 備註、用來選擇伺服器與工具權限的 nativeMcp,以及選用的 SQLite 持久化檢查點。
適用情境
當你希望由第二個代理讀取、搜尋或審查程式庫,而不佔用主代理的脈絡時,或需要可引導、可跨用戶端視窗接續的長時間委派工作時,適合使用。
執行需求
以 npm 套件 pi-durabletask-mcp 透過 stdio 在使用者本機執行。需要 Node.js 22.19+,以及全域安裝並已設定自有供應商憑證與額度的 Pi Coding Agent。搜尋需要 PATH 中有 ripgrep(rg)。未宣告任何環境變數或標頭。
安裝前請注意
模型呼叫使用你自己的供應商憑證與額度,委派工作會消耗你的用量。工作預設使用唯讀工具與記憶體儲存,但 durable: true 會把檢查點寫入 SQLite 並在重新啟動後復原;復原後結果未知的工具不會自動重播,重試前請先確認外部狀態。handoff 備註會被保存,並可供後續工作階段讀取。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pi Durabletask MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[pi-durabletask-mcp — Delegate. Steer. Recover.]

English · 简体中文

pi-durabletask-mcp

Delegate work from Claude Code, Codex, or another MCP client to Pi Coding Agent, in its own context.

[npm] [CI] [Node.js] [License: MIT]

Quick start · Reference

Example workflow

text
You: Use Pi to review authentication for missing permission checks. Don't edit files.     Explicitly set durable: true so we can continue in another window.  → spawn with the absolute repo cwd and durable: trueWhile running: Focus on tenant isolation; skip style issues.  → steerAfter the review: Suggest a regression test for the most serious finding.  → follow_up in the same sessionSwitching windows: Save findings and next steps → handoff saveNew window: Read this repo's handoff → handoff read; follow resumeHint

To collect results, the main agent loops wait with until: "settled". If Pi asks a question, use answer with the question ID, then wait again.

What you can do

  • Separate context: Pi reads and searches; your main agent collects findings.
  • Multiple models: spawn_batch starts tasks with individually selected models.
  • Live steering: steer redirects work after the current tool call.
  • Follow-ups: follow_up keeps context in the same long-lived session; turns accumulate.
  • Recovery: explicit durable: true saves checkpoints to SQLite.
  • Handoff: leave a note for the next Claude/Codex window.
  • Native MCP: nativeMcp explicitly selects servers and tool permissions; third-party extensions are enabled separately.

Quick start

Requires Node.js 22.19+ and global Pi. CI-tested with Pi 1.0.0 and 1.0.2. Model calls use your own provider credentials and quota.

1 · Install

Already configured Pi? Install the bridge:

bash
npm install -g pi-durabletask-mcp
Install and configure Pi first

The bridge links to the global Pi SDK, so install Pi before the bridge:

bash
npm install -g @earendil-works/[email protected]pi  # configure a provider or use /login

Search uses Pi's downloaded rg or ripgrep on PATH. Authentication →

Install from source

Global Pi is still required.

bash
git clone https://github.com/Nyarlathoteppppp/pi-durabletask-mcp.gitcd pi-durabletask-mcpnpm cinpm run build

Connect with node /absolute/path/pi-durabletask-mcp/dist/index.js instead of the installed command.

2 · Connect

Claude Code
bash
claude mcp add --scope user pi -- pi-durabletask-mcp
Codex

Add to ~/.codex/config.toml:

toml
[mcp_servers.pi]command = "pi-durabletask-mcp"

Already connected? Update the existing entry and reconnect. Other clients →

3 · Try a review

Use Pi to review authentication for missing permission checks. Don't edit files. Report file locations and suggested regression tests.

The agent uses spawn → wait(until: "settled"), answering questions with answer. Try the steering and follow-up prompts above. init is optional diagnostics; models lists available models.

Optional: install the Agent Skill

Connect the MCP server first; this skill only guides tool use. Choose your client's user-level directory and download just SKILL.md:

bash
dir="$HOME/.claude/skills/pi-durabletask-mcp" # Claude Code# dir="$HOME/.agents/skills/pi-durabletask-mcp" # Codex: use insteadmkdir -p "$dir"curl -fsSL https://raw.githubusercontent.com/Nyarlathoteppppp/pi-durabletask-mcp/main/skills/pi-durabletask-mcp/SKILL.md \  -o "$dir/SKILL.md"

Start a new client session after installing.

Defaults & recovery

Tasks use your configured model, read-only tools and memory storage by default; memory sessions disappear when their MCP process exits. With explicit durable: true, recovery happens after a bridge restart: per-run time limits include downtime, and tools with unknown outcomes are not blindly replayed—verify external state before retrying. handoff stores notes written by the main agent; reading them does not take over execution. Cross-window continuation requires a durable task with its original history and note still retained; a live owner must release the task before another process can continue it.

Documentation


MIT · Built on howznguyen/pi-delegate-mcp and Pi Durable.

來源:README.md,提交 63427da

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.4.3最新Oct 4, 2026