Pi Durateam

io.github.Nyarlathoteppppp由 GitHub 帳號 Nyarlathoteppppp 發布v0.7.12更新於 Oct 28, 2026

Pi agent teams on any provider: parallel delegates, forks, MCP tools; runs built to finish.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

在任意模型供應商上執行一組 Pi 委派代理,讓主代理平行分派閱讀、檢索與審查任務,並只取回精簡報告。

可以做什麼
  • 啟動、批次啟動、阻塞執行並收集委派任務,可把同一問題送給多個模型,也可從已完成工作階段的對話紀錄衍生新任務
  • 對執行中的委派進行引導、回答其提問、追問已完成的委派、中止任務並查看狀態
  • 以絕對路徑傳入附件,把長報告寫入檔案並回傳路徑,讀取 token 用量與費用
  • 為個別委派授予指定的 MCP 伺服器與具名工具
  • 可選擇啟用協調者,由其分派成員並撰寫一份綜合結論
  • 查看可用模型、供應商憑證與設定
適用情境
適合需要多個模型或平行閱讀者的任務,例如審查程式碼差異、交叉核對結論、通讀大型程式碼庫,同時讓主 Claude Code 或 Codex 工作階段保持精簡。也適合需要輪次與時間預算、模型備援或可續接工作階段的長任務。
執行需求
macOS 或 Linux、Node.js 22.19+,並已安裝 Pi 且登入某個供應商;需全域安裝 npm 套件 pi-durateam 並註冊為 stdio MCP 伺服器。模型呼叫使用你自己的供應商憑證。選用功能透過 PI_DELEGATE_* 環境變數設定。
安裝前請注意
委派並非沙箱:被授予 bash 的委派可以做你能做的一切,被允許的 MCP 工具也可能在工作目錄之外寫入或操作。敏感路徑保護只涵蓋附件、讀取與搜尋,不涵蓋外部 MCP 伺服器。模型呼叫會消耗你自己的供應商配額並產生費用。持久工作階段會把對話紀錄存入 SQLite。請透過 PI_DELEGATE_ALLOW_TOOLS 謹慎授權。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

[pi-durateam — Split work across models. Bring findings together.]

English · 简体中文

pi-durateam

A team of Pi agents for Claude Code and Codex, on any provider, with runs built to finish.

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

Quick start · Team · MCP tools · Dura · Reference

Renamed from pi-durabletask-mcp: install pi-durateam. The old command still works; configuration, PI_DELEGATE_* variables, stored state and tool names are unchanged.


Your main agent plans, picks the models and judges the results. The reading, searching and cross-checking run on Pi delegates — Gemini, Grok, GPT, DeepSeek or any other provider Pi supports — and spend those quotas instead of your Claude Code or Codex one; what comes back is a compact status and the final report, or just a file path. In our own pre-release review, four agents read about two million tokens of this codebase on Gemini, Grok and a GPT model, and our Claude session received about 7 KB of reports.

  • team — one task or several in parallel, the same question to several models, forks that read once and answer many questions, an opt-in coordinator, and MCP servers (read-only GitHub, a browser) granted per delegate.
  • dura — every run has turn and time budgets and a last turn without tools, reserved for the answer. maxToolCalls adds an optional tool-call cap. Opt in to a soft deadline, model fallback on provider errors, and sessions that survive a server restart.

For example, 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 shared prompt and three models, collects with wait, and gets three independent reports with token usage and cost.

Quick start

Requires macOS or Linux, Node.js 22.19+ and Pi. CI runs Node.js 22 and 24 against 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 log in to a provider:

bash
curl -fsSL https://pi.dev/install.sh | shpi  # then /login, or configure a provider

2 · Install pi-durateam:

bash
npm install -g pi-durateam@latest
Or install from source
bash
git clone https://github.com/Nyarlathoteppppp/pi-durateam.gitcd pi-durateam && npm ci && npm run build# below, use `node /absolute/path/pi-durateam/dist/index.js` instead of `pi-durateam`

3 · Connect. Claude Code:

bash
claude mcp add --scope user pi -- pi-durateam

Codex (~/.codex/config.toml):

toml
[mcp_servers.pi]command = "pi-durateam"

The Codex desktop app starts MCP servers with a minimal PATH (no Homebrew or nvm directories), so it may find neither pi-durateam nor the node it runs on. The server then never starts and the session simply has no Pi tools. Use absolute paths there:

toml
[mcp_servers.pi]command = "/opt/homebrew/bin/node" # output of `which node`args = ["/opt/homebrew/lib/node_modules/pi-durateam/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 starts

Reconnect the MCP server after updating pi-durateam or Pi. Other clients →

4 · Try it: "Use Pi to check the auth module for missing permission checks. Read only." init shows models, provider credentials and settings; models lists what delegates may use.

Optional: install the Agent Skill

The skill teaches your agent the workflow. Put SKILL.md in your client's skills directory:

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

