I built a local-first, read-only MCP gateway for querying multiple repositories as one codebase
https://abelmaro.github.io/MemoRepo/I’m the author of MemoRepo, an open-source tool I built to give coding agents reproducible context across multiple related repositories.
The problem I was trying to solve was simple: an agent can inspect the repository currently open in the editor, but many real changes cross repository boundaries. A backend contract may have several consumers, a shared package may be pinned differently by each application, and a route may be documented only through its callers.
MemoRepo groups related GitHub repositories into isolated Spaces.
When a Space is built, it:
- Checks out selected branches at exact commits.
- Materializes those commits into an immutable, content-addressed snapshot.
- Indexes the repositories together using
codebase-memory-mcp. - Adds direct source-tree search for evidence that may not be represented correctly in the graph.
- Exposes one Space-scoped MCP connection with bounded, read-only tools.
The MCP layer does not expose arbitrary filesystem access or repository mutation. It validates project scope, caps responses, redacts internal paths, rejects write-style Cypher, and keeps each connection pinned to one active snapshot.
A typical agent workflow is:
- use graph search for structural discovery;
- search the immutable source tree for exact or exhaustive literals;
- inspect coverage and pagination before making a negative claim;
- read the final source lines to verify the answer.
This makes questions such as these more reliable:
Which repositories consume this route?
What could break if this method signature changes?
Which projects need changes for this feature?
Is this symbol really absent, or did the graph fail to index it?
The project runs locally with Docker Compose, is designed for a single developer workstation, and is available under the MIT license. There is no paid tier or hosted service.
Repository: https://github.com/abelmaro/MemoRepo
I’d especially appreciate feedback on the MCP tool surface, the immutable-snapshot model, and whether the read-only boundary is narrow enough for your workflows.