Codebase Memory MCP for SRE Agents

Large production repositories are hard for agents to inspect under pressure. During an incident, the useful question is rarely "find every file with this string." It is "what calls this handler," "which service owns this route," or "what changes if this queue consumer moves." codebase-memory-mcp is trending because it turns those questions into graph queries an MCP client can use.
What Is codebase-memory-mcp?
codebase-memory-mcp is a local MCP server that indexes a repository into a persistent knowledge graph. It uses tree-sitter parsing across 158 languages, adds Hybrid LSP semantic type resolution for common production languages, and stores graph data locally. The project says it can answer structural queries in under 1 ms and index very large repositories without sending code to a remote service.
The important point for operators is the shape of the index. It captures functions, classes, call chains, HTTP routes, package links, and cross-service edges. It also indexes infrastructure-as-code, including Dockerfiles, Kubernetes manifests, and Kustomize overlays.
Why SRE Teams Should Care
- Faster incident orientation: ask for inbound callers, route owners, and likely blast radius before opening dozens of files.
- Lower token cost: graph queries replace repeated file reads and long context stuffing.
- Better change review:
detect_changesmaps uncommitted diffs to affected symbols and risk areas. - Useful platform context: Kubernetes resources and service routes become first-class nodes instead of plain text.
- Local processing: source stays on the workstation or build host, which matters for private infrastructure code.
Installation
For a quick local setup on macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
With the optional graph UI:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
After restarting the MCP client, index the target repository:
Index this project
Teams that prefer audit-first installs can download a release archive, verify checksums, and run the included installer manually.
Practical SRE Workflow
Use it as a read-only architecture lens before letting an agent propose changes. Good prompts are specific:
Show the inbound call path for the alert notification handler.
Map this git diff to affected HTTP routes and Kubernetes resources.
Find services that emit or listen on the incident-events channel.
List dead handlers that still have public routes or cron references.
That gives the agent structured context before it edits runbooks, changes service code, or explains a production failure. It is especially useful in monorepos where ownership boundaries, generated clients, and platform manifests drift over time.
Operational Tips
Start with read-only use in a staging clone. Review what gets indexed, decide whether to commit the optional compressed graph artifact, and document the MCP server in your agent setup notes. For regulated environments, pin release versions and verify checksums before rollout.
Do not treat graph output as authority by itself. Use it to narrow the search space, then confirm behavior with tests, logs, traces, or direct source review.
Conclusion
codebase-memory-mcp is not another chatbot layer. It is infrastructure for better agent context. For SRE teams experimenting with AI operations, that is the useful part: less blind exploration, more explicit architecture, and faster answers during change review or incidents.
Akmatori helps SRE teams connect agents to real operations workflows with the right context, tools, and guardrails. If you are building AI-assisted incident response or platform automation, explore Akmatori and deploy it on reliable cloud infrastructure from Gcore.
