pi-cmp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pi-cmpWhat would break if I change UserRepository?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pi-cmp · Codebase Memory
Codebase Memory tools (cbm_*) for pi. They answer structural questions about a codebase from a local tree-sitter knowledge graph — before pi falls back to slow grep/read loops.
The extension proxies each tool call to the codebase-memory-mcp server, which maintains a graph of symbols, call chains, and relationships per project.
Quick start
cd /path/to/this/repo
pi install "$(pwd)"Then /reload in pi (or restart pi) and verify:
pi listRelated MCP server: fw-context-mcp
What's included
Extension tools only — no MCP configuration to maintain. The extension spawns and talks to the local codebase-memory-mcp server itself.
Tool | Description |
| Symbol search by name pattern or natural-language query |
| Call chains: who calls a function (inbound), what it calls (outbound) |
| Full source for one symbol with metrics |
| High-level codebase overview (languages, entry points, hotspots) |
| Literal text / exact identifier search over indexed files |
| Node/edge labels and relationship patterns |
| Read-only openCypher queries |
| Map git changes to affected symbols with blast radius |
| All indexed projects with node/edge counts |
| Index health (indexed, stale, or missing) with git-HEAD freshness proof |
| Index a repository (one-time; auto-sync keeps it fresh) |
| Remove a project from the knowledge graph (requires UI confirmation) |
| Create, update, or read Architecture Decision Records |
| Ingest runtime traces to validate service-to-service edges |
Requirements
Node.js 22.19.0 or newer
The
codebase-memory-mcpserver binary onPATH, or point theCBM_BINARYenvironment variable at it
codebase-memory-mcp is a separate project; install it from its own source before using these tools.
Usage
1. Start pi inside a project
cd /path/to/project
pi2. Index the project (once)
Ask pi:
Index this project with cbm_index_repository.Subsequent queries use the local .codebase-memory/ index in the project.
3. Ask structural questions
Good prompts:
Use Codebase Memory. Explain how authentication reaches the request handler.
Use Codebase Memory. What calls PlanBoostSession?
Use Codebase Memory. What would break if I change UserRepository?
Use Codebase Memory. Show files under internal/services and important symbols.Tool choice
cbm_get_architecture/cbm_search_graphfor broad "how does this work?" questionscbm_trace_pathwhen you already know a function name and want callers/calleescbm_search_graphfor declarations and symbol names, not arbitrary textcbm_search_codefor literal text, exact identifiers, or distinctive stringscbm_detect_changesbefore refactors — blast radius of uncommitted changes
How it works
pi extensions are not MCP configuration files. This package registers native pi tools, and each tool proxies one JSON-RPC request to the local codebase-memory-mcp process over stdio:
pi agent
-> pi-cmp extension tool
-> codebase-memory-mcp process (cwd = your project)
-> .codebase-memory/ graph database in the current project
-> structured result back to piAdditional behavior:
On
session_startthe project cache is reset;before_agent_startinjects tool-choice guidance into the system prompt.Tools default to the project matching pi's current working directory; pass
projectexplicitly (seecbm_list_projects) to query others.cbm_index_statuscompares the indexed git HEAD against the repository's current HEAD for real freshness proof (no fabricated timestamps).cbm_delete_projectrequires interactive confirmation when pi has a UI.Long-running tools (
cbm_index_repository) use a 10-minute timeout; others default to 20 seconds. Errors surface as diagnostics with secrets redacted.
Development
npm install
npm run typecheck # tsc --noEmit
npm test # vitest runInstall the local checkout into pi:
pi install /path/to/pi-cmpRepository layout
pi-cmp/
├── extensions/ # extension source only (logic lives here)
│ ├── index.ts # entry point: registers tools, injects guidance
│ ├── tools.ts # cbm_* tool definitions (typebox schemas)
│ ├── mcp-client.ts # spawns codebase-memory-mcp, JSON-RPC over stdio
│ ├── project.ts # project resolution from list_projects output
│ └── sync-check.ts # git-HEAD freshness annotation for index_status
├── __tests__/ # vitest tests (mirror the files above)
├── package.json # pi manifest: "pi": { "extensions": ["./extensions"] }
└── tsconfig.jsonThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceKnowledge graph for token-efficient code reviews. Builds a structural map of your codebase with Tree-sitter, tracks changes incrementally, and gives AI agents precise context via MCP tools. Features fixed multi-word search, qualified call resolution, dual-mode embedding (ONNX local + LiteLLM cloud), and output pagination.Last updated765Apache 2.0
- AlicenseAqualityAmaintenanceExposes tools for AI assistants to query a persistent SQLite+FTS5 index of C/C++ symbols parsed from real build commands, enabling sub-millisecond lookup, full-text search, and natural-language explanation without hallucination.Last updated336MIT
- Alicense-qualityCmaintenanceProvides a semantic understanding of your codebase by parsing with tree-sitter and building a graph of symbols and dependencies. Enables AI assistants to navigate code, analyze changes, and discover architecture using 18 tools with minimal context overhead.Last updated161MIT
- Alicense-qualityBmaintenanceLocal-first MCP-style code memory for research repositories: enables file search, Python symbol extraction, import graph, and repo context packs.Last updatedMIT
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/songpham/pi-cmp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server