
原型MCP标准桥接Pi保存和桥接拥有会话。五个工具、独立的合成提供者测试及文档化的限制。
概览
这是一个本地、厂商无关的MCP服务器,用于保存Pi会话、桥接自有的RPC工作者以及合作的普通Pi TUI/RPC主机。它通过stdio或认证回环流式HTTP暴露列表、读取、发送、停止、重叠、创建、删除和排序批处理。 集成使用公共的 Pi API 和私有 Unix 套接字,独立于任何主机项目。协作进程身份/附件目前需要 Linux。原生工具、模型、设置、扩展和现有认证仍由 Pi 负责。 需要节点>=22.19.0;回归检查使用节点26.10.0和Pi 1.1.0。 演示使用一次性合成会话和明确隔离、工具禁用的 Pi 配置文件,没有真实模型凭证。初始化保留现有演示配置;确保重用配置明确选择隔离。最后命令在 stdin/stdout 上使用 MCP。示例客户端配置: 关于独立运行桥接,请参见环回HTTP。
概述(AI 翻译)
通过MCP暴露本地Pi会话,拥有所有者控制权限,每个会话由一名合作写入者。本地客户端使用stdio;多个或远程客户端在认证隧道后共享环回HTTP服务。
它的作用
- 列出授权会话,读取本地历史,配置扩展视图或捕获的请求上下文。
- 发送文本和图片,运行本地shell命令,选择模型/思维设置,压缩上下文并停止工作。
- 创建或分支会话,并将已删除的会话迁移到可恢复的废弃物,同时保留项目文件。
- 通知ChatGPT工作聊天和点,当桥接会话稳定时,并附带叶子ID以读取该结果。
- 批量独立操作,并在默认情况下应用七个独立权限,分别是项目层级和会话层级。
每次变异调用都会执行一个新操作。在丢失或未知结果后,先检查list/read,然后决定是否再次提交;自动重试可以重复工作。发送表示承认,而非模型完成。请参见公共API。
从本地开始
需要Linux、Node.js 22.19或更高版本,以及你自己的Pi安装(用Pi 1.4.0测试过)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Pi MCP Bridge
Expose native Pi sessions through MCP, with owner-controlled permissions and one cooperating writer per session. Local clients use stdio; multiple or remote clients share a loopback HTTP service behind an authenticated tunnel.
What it does
- List authorized sessions, read recent turns in source order, search effective context and expand referenced messages or evidence.
- Read native Session Context, captured Runtime Context or explicitly enabled extension readers.
- Send text and images, run native shell commands, select model/thinking settings, compact context, reload idle sessions and stop work.
- Create or fork saved sessions, optionally sending a first task, and move deleted sessions to recoverable trash while retaining project files.
- Notify ChatGPT Work chats and dots when an owned RPC or connected TUI/RPC companion settles, with a short result excerpt and pinned native reading arguments.
- Batch independent operations and apply seven separate permissions at default, project and session tiers.
See working with a session for the dispatch, observation and continuation workflow, and the public API for tool arguments and outcomes.
Start locally
Requires Linux, Node.js 22.19 or later, and your own Pi installation (tested with Pi 1.4.0). Install and configure Pi first; Bridge uses that installation’s CLI, SDK and native authentication. Set piExecutable to an absolute Pi CLI path, or let the launch environment’s PATH select pi.
Get the source and prepare an owner configuration. Use absolute paths below, replacing the private directory with your chosen location:
command -v pi
pi --version
git clone https://github.com/XWIlluDelu/pi-mcp-bridge.git
cd pi-mcp-bridge
npm ci
mkdir -p -m 700 /absolute/private/path
cp deploy/owner.example.json /absolute/private/path/owner.json
chmod 600 /absolute/private/path/owner.json
Edit owner.json using configure one project: select the native session storage and project, then add its permission grant. The example denies all operations until you grant them. That guide also explains how storage paths differ from project paths and which directories must be private.
If the target session is already open in Pi, load its companion before remote control. Bridge can resume an inactive saved session itself. Use matching Bridge control components; live reads follow the independent read contract.
For one stdio MCP client:
{
"command": "node",
"args": ["/absolute/path/to/pi-mcp-bridge/src/server.mjs", "/absolute/private/path/owner.json"]
}
For multiple clients, start one HTTP service and use src/stdio-proxy.mjs for stdio-only clients. Transport setup covers tokens, tunnels and protocol versions.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →