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使用;不下载)
Related MCP server: emcp
安装
使用绝对路径。不要传递 . — 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 deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for agentverse documentation, generated by doc2mcp.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA comprehensive MCP server providing secure tools for filesystem operations, Git management, web search, document conversion, npm/.NET project management, and AI generative capabilities (image/video/audio generation and processing) via PiAPI.ai integration.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceMCP server providing filesystem operations, shell execution, and web search capabilities.-
- FlicenseAqualityDmaintenanceA simple MCP server that exposes a terminal tool, allowing AI agents to execute shell commands.1-
- AlicenseNot gradedqualityCmaintenanceLocal MCP server enabling Codex and ChatGPT to read/write files, execute commands, manage processes, use Git, and inspect images on the user's machine with full privileges.Apache 2.0