feat(cli): add pi-mcp-adapter install support - #663
Conversation
Add a `pi` field to cbm_detected_agents_t and detect the Pi agent (pi-mcp-adapter) by the presence of its ~/.pi/agent/ config directory, mirroring the existing Kiro/Cursor detection. List it in the "Detected agents" output. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Wire the Pi agent into the editor-style install and uninstall flows, mirroring Kiro/Cursor: write the codebase-memory-mcp entry to ~/.pi/agent/mcp.json (standard mcpServers format) via cbm_install_editor_mcp, and remove it on uninstall. Pi reads no instruction file, so none is written. Pi is also included in the install plan JSON. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Add cli_detect_agents_finds_pi (mirroring finds_kiro) and assert Pi is not detected in cli_detect_agents_none_found. The new test also covers Pi's nested-path detection: ~/.pi alone must not trigger, only ~/.pi/agent/ does. Register the test in the cli suite. Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
Add the Pi agent to the supported-agents lists and bump the agent count from 11 to 12 across README, the docs site, llms.txt, and the npm package README. Add a Pi row to the README agent config table (~/.pi/agent/mcp.json; no instruction file or hooks). Signed-off-by: kangxl <230263957+zh-xl-kang@users.noreply.github.com>
|
Huge thanks for opening this PR and for the work you put into it. The maintainer shop is currently full, so this may sit for a bit before it gets a proper review. We will come back to this as soon as possible with real feedback; I wanted to make sure it did not sit unacknowledged in the meantime. |
|
Thanks. This overlaps with #534 but uses a different Pi integration model. Before merge, maintainers should choose one path; please add an authoritative reference that Pi/ |
|
Thanks for the feedback! Here are the authoritative references: Official Documentation: https://github.com/nicobailon/pi-mcp-adapter The README explicitly states the file precedence, including:
Regarding Regarding #534: This PR focuses on install/uninstall support for pi-mcp-adapter itself (the adapter tool), not the Pi agent binary. The detection checks for Let me know if you need additional clarification on the integration model! |
|
After further analysis and discussion, I'm closing this PR in favor of #534 which takes the better architectural approach. Reasoning:
Happy to review or help test #534 if needed. Thanks for the consideration, @DeusData. |
|
Thanks for the clarification and for closing this in favor of a single Pi integration path. We’ll evaluate #534 separately since it uses the native extension install path and needs a more focused review. |
Summary
Add install/uninstall support for pi-mcp-adapter, a third-party tool that adds MCP support to the Pi coding agent.
Note: This is distinct from #534, which adds native Pi support via extensions. This PR specifically supports the pi-mcp-adapter workflow for users who have that adapter installed.
Context
Pi's official README states: "No MCP. Build CLI tools with READMEs (Skills), or build an extension that adds MCP support."
The pi-mcp-adapter is a community tool that bridges this gap by adding MCP support to Pi. This PR adds codebase-memory-mcp install/uninstall support for users who have pi-mcp-adapter installed.
Changes
cli.c: Addinstall_pi_mcp_adapter()anduninstall_pi_mcp_adapter()functions~/.pi/agent/(Pi agent directory) AND~/.pi/agent/mcp.json(pi-mcp-adapter config file)mcpServersentry to~/.pi/agent/mcp.jsoncli.h: Add function declarationstest_cli.c: Add test cases for install/uninstall lifecycleUsage
Users who have both Pi agent and pi-mcp-adapter installed can now run:
Users without pi-mcp-adapter should use #534's native extension-based integration instead.
Testing
~/.pi/agent/mcp.json