@vforvaick/pi-codebase-memory-mcp
MCP server that wraps codebase-memory-mcp to provide code indexing, search, tracing, and architecture analysis tools with automatic reindexing after source changes.
README
@vforvaick/pi-codebase-memory-mcp
Unofficial pi coding agent extension wrapping the codebase-memory-mcp binary.
Not affiliated with DeusData/codebase-memory-mcp. MIT.
What it does
- Registers 9
cbm_*tools the LLM can call:cbm_index,cbm_projects,cbm_search,cbm_trace,cbm_architecture,cbm_snippet,cbm_query(Cypher),cbm_changes(impact analysis),cbm_coverage. - Freshness gate: auto-reindexes the graph (mode=
moderate) before any read query when source has changed. The CBM binary's native watcher is inert in CLI / MCP-stdio mode (its daemon worker log stays 0 bytes, never fires), so without this gate the graph goes stale after every edit until a manualcbm_index. projectis auto-inferred from the session cwd, so callers rarely pass it.
Prerequisites
- pi coding agent installed.
codebase-memory-mcpbinary onPATH. Install from upstream:
Verify:curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bashcodebase-memory-mcp --version.
Install
pi install npm:@vforvaick/pi-codebase-memory-mcp
After install, restart pi.
Usage
In any repo:
cbm_index # one-time index (mode=moderate)
cbm_search .*Router.* # find symbols
cbm_trace myFunction --direction both
cbm_architecture
Once indexed, the graph auto-refreshes after edits (see Freshness gate below). Tools auto-appear in the function list.
Freshness gate
The extension keeps a per-cwd dirty flag, bumped by pi lifecycle hooks:
session_start-> mark cwd dirty (forces one reindex on first query, catches cross-session drift)tool_execution_endforedit/write/bash/ctx_execute/apply_patch(on success) -> mark dirtyuser_bash-> mark dirty conservatively
Before each read query (cbm_search, cbm_trace, etc.) the extension calls ensureFresh(cwd): if the cwd is dirty or git HEAD has drifted since the last index, it reindexes (mode=moderate) then serves the query. Race-safe via a per-cwd in-flight lock + dirty generation counter.
What the gate does NOT catch: mutations from external editors or other terminals (VSCode, sed in another shell) after the first query in a session. For those, run cbm_index manually.
Configuration
CBM_BINenvironment variable overrides the binary path. Default:codebase-memory-mcp(looked up onPATH).
Compatibility
- Tested against
codebase-memory-mcpv0.9.0. - Support policy: current + previous minor of
codebase-memory-mcp. - Known v0.9.0 quirk:
check_index_coveragereturns "unknown tool" via MCP. This extension routes it throughclimode, where it works. Tool list parity (advertised vs callable) is tracked upstream.
Security
- Runs the
codebase-memory-mcpbinary with the same filesystem access as your pi session. - No telemetry. No network calls. Source is open - review before install.
- pi packages run with full system access; review the source at the repo before installing.
License
MIT. (C) vforvaick.
Contributing
PRs welcome at github.com/vforvaick/pi-codebase-memory-mcp.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。