This plan records the port from Codebase Memory MCP to Codebase Memory CLI. The fork removes the MCP server and third-party MCP integration surface for workplace environments whose rules prohibit third-party MCP servers, while retaining the local indexing and code-intelligence engine.
Turn codebase-memory-mcp into a local command-line application and stop
exposing or starting an MCP server.
- The indexing engine and knowledge-graph storage.
- Existing graph operations and their schemas.
- The current one-shot
cliexecution path as the foundation. - JSON output for scripting, with normal CLI exit codes.
- Local configuration, locking, and temporary indexing workers where they are still needed by commands.
- Default stdin/stdout MCP JSON-RPC server mode.
- Long-lived daemon lifecycle and daemon IPC.
- HTTP graph UI and its embedded assets.
- MCP transport-specific code and server startup paths.
- MCP configuration generation and cleanup for coding-agent clients.
- MCP-only hooks, profiles, and documentation.
The internal cbm_mcp_server implementation may be retained temporarily if it
is the existing dispatcher used by CLI commands. It must not remain an
externally reachable MCP server; rename it later only if that improves clarity
without duplicating the dispatch layer.
codebase-memory-cli index --repo-path .
codebase-memory-cli search-graph --name-pattern '.*Handler.*'
codebase-memory-cli projects
codebase-memory-cli trace --function MyFunction
Keep a compatibility cli <tool> ... form during migration if existing
scripts depend on it. Deprecate it only after equivalent named commands and
documentation exist.
- Inventory the current
main.cdispatch, CLI handlers, tool registry, daemon, UI, installer, and tests. - Make CLI dispatch the only normal entry point; reject MCP/JSON-RPC startup with a clear error during the transition.
- Move or reuse tool dispatch behind ordinary CLI commands and define stable stdout, stderr, and exit-code behavior.
- Remove daemon, UI, and MCP transport build targets and dead includes once no CLI path depends on them.
- Remove MCP client configuration and hook installation from the installer.
- Update README, configuration docs, packaging metadata, examples, and help text to describe the CLI product.
- Replace MCP handshake/server smoke tests with CLI command, JSON output, mutation-lock, indexing, and end-to-end executable tests.
- Run the normal build, test, packaging, and artifact-integrity gates.
- Running the binary without CLI arguments never starts a server or daemon.
- No process listens on a network port after any supported CLI command.
- No MCP configuration is installed or modified.
- Core indexing and graph queries work from a clean installation.
- Commands return nonzero status for invalid input and operational failures.
--jsonoutput is machine-readable and stdout contains no progress noise.- Existing user data and graph indexes remain readable, or a documented migration is provided.
- Source and release artifacts contain no enabled MCP server entry point.
Do not rewrite the graph engine or add a new command framework. The first version should reuse the existing C CLI parser and tool registry. A separate daemon or web UI can be restored later only as an explicitly supported product surface.