@fitchmultz/pi-mcp-adapter

中文文档
8.0.43发布于 2026/11/15MITTypeScriptES Module构建来源已验证近 30 天下载 9394

Token-efficient MCP adapter for the Pi coding agent

原始使用文档
文档目录7 节
  1. Install
  2. First use
  3. Controls and settings
  4. More server features
  5. Warnings and platform limits
  6. Documentation
  7. License and background

Fitch MCP Adapter

Connect Pi to MCP servers for browsers, databases, and APIs. The adapter loads selected tool schemas when needed to keep large catalogs out of the conversation context.

Pi sends a task to the adapter. The adapter discovers tools, calls local or remote servers, and returns results with files for large text.

Install

Check the Pi and Node.js requirements.

pi install npm:@fitchmultz/pi-mcp-adapter
pi

Restart Pi if it was open during installation. Load only one adapter per Pi host. For legacy adapter state, read the upgrade guide before you restart Pi.

For a Git install, run pi install git:github.com/fitchmultz/pi-mcp-adapter.

First use

Enter /mcp setup to add a server or import configs from other hosts. Preview the changes before you save them. The adapter leaves external host files unchanged.

The adapter reads .mcp.json and ~/.config/mcp/mcp.json automatically. Pi loads project configs only after project trust. See config paths and precedence.

For Chrome DevTools, create .mcp.json in your project:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp"]
    }
  }
}

Run /reload after config changes. Ask Pi:

Use Chrome DevTools to take a screenshot of the current page.

By default, servers connect when Pi discovers an uncached catalog or calls a tool. Cached catalogs register as deferred Pi tools without a connection: Pi's tool_search loads the ones a task needs, codemode scripts can call them directly, and the mcp gateway discovers servers that have no cached catalog yet.

Controls and settings

CommandPurpose
/mcpShow servers and pin tools
/mcp statusShow connection state and tool/resource counts
/mcp reconnect <server>Reconnect and refresh the catalog
/mcp-auth <server>Start OAuth in an interactive session
/mcp disable <server>Disable the server for this project; apply with /reload
/mcp enable <server>Enable the server for this project; apply with /reload

Use directTools to pin tools at startup. Other tools stay deferred until tool_search loads them. Like Pi's own MCP extension, the adapter activates a registered tool_search when it registers deferred tools, once per session start or tree navigation; a branch that recorded removing tool_search keeps it off. Gateway search covers known catalogs; mcp({ action: "connect", server }) discovers an unknown catalog.

Use approveTools to require confirmation before sensitive calls. Matching calls fail in headless sessions without approval.

More server features

The adapter supports resources and prompt templates. Prompt commands use /mcp__<server>__<prompt> names.

MCP Apps open interactive UIs in a browser or through Glimpse on macOS. Apps can send messages to Pi. Try the interactive visualizer.

Use Pi's codemode tool for loops and dependent tool calls. See gateway examples for exact call shapes.

Warnings and platform limits

MCP servers can execute programs or access accounts. Check server commands and account access before you trust a project config.

OAuth requires an available OS credential store. Unlock a Secret Service-compatible keyring on headless Linux. The adapter has no plaintext fallback. See the OAuth guide for remote sign-in.

Android and Termux do not support persistent OAuth by default. Unauthenticated, header-token, and stdio servers work. Git/source builds require an Android-native tsgo compiler. Use the precompiled npm package if you have no compiler. See Android build details.

The adapter saves text above the default 50 KiB or 2,000-line limit to local files. Saved results and App histories can contain sensitive data. Remove files when you no longer need them. See output handling and readback.

If App history cannot be saved, reload or exit discards unsaved messages. Retrieve pending messages before either action. See App history and recovery.

Documentation

License and background

Mitch Fultz maintains Fitch MCP Adapter under the MIT license. Mario Zechner discusses tool schema costs in his article about MCP.

Watch the adapter demo.

版本与发布记录

@fitchmultz/pi-mcp-adapter 共发布 49 个版本,首次发布于 2026/09/20;过去 12 个月发布了 49 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
8.0.43latest2026/11/15今天
8.0.422026/11/131 天前
8.0.412026/11/132 天前
8.0.402026/11/122 天前
8.0.392026/11/122 天前
8.0.382026/11/122 天前

关于 @fitchmultz/pi-mcp-adapter 的常见问题

@fitchmultz/pi-mcp-adapter 是什么?

Token-efficient MCP adapter for the Pi coding agent

如何安装 @fitchmultz/pi-mcp-adapter?

在项目目录运行 npm install @fitchmultz/pi-mcp-adapter,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 fitch-mcp-adapter,可以用 npx fitch-mcp-adapter 直接运行。

@fitchmultz/pi-mcp-adapter 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fitchmultz/pi-mcp-adapter 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fitchmultz/pi-mcp-adapter 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^24.22.3 || >=26.13.1。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fitchmultz/pi-mcp-adapter 可以商用吗?

@fitchmultz/pi-mcp-adapter 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fitchmultz/pi-mcp-adapter 的下载量有多少?

根据 npm 官方下载统计,@fitchmultz/pi-mcp-adapter 在 2026/10/15 – 2026/11/13 这 30 天内被下载 9,394 次,日均约 313 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fitchmultz/pi-mcp-adapter 还在维护吗?

最新版本 8.0.43 发布于 2026/11/15(今天);至今共发布 49 个版本,其中过去 12 个月发布了 49 个;首次发布于 2026/09/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。