Context Engine

Code context engine

The flagship prom.codes MCP. It indexes your repository and serves grounded code retrieval to your agent — symbol-aware, hybrid, and benchmarked at recall@10 100% on 12 OSS repos.

@prom.codes/context-mcp is the flagship prom.codes server. It answers the question "what does this codebase actually look like?" — and it answers it with the real symbols and call sites, not hallucinated names. One search_code call replaces a grep → open-file → read loop: the agent gets the right code, ranked, with the snippet inline.

What makes it good

Most "RAG over code" splits files into fixed line windows and hopes the right chunk ranks. The context engine is symbol-aware end to end:

  • Tree-sitter parsing across 14 languages. Every file is parsed into its symbols — functions, classes, methods — with name, kind, container scope, export flag and the source body. No naive sliding window.
  • Hybrid retrieval, fused. Three signals are combined with Reciprocal Rank Fusion (RRF): lexical (BM25 over name + container + body), semantic (dense vectors over descriptor + path + body), and the symbol graph (1-hop expansion across defines / calls / imports / same-file edges).
  • Contextual embeddings. The dense channel embeds the real code body, not just a short descriptor — the single change that took file-recall from 75% to 100% (see results below).
  • Source-first ranking + cross-encoder rerank. Test/doc/example hits are demoted below source files, and a cross-encoder second stage reorders the top candidates for rank-1 precision — on by default through the metered proxy with just your PROMETHEUS_API_KEY (no extra key, upstream model hidden; set PROMETHEUS_RERANK_PROVIDER=none to opt out).

For the full pipeline and the language table see Language coverage and MCP tools.

Results

The steering metric is file-localization recall, measured the SWE-bench way: for a real GitHub issue, did the engine surface the file the merged fix actually changed? It is fully deterministic — no LLM in the scoring loop.

MetricResult
Recall@10100% — the file to edit is in the top 10 on all 12 benchmarked repos
Recall@583–90%
MRR~0.71–0.79
Repos12 OSS projects, easy → hard (flask, requests … django, sympy, sphinx, scikit-learn, pytest, astropy, matplotlib)

The sixteen tools

Retrieval: search_code, get_symbol, get_file, find_references, find_callers, find_callees, expand_context, list_changed_since, framework_overview, get_architecture and list_workspaces. Operations: index_status, reindex, install_hooks, dashboard and update_servers. Open protocol — works with every MCP-aware editor and agent. Full signatures on MCP tools.

Codebase architecture map

get_architecture answers "what is this repo?" in a single call — the fast first move when an agent lands on an unfamiliar codebase, replacing a dozen list-directory and read cycles. It returns, from the existing index (no extra indexing pass, no LLM):

  • index size + embedding coverage — how much is indexed and embedded;
  • languages — file counts per language;
  • frameworks — detected from manifests (package.json, pyproject.toml, …);
  • packages / modules — every manifest in the tree, with its declared name;
  • layout — top-level folders (monorepo containers like packages/* are expanded one level) with file counts and the dominant language per folder;
  • symbolKinds — how many functions / classes / interfaces / … there are;
  • hotspots — the most-referenced locally-defined symbols (the call / member_access edges), i.e. the code everything else leans on;
  • entryPoints — from package.json bin/main plus conventional index/main/server/… files.

The optional hotspots argument caps the hotspot list (0 to skip it).

Sovereignty

Your raw code never leaves the machine. The local SQLite index lives outside the repo (~/.prometheus/<hash>.db); only short embedding text transits to the provider you configured, and a per-tenant region mode pins which providers may ever see it.

Install

One command in Claude Code (the primary host):

claude mcp add context --env PROMETHEUS_API_KEY=prom_live_… -- npx -y @prom.codes/context-mcp@latest

The PROMETHEUS_API_KEY is the only required setting — the workspace root is auto-detected (Claude Code passes the open project; other clients via MCP roots) and the index path defaults to ~/.prometheus/<hash>.db. The same server works in Cursor and Visual Studio Code with the identical .mcp.json shape — see the Claude Code page for the full setup.