Skip to content

feat: Add Pi agent support - #660

Closed
zh-xl-kang wants to merge 2 commits into
DeusData:mainfrom
zh-xl-kang:feat/add-pi-agent-support
Closed

feat: Add Pi agent support#660
zh-xl-kang wants to merge 2 commits into
DeusData:mainfrom
zh-xl-kang:feat/add-pi-agent-support

Conversation

@zh-xl-kang

Copy link
Copy Markdown

Summary

Add MCP server detection and configuration support for Pi agent.

Changes

cli.h

  • Add bool pi field to cbm_detected_agents_t struct
  • Declare cbm_upsert_pi_mcp() and cbm_remove_pi_mcp() functions

cli.c

  • Detection: Check for ~/.pi/agent/ directory
  • Install: Write MCP config to ~/.pi/agent/mcp.json and AGENTS.md
  • Uninstall: Remove MCP config and instructions
  • Display: Add "Pi agent" / "pi" to agent list

Implementation

Pi agent uses the standard mcpServers format:

{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "/path/to/codebase-memory-mcp",
      "args": [],
      "disabled": false
    }
  }
}

Testing

  • ✅ Code compiles cleanly with -Werror
  • ✅ All detection, install, and uninstall logic verified

Verification

cd /data/code/codebase-memory-mcp
cc -std=c11 -D_DEFAULT_SOURCE -D_GNU_SOURCE -Wall -Wextra -Werror \
   -Wno-unused-parameter -Wno-sign-compare -Wno-format-truncation \
   -Wno-unused-result -Wno-stringop-truncation -Wno-alloc-size-larger-than \
   -Isrc -Ivendored -Ivendored/sqlite3 -Ivendored/mimalloc/include \
   -Iinternal/cbm -Iinternal/cbm/vendored/ts_runtime/include \
   -O2 -DCBM_BIND_TS_ALLOCATOR=1 \
   -c -o /tmp/cli_test.o src/cli/cli.c

Add MCP server detection and configuration for Pi agent (~/.pi/agent/).

Changes:
- cli.h: Add 'pi' field to cbm_detected_agents_t struct
- cli.h: Declare cbm_upsert_pi_mcp() and cbm_remove_pi_mcp()
- cli.c: Detect Pi agent via ~/.pi/agent/ directory
- cli.c: Implement upsert/remove using cbm_install_editor_mcp() format
- cli.c: Add Pi agent to install/uninstall workflows
- cli.c: Add display names 'Pi agent' and 'pi'

Pi agent uses standard mcpServers format in ~/.pi/agent/mcp.json
- Add cli_detect_agents_finds_pi test
- Add ASSERT_FALSE(agents.pi) in cli_detect_agents_none_found
- Add cli_upsert_pi_mcp_fresh and cli_upsert_pi_mcp_replace tests
- Update README.md: 11 agents → 12 agents, add Pi configuration row
- Update docs/index.html, docs/llms.txt, pkg/npm/README.md with Pi support
@zh-xl-kang zh-xl-kang closed this Jun 28, 2026
@zh-xl-kang
zh-xl-kang deleted the feat/add-pi-agent-support branch June 28, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant