MCP Server
The seven tools
Search, literal grep, graph navigation and entity/file lookup — the same retrieval /chat uses, exposed as MCP tools.
| Tool | Parameters | Returns |
|---|---|---|
list_projects | – | Ingested projects with chunk / node / edge counts and generated_at. |
search | query, project?, k=8 | Ranked hits — qualified_name, entity type, absolute path:lines, score, truncated description. |
grep_project | pattern, project?, k=10 | Literal keyword search — BM25 over stored code text (tokenized, not regex) for a known identifier. |
get_entity | qualified_name, project? | One entity's relations (calls/called_by/inherits/implements/overrides/methods), summary and full source. |
neighbors | qualified_name, direction=both, depth=1, limit=30 | Graph neighborhood as a node list + edge list, BFS up to depth hops. |
context | query, project?, k=8 | One-shot seed + graph-expanded context bundle, ready as LLM context, capped at 10,000 chars. |
get_file | path, start_line?, end_line? | Raw file content, optionally a 1-indexed inclusive line range; capped at 2,000 lines / 100 KB. |
Typical sizes:
search ≈ 2.7k chars at k=8; context ≤ 10k chars (≈2.5k tokens); grep_project ≈ 800 chars at k=10.Measured token budget
scripts/mcp_harness.py drives a local Ollama model through the tool loop for a fixed question and reports the total payload against a budget. Measured on a medium backend with qwen2.5-coder:3b:
| Question | Tool calls | Payload | Budget | Result |
|---|---|---|---|---|
| “how does a request move through the system?” | context ×1 | ≈2,478 tokens | 5,000 | PASS |
| a generalization question | search ×1 | ≈639 tokens | 5,000 | PASS |