
MCP服务器将Pi编码代理变成可引导的后台工作者:委托任务,在运行中重定向,且不涉及自己的上下文。
概览
MCP服务器将pi编码代理作为工作对象暴露。 指向 Claude Code(或任何 MCP 主机),并将工作委派给 pi 的 ~38 个服务提供者(DeepSeek、Grok、GLM、Kimi、Qwen、Codex、OpenRouter、本地llama.cpp),且子代理的上下文不进入你的主对话。 你的主线束运行在一个昂贵的模型上,有一个你关心的上下文窗口。它做的很多工作不需要这个模型,反而会破坏上下文:为每个呼叫站点做一个仓库,为了回答一个问题读取2000行的文件,审计重构留下的遗留情况。 - 繁重工作运行在 DeepSeek、GLM、Kimi、Qwen 或本地 llama.cpp。你只为真正需要这些工作的理由支付前沿价格。- 代理用自己的预算读取文件并返回结果。它读取的 200 KB 文件从未进入你的对话。- 代理默认为只读(read, grep, find, ls),在会话构建时强制执行。
概述(AI 翻译)
MCP服务器将pi编码代理暴露为可委托、可引导的工作者。
指向 Claude Code(或任何 MCP 主机)来处理,并将工作委派给 pi 的 ~38 个提供商 (DeepSeek、Grok、GLM、Kimi、Qwen、Codex、OpenRouter、本地 llama.cpp)与子代理的 背景,不要进入你们的主要对话。
这是干什么的
你的主线束运行在一个昂贵的型号上,并且有一个你关心的上下文窗口。很多内容 它不需要那个模型,而且实际上破坏了上下文:为每个 grepo 创建仓库 打电话给网站,阅读一个2000行的文件来回答一个问题,审计重构留下的成果。
把这些工作交给代表:
- 成本。 苦力工作由DeepSeek、GLM、Kimi、Qwen或本地llama.cpp承担。你付钱 边境价格仅仅基于真正需要它们的理由。
- **上下文。**代理在自身预算内读取文件并返回结果。200 KB 阅读从不出现在你的对话中。
- 爆炸半径。 代理默认为只读(
read, grep, find, ls),执行于 会话构建。一个廉价模型做探索工作,除非你亲自接触你的树 选择加入。
代表永远是PI代理。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
██████╗ ██╗ ██████╗ ███████╗██╗ ███████╗ ██████╗ █████╗ ████████╗███████╗
██╔══██╗██║ ██╔══██╗██╔════╝██║ ██╔════╝██╔════╝ ██╔══██╗╚══██╔══╝██╔════╝
██████╔╝██║ ██║ ██║█████╗ ██║ █████╗ ██║ ███╗███████║ ██║ █████╗
██╔═══╝ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║██╔══██║ ██║ ██╔══╝
██║ ██║ ██████╔╝███████╗███████╗███████╗╚██████╔╝██║ ██║ ██║ ███████╗
╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝
███╗ ███╗ ██████╗██████╗
████╗ ████║██╔════╝██╔══██╗
██╔████╔██║██║ ██████╔╝
██║╚██╔╝██║██║ ██╔═══╝
██║ ╚═╝ ██║╚██████╗██║
╚═╝ ╚═╝ ╚═════╝╚═╝
MCP server that exposes the pi coding agent as a delegable, steerable worker.
Point Claude Code (or any MCP host) at it and delegate work to any of pi’s ~38 providers (DeepSeek, Grok, GLM, Kimi, Qwen, Codex, OpenRouter, local llama.cpp) with the sub-agent’s context staying out of your main conversation.
What it’s for
Your main harness runs on an expensive model, with a context window you care about. A lot of what it does doesn’t need that model, and actively damages that context: grepping a repo for every call site, reading a 2000-line file to answer one question, auditing what a refactor left behind.
Hand that work to a delegate instead:
- Cost. The grunt work runs on DeepSeek, GLM, Kimi, Qwen, or a local llama.cpp. You pay frontier prices only for the reasoning that actually needs them.
- Context. The delegate reads the files on its own budget and returns a result. The 200 KB it read never enters your conversation.
- Blast radius. Delegates are read-only by default (
read, grep, find, ls), enforced at session construction. A cheap model doing exploratory work cannot touch your tree unless you opt it in.
The delegate is always the pi agent. Codex, Grok, DeepSeek and the rest supply the model behind it; this is not a wrapper around their CLIs.
Why pi, and not opencode or a CLI wrapper?
A delegate is only steerable if two channels stay open: you must be able to redirect it mid-task, and it must be able to ask you something and block until you answer. Most ways of driving a coding agent from another program close both.
pi -p / CLI wrappers |
opencode SDK | this server |
|---|
安装
npx -y pi-delegate-mcp配置
{
"mcpServers": {
"pi": {
"command": "npx",
"args": ["-y", "pi-delegate-mcp"],
"env": { "PI_DELEGATE_MODEL": "openrouter/stealth/ox-alpha" },
"timeout": 1800000
}
}
}