Local code search for AI agents: hybrid ranked search and SQL aggregation over an in-repo index.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
code-context is the retrieval layer under your coding agent: one local index over the whole repo (keyword, semantic, hybrid, and SQL), reached through an MCP server and a CLI, with the index living in plain files inside your repo. Your agent answers questions about the codebase without reading it file by file.
The rule of thumb: the more a question spans the repo, the more this saves, because the answer comes from a ranked index instead of pulling source into context one file at a time.
On your own codebase, ~30-40% fewer tokens and ~50% fewer tool calls (so answers land faster too - aggregation questions run about 2Γ quicker). The harness is in the repo, so you can reproduce it on your own code.
Try it live (early preview): ask questions about any public GitHub repo at lantern.infino.ai, a demo agent that runs on code-context.
path:line citations.GROUP BY.Built on infino, a fast retrieval engine that runs SQL, full-text search, and vector search over a single copy of your data. Text and numeric data is stored as spec-compliant Parquet, and the same engine handles logs, docs, and agent memory.

Claude Code answering questions about a repo through code-context: index it, then ask, and it reaches for search and SQL on its own.
Install the Claude Code plugin - nothing to paste into a config:
It registers code-context's three tools with alwaysLoad already set, so the
agent keeps them in view and reaches for the index directly instead of falling
back to plain file search.
Not on Claude Code, or prefer a one-line command? Add it as an MCP server:
The alwaysLoad flag pins this small tool set so that in a setup with many MCP
servers - where clients defer tool definitions behind a tool-search step - the
agent doesn't miss the index and fall back to plain file search. (Use either
the plugin or this command, not both.)
Then just ask a question about the code. The first search or sql on an
unindexed repo builds the index inline and answers on the same call: keyword
search is live in seconds, and vectors backfill in the background. (Prefer to
kick it off yourself? The reindex tool does the same build on demand.)
CI-tested on Linux x64 (glibc) and macOS arm64; linux-arm64, musl, and Windows-via-WSL are expected to work through the engine's prebuilt bindings but are not CI-covered.
Real agent runs over a codebase-Q&A suite (claude-sonnet-4-6, the same minimal prompt for both lanes), on a repo the model has not memorized - infino, the engine this is built on - because that is the realistic case for your private code. Baseline is stock file tools including Bash; the code-context lane is the same tools plus the MCP server. Measured on three axes:

| Category | Tokens | Tool calls | Wall time |
|---|---|---|---|
| Aggregation ("most code about X") | -43% | -71% | -48% |
| Comprehension ("how does X work") | -29% | -27% | -13% |
| Blended | -32% | -53% | -32% |
Aggregation is the structural win - ranked search composed with GROUP BY,
which file tools cannot express at any budget - and it roughly halves
end-to-end time. These numbers are on a strong model; weaker, cheaper models
explore less efficiently, so the savings tend to be larger there. On
pinpoint symbol lookup, where a single grep is already cheap, an index
matches file tools rather than beating them.
Full methodology and per-question tables are in
docs/benchmark.md, with the harness in
bench/ so you can run the same lanes on your own repo.
One index and a deliberately small tool surface for agents:
| Tool | What it does | When agents use it |
|---|---|---|
search | One ranked pass fusing exact keyword matching (BM25) with semantic similarity (reciprocal-rank fusion). Hits carry the chunk content, so answers come straight from results. | A strong default for finding and understanding code: how a subsystem works, code by meaning or exact term, context before a change, similar implementations - exact identifiers and paraphrases in the same call. |
sql | Read-only SQL over the index, with the ranked search functions (bm25_search/hybrid_search) usable as table-valued relations. | Counts, rankings, aggregates over the whole repo in one query. |
reindex | Incremental sync (the server also auto-syncs in the background). | After significant edits. |
Three tools is a deliberate design: one way to find, one way to count, one way to stay fresh. Every additional near-duplicate retrieval tool worsens an agent's tool selection, and hybrid search's keyword half already ranks exact identifier terms highly, so a separate lexical tool has no job left.
Search-as-a-table composes with aggregation. Ranked by relevance, tallied by SQL, one engine pass:
hybrid_search(...) and vector_search(...) work the same way. The CLI and
MCP server embed {{name}} placeholders server-side, so agents never handle
raw vectors.
cx index commits the keyword (BM25) index first. On a ~3,000-chunk repo
that takes under a second, so search works before any embedding model even
exists on the machine. Vectors backfill in the background with a local model
(downloaded once, no key; about two minutes for that same repo), and
hybrid/semantic ranking unlocks automatically when they land. If the vector
stage fails, keyword search stays live and the index says so honestly.
The default model optimizes quality-per-minute. See docs/embedder-eval.md for how it was chosen.
Everything lives in .infino/ in your repo root (added to your
.gitignore automatically on first index): plain files you can copy,
cache in CI, or put on object storage. It's a live index the engine queries in place, not a snapshot you
export and pass around.
code-context is an MCP server over stdio, so any MCP client works. Register
it once and the tools (search, sql, reindex) become available to the
agent.
Install as a plugin - alwaysLoad already set, nothing to paste into a
config:
Or register it as an MCP server directly:
alwaysLoad: true pins code-context's tools into context so the agent reaches
for the index directly. In sessions with many MCP servers Claude Code defers
tool definitions behind a tool-search step; without alwaysLoad the agent can
miss code-context and fall back to grep/read. It's a small, always-loaded set
(three tools). Omit it (or use the shorter claude mcp add code-context -- npx -y @infino-ai/code-context mcp) if you'd rather leave the tools deferred.
Use either the plugin or the add-json command, not both. They register the
same code-context server, so running both just collides.
For a team, commit a project-scoped .mcp.json at the repo root so
everyone gets it (after the one-time project-server approval):
Add to .cursor/mcp.json:
In ~/.codex/config.toml (note the key is mcp_servers):
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/code-context)<a href="https://allmcps.com/mcp/code-context"><img src="https://allmcps.com/api/badge/code-context?style=directory" alt="Code Context on AllMCPs" /></a>