Pi Worker MCP

io.github.zguiyangv0.1.1更新於 Oct 8, 2026

A host-agnostic MCP worker runtime for supervising local Pi coding-agent processes.

已驗證STDIO僅桌面Developer ToolsAI & ML

概覽

AI 產生的概覽

透過 stdio MCP 工具(如 spawn、status、steer、continue、abort、list)執行並監督本機 Pi 編碼代理工作程序。

功能
一個與宿主無關的 MCP 工作程序執行環境,透過本機 stdio MCP 與 Pi RPC 監督有界的本機 Pi 編碼代理程序。其工具包括 pi_spawn、pi_status、pi_steer、pi_continue、pi_abort 和 pi_list。它也提供 setup、doctor、update 和 uninstall 命令,為 Codex、Zed 和 OpenCode 宿主固定啟動設定。它不管理 Pi 的認證資訊、供應商或預設模型。
適用情境
當助理需要啟動、監控、引導和停止本機 Pi 編碼代理工作程序時使用,包括在 Git 工作樹中進行隔離的實作工作。適合已在本機執行 Pi、並希望由監督代理協調有界工作任務的使用者。
執行需求
需要 Node.js 20+、本機已安裝並設定好的 pi 執行檔,以及在使用隔離工作樹時需要 Git。以本機 stdio 程序執行,通常透過 npx 啟動。選用環境變數包括 PI_WORKER_COMMAND、PI_WORKER_MAX_WORKERS、PI_WORKER_RPC_TIMEOUT_MS、PI_WORKER_IDLE_TIMEOUT_MS、PI_WORKER_TASK_TIMEOUT_MS 和 PI_WORKER_ALLOWED_ROOTS。Pi 讀取自己的本機認證設定。
安裝前請注意
spawn 或 continue 成功僅表示 Pi 接受了工作,並不表示結果正確,監督代理必須檢查結果並整合變更。setup 命令會修改 Codex、Zed 或 OpenCode 的宿主設定檔,但只做最小合併,uninstall 也只移除本伺服器的項目。工作程序會執行本機編碼代理程序,可能變更檔案,因此隔離工作應使用 worktree 模式並審查變更。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@zguiyang/pi-worker-mcp

A host-agnostic MCP worker runtime for supervising local Pi coding-agent processes. It uses local stdio MCP and Pi RPC; it is not a hosted service and does not manage Pi credentials, providers, or default models.

Quick start

Prerequisites: Node.js 20+, a locally installed and configured pi executable, and Git when using isolated worktrees.

sh
npx -y @zguiyang/pi-worker-mcp@latest setup

The setup command selects supported hosts and pins their launch configuration to the exact CLI version. A host never silently drifts to a new release.

Supported hosts and scope

HostGlobalProjectConfiguration
Codex~/.codex/config.toml.codex/config.tomlTOML mcp_servers
Zed~/.zed/settings.json on macOS.zed/settings.jsonJSON context_servers
OpenCode~/.config/opencode/opencode.jsonopencode.jsonJSON mcp.servers

Project scope is relative to the directory where setup runs. Zed starts project-defined MCP servers only after the worktree is trusted. Existing configuration is minimally merged; uninstall removes only this server’s entry.

sh
npx -y @zguiyang/[email protected] setup --host codex --scope projectnpx -y @zguiyang/[email protected] setup --host opencode --scope global

Manual / generic MCP configuration

Any stdio MCP client can launch:

text
command: npxargs:    -y @zguiyang/[email protected] serve

This is the release configuration. Do not point user installations at a checkout’s dist/ directory.

Commands

text
pi-worker-mcp servepi-worker-mcp setup [--host codex|zed|opencode] [--scope project|global]pi-worker-mcp doctor [--host …] [--scope …]pi-worker-mcp update [--host …] [--scope …]pi-worker-mcp uninstall [--host …] [--scope …]pi-worker-mcp version

doctor checks Node, the local Pi executable, and selected host configuration without starting a model task or exposing credentials. update is not a package manager: run a newer CLI via npm/npx and it updates only selected configuration pins. uninstall never removes a whole host config, Pi config, Skills, or npm cache.

Model ownership and host independence

Pi owns provider authentication, available models, and its default model. The worker runtime can validate an optional per-worker override and report the effective model, but never configures credentials. Core runtime behavior—Pi RPC, lifecycle, model semantics, concurrency, and permissions—is independent of Codex, Zed, and OpenCode. Host adapters only read, merge, and remove launch configuration.

MCP tools

pi_spawn, pi_status, pi_steer, pi_continue, pi_abort, and pi_list supervise bounded local workers. Successful spawn/continuation means Pi accepted work, not that it is correct; the supervising agent must inspect results and integrate changes. Use worktree mode for isolated implementation work.

Runtime configuration

Environment variableDefaultPurpose
PI_WORKER_COMMANDpiPi executable
PI_WORKER_MAX_WORKERS4Maximum live workers
PI_WORKER_RPC_TIMEOUT_MS15000Per-RPC timeout
PI_WORKER_IDLE_TIMEOUT_MS600000Idle deadline; 0 disables it
PI_WORKER_TASK_TIMEOUT_MS3600000Activity-cycle deadline
PI_WORKER_ALLOWED_ROOTScurrent directoryPath-delimited allowed roots

No secret environment variable is required; Pi reads its own local authentication configuration.

Development from source

Source mode is only for contributors:

sh
npm installnpm run buildnode dist/index.js serve

For release-equivalent testing, use npm pack and execute the resulting .tgz from a clean temporary directory. npm link is not package acceptance.

Registry metadata

server.json follows the official MCP Registry schema and declares an npm stdio package representation. npm and Registry publication remain separate, explicit actions.

License

MIT

來源:README.md,提交 64590c3

工具

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

版本歷史

1
  1. v0.1.1最新Oct 8, 2026