pi-mcp
pi-mcp
MCP 服务器,暴露 pi 编码代理工具:
read, bash, edit, write, grep, find, ls
使用 Bun 和 @modelcontextprotocol/server v2 构建。同时支持 2026-07-28 时代(server/discover)和 2025 时代的 initialize。
要求
Bun >= 1.2
rg和fd在PATH上(由grep/find使用;不下载)
安装
使用绝对路径。不要传递 . — Bun 的全局安装器可能会向 ~/.bun/install/global/package.json / bun.lock 写入重复的 pi-mcp 键和空的 "": "." 条目(oven-sh/bun#19559、oven-sh/bun#24207)。
bun add -g /absolute/path/to/pi-mcp
# same thing from the checkout:
bun add -g "$(pwd)"bun install -g 是 bun add -g 的别名;路径才是关键。二进制文件以 pi-mcp 的形式出现在 PATH 上(~/.bun/bin)。
对于本地开发,请在此目录中改用 bun link。
用法
pi-mcp # stdio (default)
pi-mcp --http --port 3000 # Streamable HTTP
pi-mcp --cwd /path/to/project
pi-mcp --readonly # read, grep, find, ls
pi-mcp --tools read,grep,ls
pi-mcp --shell /bin/bashFlag | Meaning |
| 通过 stdin/stdout 提供服务(默认) |
| 提供 Streamable HTTP 服务 |
| HTTP 绑定主机(默认 |
| HTTP 绑定端口(默认 |
| 工具工作目录 |
| 仅注册只读工具 |
| 逗号分隔的子集 |
| 用于 |
| 用于 HTTP DNS 重绑定保护的逗号分隔的 |
--stdio 不能与 --http / --host / --port 组合使用。
日志输出到 stderr。stdout 是 stdio 协议通道。
主机配置(stdio)
{
"mcpServers": {
"pi": {
"command": "pi-mcp",
"args": ["--cwd", "/path/to/project"]
}
}
}HTTP
pi-mcp --http --host 127.0.0.1 --port 3000向监听器发送 POST JSON-RPC。现代(2026-07-28)客户端使用 server/discover 以及每个请求的 _meta 信封和 Mcp-Method / MCP-Protocol-Version 头。2025 客户端使用 initialize。
工具
Tool | Role |
| 读取文本文件或图像(对于大文件使用 |
| 在 |
| 精确文本替换(与 pi 相同的强制转换:JSON 字符串 |
| 创建/覆盖文件,并创建父目录 |
| 使用 |
| 使用 |
| 列出目录 |
执行行为取自 pi 的编码代理工具。不包括 TUI 渲染、photon 图像调整大小以及自动 rg/fd 下载。
开发
bun install
bun src/cli.ts --help运行时依赖:@modelcontextprotocol/server、zod、diff。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server exposing the Backtest360 engine API as tools for AI agents.
A MCP server built for developers enabling Git based project management with project and personal…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhaob1n/pi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server