
Pibox
io.github.psyb0t由 GitHub 帳號 psyb0t 發布v0.21.0更新於 Oct 24, 2026
Self-hosted MCP server: pi-coding-agent tools (run_prompt, file ops) over streamable HTTP.
概覽
自架構的 Docker 版 MCP 伺服器,透過 streamable HTTP 提供 pi 編碼代理,讓助理執行提示詞並操作工作區檔案。
- 可以做什麼
- 透過 pi 編碼代理執行提示詞並以工具呼叫形式回傳結果,可指定 thinking 等級(run_prompt)。在限定工作區內讀取、寫入、列出和刪除檔案,並進行路徑穿越檢查。供其他代理或用戶端透過 streamable HTTP 呼叫,API 模式下掛載於 API 連接埠的 /mcp/,其他模式下則以獨立連接埠的 sidecar 執行。可與同一容器的 API、Telegram 機器人和 cron 排程模式並存,這些模式與 MCP 模式彼此獨立。
- 適用情境
- 當你想要一個自架構、容器化的編碼代理,供其他助理或 MCP 用戶端當作工具呼叫時適用,特別適合已執行 pibox 映像、希望透過 HTTP 而非本機 stdio 程序取得提示詞執行與工作區檔案存取的場景。
- 執行需求
- 主機需安裝 Docker 和 pibox 映像(docker.io/psyb0t/pibox),通常透過 pibox 主機包裝指令啟動,它會掛載工作目錄並保存狀態。以 PIBOX_MCP_MODE=1 啟用 MCP 模式,可選用 PIBOX_MCP_MODE_TOKEN 保護。需要上游 LLM 端點和憑證,例如 ANTHROPIC_AUTH_TOKEN、ANTHROPIC_BASE_URL 和 ANTHROPIC_MODEL,或 PIBOX_PROVIDER_* 設定。需要連線至 LLM 供應商的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pibox,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
docker-pibox
[CI] [version] [license] [Docker Pulls]
pi-coding-agent inside an aicodebox container. One image, several ways in: interactive shell, one-shot prompt, HTTP API (with an OpenAI-compatible endpoint), MCP server, Telegram bot, and a cron scheduler that fires pi on whatever schedule you want.
You talk to pibox. pibox talks to pi. pi talks to whatever LLM you point it at. Nobody cares about the middle.
Table of Contents
- Quick start
- Using the
piboxwrapper - Image variants
- Modes
- Configuration
- LLM providers
- Auth
- Agent integrations
- GitHub Action
- Development
- Tests
- License
Quick start
Install the host wrapper.
The installer creates the Pi, pibox state, and SSH directories, pulls the
selected image, and installs pibox on PATH. The minimal image is the
default. PIBOX_FULL=1 on the bash side of the pipe selects the full image
and bakes that choice into the installed wrapper.
Install pibox, codexbox, and claudebox in the same command directory,
normally /usr/local/bin, when you want one box to launch another. Each
wrapper finds the sibling wrapper files there and mounts them read-only into
its container. A sibling then runs through the host Docker daemon and mounts
its own host data directory.
Using the pibox wrapper
Run pibox from the directory you want Pi to work in. The wrapper mounts that
directory at the same absolute path inside the container, persists ~/.pi,
~/.aicodebox, and ~/.ssh/pibox, forwards PIBOX_* configuration, and
passes Pi arguments through unchanged.
The wrapper is also the normal way to start a long-running mode. PIBOX_DETACH=1
makes the named container run in the background.
Use raw docker run only when you intentionally do not want the host wrapper.
The wrapper is the normal interactive and service entry point.
Agent use and nested launches
The installed wrapper is the normal interface for people and agents. An agent
should run pibox from the requested workspace instead of assembling a new
docker run command. The wrapper preserves the workspace path, Pi state,
aicodebox state, SSH state, image choice, and container lifecycle.
When one box needs another, install pibox, codexbox, and claudebox in
the same command directory. A running box can call the sibling command
directly. The parent wrapper passes the host launch context and mounts only
the sibling wrapper file. Do not set AICODEBOX_HOST_*, copy a wrapper, or
manually mount another box's state directory.
Image variants
psyb0t/pibox:latestis the minimal image.psyb0t/pibox:latest-fullstarts from the sharedaicodebox:latest-fullbase, then adds Pi and pibox. It carries the shared development toolchain without rebuilding it in this repository.
Modes
Foreground modes (API / Telegram / Cron) are mutually exclusive — except PIBOX_TELEGRAM_MODE=1 + PIBOX_CRON_MODE=1, which run together (cron in-thread inside telegram). API wins if set alongside anything else.
MCP mode (PIBOX_MCP_MODE=1) is independent — it coexists with whatever foreground mode is running. In API mode it's mounted at /mcp/ on the API port (slashless /mcp reaches the same handler); in other modes it runs as a sidecar uvicorn on its own port, serving at the port root.
Each mode has its own page with full setup, env vars, and examples.
API Mode →
Long-lived FastAPI server on :8080. Agent runs (sync, async with run-id polling, cancellable), workspace file upload/download/list/delete with traversal checking, and an OpenAI-compatible chat/completions endpoint with streaming and client-executed tool calling.
Telegram Mode →
Talk to pi from Telegram. Per-chat isolated workspaces, allowed-chats and per-chat allowed-users gating, file ingestion, [SEND_FILE: path] to get files back, and per-chat /model, /effort, /system_prompt, /append_system_prompt overrides that persist across restarts.
Cron Mode →
YAML-defined scheduled jobs on 6-field croniter schedules. Per-run history dirs with meta.json, stdout.log, stderr.log, result.txt, and a "prior run" hint so a job can reference its own history.
MCP Mode →
Exposes run_prompt plus workspace-confined file tools over streamable HTTP, so other agents can drive pi as a tool. Coexists with any foreground mode — mounted at /mcp/ on the API port in API mode, a sidecar on its own port everywhere else.
Configuration
Set PIBOX_GIT_NAME and PIBOX_GIT_EMAIL on the host to configure the runtime user's global Git identity before startup hooks. Direct container deployments accept the same names. Nonempty AICODEBOX_GIT_NAME and AICODEBOX_GIT_EMAIL inside the container take precedence; through the wrapper, supply those shared values as AICODEBOX_ENV_AICODEBOX_GIT_NAME and AICODEBOX_ENV_AICODEBOX_GIT_EMAIL. Empty settings preserve existing Git config. Multiline values are rejected.
make version V=X.Y.Z synchronizes package metadata, lockfile, the Codex plugin manifest, and the installer's wrapper release ref without committing or tagging. Remote installs download the matching release wrapper unless PIBOX_INSTALL_REF overrides it. Updating an image does not update an installed wrapper.
Naming convention: PIBOX_<MODE>_MODE=1 is the on/off flag, PIBOX_<MODE>_MODE_<KNOB>=... is its config. Non-mode-scoped vars (workspace, container name, available models) are bare.
The image is built on top of aicodebox, so the equivalent AICODEBOX_* names also work — the entrypoint translates PIBOX_X to AICODEBOX_X when only the pibox-prefixed one is set. If you set both, AICODEBOX_* wins.
Set the upstream endpoint URL, protocol, API key or token, and model with LLM providers. PIBOX_PROVIDER_* supports Pi's documented OpenAI, Anthropic, and Google custom HTTP APIs. The ANTHROPIC_* variables below remain a compatibility path for existing Anthropic-compatible deployments.
Mode flags
Each mode's own knobs (ports, tokens, config paths, history dirs) live on that mode's page: api.md, telegram.md, cron.md, mcp.md.
Workspace & runtime
Automation can install the wrapper in another command directory with
PIBOX_INSTALL_DIR and PIBOX_BIN_NAME. The installed wrapper accepts the
versioned AICODEBOX_HOST_* nested-launch context. It uses those host paths as
Docker bind sources, makes available sibling wrappers, and applies shared
AICODEBOX_ENV_* and AICODEBOX_MOUNT_* values to the child container.
Under PIBOX_STATE_DIR (~/.aicodebox by default):
- Executables placed in
bin/are onPATHahead of everything else, for pi in every mode, for init scripts, and fordocker execshells. - Scripts placed in
init.d/*.shrun once per container, after the image's own init scripts, asaicodewith passwordless sudo. A failing script is logged and the rest still run. A new container runs them again, so make them safe to repeat.
Auth
For Anthropic-compatible endpoints, use the compatibility variables below. For LiteLLM or another OpenAI-compatible endpoint, use generic provider configuration.
Z.AI's GLM models are fast and cheap for most tasks — ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic + ANTHROPIC_MODEL=glm-4.6 is the recommended default.
pi's thinking levels (--thinking): off, minimal, low, medium, high, xhigh. Exposed as the /effort command in telegram mode and as thinking in API requests.
Agent integrations
The skill works in any agent that reads .agents/skills/ (such as peen). It tells agents to use the installed wrapper for local work and to use MCP only for an already-running remote server. It installs natively in the clients below.
Claude Code
Claude Code prompts for the pibox URL and, if auth is enabled, the API and MCP tokens — sensitive values are stored in your OS keychain.
Codex
Installed via the marketplace, the skill invokes as $pibox:pibox. Codex also picks the
skill up automatically with no install in any repo containing .agents/skills/, where it
invokes as plain $pibox.
OpenClaw
The skill is published to ClawHub on every release:
For MCP clients that speak local stdio, the @psyb0t/pibox plugin
bridges to the service's /mcp/ endpoint:
Then set PIBOX_URL (and PIBOX_MCP_MODE_TOKEN if the server was started with MCP auth
enabled).
Development
For one-shot GitHub jobs with read-only context, live tool logs, and collected output files, see the GitHub Action.
VERSION is read from pibox/pyproject.toml. make build pulls the published psyb0t/aicodebox base pinned in the Dockerfile; set SKIP_BASE_PULL=1 to use a locally-built base instead (e.g. from a sibling ../docker-aicodebox checkout), or override with make build BASE_IMAGE=....
Tests
End-to-end tests build the image and run it against a real LLM endpoint. Telegram tests use psyb0t/telethon-plus as a real MTProto userbot.
Telegram tests auto-skip if AICODEBOX_TELEGRAM_MODE_TOKEN is empty. The generic-provider tests use both Z.AI Coding Plan endpoints and reuse ANTHROPIC_AUTH_TOKEN unless ZAI_CODING_AUTH_TOKEN is set.
License
WTFPL — see LICENSE. Do what the fuck you want.
來源:README.md,提交 d6d2b56
工具
0版本歷史
8- v0.21.0最新Oct 24, 2026
- v0.20.2Oct 22, 2026
- v0.20.1Oct 20, 2026
- v0.20.0Oct 20, 2026
- v0.19.1Oct 10, 2026
- v0.19.0Oct 7, 2026
- v0.18.4Sep 23, 2026
- v0.18.3Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分