Team: several models on one job

  • Delegate. spawn starts one task in the background and returns a sessionId at once. spawn_batch starts up to 4 per call by default (PI_DELEGATE_BATCH_MAX) and checks every task first, so nothing starts if one is bad. run blocks, for quick questions. Collect with wait and until: "settled".
  • One question, several models. A batch-level prompt goes to every task; each task names its model, and its own prompt is appended. Different model families miss different things, but agreement is not proof: verify findings before acting.
  • Read once, ask many. forkFrom starts new tasks from a finished session's transcript, including the files it already read; each fork gets fresh budgets.
  • Steer and continue. steer a running delegate, answer its questions, follow_up a finished one (it keeps what it read), abort when needed. status reports idleMs and phase, which tell slow reasoning from a hung request.
  • Material in, reports out. attachments passes a diff or notes by absolute path; saveTo / saveDir write long reports to files and return the path; usage gives tokens and cost.
  • Coordinator (opt-in). Pass a coordinator plan to spawn: a Pi coordinator dispatches your members, can ask one a targeted follow-up, and writes one synthesis that cites the original reports. Requires codemode in PI_DELEGATE_ALLOW_TOOLS. For most work spawn_batch and your own judgment are simpler. Workflow →

MCP tools per delegate

A delegate can use MCP servers from Pi's mcp.json — read-only GitHub, Serena, a browser, web search — selected per task; nothing is on by default. Add the server to ~/.pi/agent/mcp.json, permit its exact tool names in pi-durateam's environment (PI_DELEGATE_ALLOW_TOOLS="mcp__github__get_file_contents,mcp__github__search_code") and reconnect. Then select them per call:

json
{  "cwd": "/absolute/repo",  "nativeMcp": true,  "mcpServers": ["github"],  "tools": ["mcp__github__get_file_contents"],  "prompt": "Read package.json of OWNER/REPO with GitHub MCP and report its version."}
  • Only the servers in mcpServers are connected. Of their tools, the delegate gets only the mcp__<server>__<tool> names listed in tools and permitted by PI_DELEGATE_ALLOW_TOOLS; selecting a server never grants all of its tools.
  • A call that selects servers but grants none of their tools is refused before anything starts — for example with tools omitted (the read-only default), or with only codemode or tool_search, which reach only tools named in tools. Granting only tools hidden in mcp.json is refused too. tools: [] remains a tool-free run.
  • The server's exposure in mcp.json does not matter to delegates: every tool named in tools is declared to the delegate directly, so you can keep servers deferred or codemode there for interactive Pi. Tools set to hidden stay unreachable. Add codemode to tools only for scripted loops; scripts reach the same named tools.
  • extensions can stay false. Batch tasks inherit nativeMcp and mcpServers; coordinator members select their own.
  • A permitted MCP tool may write or act outside cwd, and the secret-path guard does not cover external servers. Grant capabilities deliberately.

Setup for GitHub, Serena and agent-browser: optional tools. Web search: research. Details and recovery: native MCP.

Dura: runs built to finish

Always on

  • Turn and time budgets. spawn and spawn_batch default to 30 turns and 10 minutes, run to 12 turns and 5 minutes; the ceilings are PI_DELEGATE_MAX_TURNS (default 50) and PI_DELEGATE_MAX_DURATION_MS (default 15 minutes). maxToolCalls optionally caps the delegate's own calls.
  • At 75% of the turn budget or tool-call cap (if maxToolCalls is set), or after 2/3 of the time, the delegate is told to wrap up; its last turn has no tools and is reserved for the answer.
  • answerState flags an empty (missing) or cut-off (partial) answer. A run that ends without an answer (aborted, error) returns its latest substantial text as salvagedText. Finished results name the model that answered.

Opt-in

  • Soft deadline (PI_DELEGATE_DEADLINE_GRACE_MS): at the deadline the tools go, no new tool call starts, and the delegate has this long to answer; only a run still without an answer is aborted.
  • Model fallback (PI_DELEGATE_FALLBACK_MODELS, or fallbackModels per call): after a provider error that outlasts Pi's retries, the run continues in the same session on the next model listed, e.g. "xai/*:high,antigravity/gemini-*". In our use, a Codex quota error now continues on Grok within seconds.
  • For models that keep calling tools: PI_DELEGATE_ANSWER_GRACE=1 gives one more tool-free turn, PI_DELEGATE_TOOL_CHOICE_NONE sends toolChoice: "none" on that turn, PI_DELEGATE_FINISH_THINKING lowers the thinking level once a run is wrapping up.
  • Durable sessions (durable: true): SQLite checkpoints; after a server restart the session resumes with its id, history and budgets, and a tool call whose outcome is unknown is never blindly replayed. Finished ones are kept for 7 days by default (retentionDays, PI_DELEGATE_RETENTION_DAYS).
  • handoff: save a note in one Claude/Codex window, read it in another to continue the same durable session.

Safe defaults

  • A call that omits tools gets the read-only set (read, grep, find, ls, or your PI_DELEGATE_DEFAULT_TOOLS); anything more must be permitted with PI_DELEGATE_ALLOW_TOOLS. This is not a sandbox: a delegate given bash can do anything you can.
  • Secret paths (.env, ~/.ssh, credentials) are refused for attachments, reads and searches; PI_DELEGATE_SECRET_GUARD=0 turns this off.
  • Sessions live in memory and end with the MCP process. Durable storage, fallback, the soft deadline, the answer grace turn, native MCP and the coordinator are off unless you turn them on.
  • By default at most 4 delegates run at once per server process (PI_DELEGATE_MAX_CONCURRENT). A model name that does not resolve is refused, never replaced by the default.

Documentation


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

來源:README.md,提交 15a6193

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

1
  1. v0.7.12最新Oct 26, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分