pi-codebase-memory-mcp

Pi package that bridges the codebase-memory-mcp server into pi as native tools — a tree-sitter knowledge graph for fast structural code search, call-path tracing, architecture overviews, and impact analysis.

Packages

Package details

extensionskill

Install pi-codebase-memory-mcp from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-codebase-memory-mcp
Package
pi-codebase-memory-mcp
Version
0.1.2
Published
Jun 18, 2026
Downloads
not available
Author
porameht
License
MIT
Types
extension, skill
Size
12.2 KB
Dependencies
1 dependency · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-codebase-memory-mcp

A pi package that bridges the codebase-memory-mcp server into pi as native tools. Gives your agent a fast, local tree-sitter knowledge graph of your repos — structural code search, call-path tracing, architecture overviews, and change-impact analysis in milliseconds, with far fewer tokens than file-by-file grepping.

Requirements

The codebase-memory-mcp binary installed locally:

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

(macOS/Linux; Windows via install.ps1. Also on Homebrew, Scoop, AUR, npm, PyPI.) The binary is resolved from CBM_MCP_BIN, then ~/.local/bin/codebase-memory-mcp, then your PATH.

Install

pi install npm:pi-codebase-memory-mcp

Or try it without installing:

pi -e npm:pi-codebase-memory-mcp

What you get

  • Extension — spawns the local codebase-memory-mcp server over stdio, discovers its tools dynamically, and registers each as a pi tool with a cbm_ prefix.
  • cbm_connect tool — always available, so the agent can start (or restart) the server mid-session and pick up newly discovered tools immediately.
  • Safety gatecbm_delete_project pops a confirmation dialog before wiping a project's graph (disable with CBM_CONFIRM=off).
  • Skillcodebase-memory, teaching the agent the index → search → trace → query workflow.

Tools (discovered dynamically)

Indexing: cbm_index_repository, cbm_list_projects, cbm_delete_project, cbm_index_status

Querying: cbm_search_graph, cbm_trace_path, cbm_detect_changes, cbm_query_graph, cbm_get_graph_schema, cbm_get_code_snippet, cbm_get_architecture, cbm_search_code, cbm_manage_adr, cbm_ingest_traces

Example prompts

  • "Index this project."
  • "What calls ProcessOrder?"
  • "Find every function matching .*Handler.*."
  • "Give me an architecture overview of this repo."
  • "What's the blast radius of my current git changes?"
  • "Show the source for the Search function."

Configuration

Environment variable Default Purpose
CBM_MCP_BIN (auto) Absolute path to the codebase-memory-mcp binary (overrides auto-detection)
CBM_CONFIRM on Set to off to skip the confirmation dialog for cbm_delete_project

Notes

  • Tools are discovered at connection time; the set may change between server versions.
  • If the binary isn't installed when pi starts, pi still starts normally — install it, then ask the agent to connect (cbm_connect).
  • Index with an absolute repo_path. After the first index, a background watcher keeps the graph fresh.

License

MIT