@vforvaick/pi-codebase-memory-mcp

@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.

Category
Visit Server

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 manual cbm_index.
  • project is auto-inferred from the session cwd, so callers rarely pass it.

Prerequisites

  1. pi coding agent installed.
  2. codebase-memory-mcp binary on PATH. Install from upstream:
    curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
    
    Verify: codebase-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_end for edit / write / bash / ctx_execute / apply_patch (on success) -> mark dirty
  • user_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_BIN environment variable overrides the binary path. Default: codebase-memory-mcp (looked up on PATH).

Compatibility

  • Tested against codebase-memory-mcp v0.9.0.
  • Support policy: current + previous minor of codebase-memory-mcp.
  • Known v0.9.0 quirk: check_index_coverage returns "unknown tool" via MCP. This extension routes it through cli mode, where it works. Tool list parity (advertised vs callable) is tracked upstream.

Security

  • Runs the codebase-memory-mcp binary 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured