Tool Info
| Field | Value |
|---|---|
| Name | microindex-mcp |
| Type | MCP server |
| GitHub | ingvar-soloma/microindex-mcp |
| Stars | 3 (less than a day old) |
| Language | Python |
| License | MIT |
| Install | make setup && make index TARGET=/path/to/your-project |
What Problem It Solves
You've probably watched an agent do this: ask it to find where a function gets called in a large repo, it runs grep -r, gets a dozen hits, and then reads every matched file in full into context — even though the answer was 20 lines inside a 400-line file. The bigger the file and the more hits, the more tokens that single exploration round burns. Worse, grep matches a string, not a code boundary, so the agent routinely drags in unrelated surrounding lines along with the part it actually needed.
microindex-mcp replaces both the search and the read with structured equivalents. At index time it parses the codebase with Tree-sitter, chunks it along semantic boundaries — functions, classes — capped at 1,500 characters, and embeds each chunk locally (default model all-MiniLM-L6-v2, fully offline, no API key) into LanceDB. At query time it exposes exactly two deliberately minimal MCP tools: search_code does semantic search and returns the most relevant chunks with file path and line range, and get_code_chunk retrieves the AST chunks for a known file instead of the whole file's contents. The README's own benchmark, run against examples/polyglot-mini (a mixed PHP + Vue 3 + Python project), reports roughly 59% fewer tokens than grep-plus-full-file-read and about 64% fewer than rg with a ±30-line window; the author also ran it against three private production codebases, where savings ranged from 76% to 99% — the bigger the repo, the bigger the win.
It's a fit for agents doing semantic exploration across a mid-to-large, multi-language repo (currently Python, TS/JS/TSX, PHP, and Vue 3 SFC are supported) — not for a quick edit to one or two files. It also supports a centralized mode: one shared MCP server backing multiple projects' own .lancedb_data, so you don't have to install a copy per repo.
Getting Started
Install
git clone https://github.com/ingvar-soloma/microindex-mcp.git
cd microindex-mcp
# 1. Create .venv (uses uv if available; CPU-only PyTorch by default on Linux,
# skipping ~2.5GB of CUDA wheels)
make setup
# 2. Index the project you want to query; the vector store lands in
# that project's .lancedb_data/
make index TARGET=/path/to/your-project
# 3. (optional) run the example benchmark to see Hit@5 and token savings
make bench
Remember to add .lancedb_data/ to that project's .gitignore.
Basic Usage
Register it as a stdio MCP server:
{
"mcpServers": {
"MicroIndex": {
"command": "/path/to/microindex-mcp/.venv/bin/python",
"args": ["-u", "/path/to/microindex-mcp/src/mcp_server.py"],
"env": {
"PYTHONUNBUFFERED": "1",
"HF_HUB_OFFLINE": "1",
"INDEXER_DATA_DIR": "/path/to/your-project/.lancedb_data"
}
}
}
}
The agent then only ever sees two tools, and what comes back is a line-numbered code chunk, not an entire file:
search_code(query="webhook retry logic", top_k=5)
→ [1] src/jobs/webhook_retry.py:42-68 (function_definition, score=0.81)
...(AST chunk content)...
get_code_chunk(file_path="src/jobs/webhook_retry.py", node_type="class")
→ returns only the AST chunks in that file matching node_type
Advanced Usage: one shared MCP across projects, auto-reindex on commit
Register a "global" server without INDEXER_DATA_DIR and let the agent pass project_dir itself to switch between projects, instead of opening a separate server entry per repo:
search_code(query="...", project_dir="/path/to/active-repo")
To keep the index fresh automatically, add a post-commit hook in the target project (adapted from the README's example):
cat <<'EOF' > .git/hooks/post-commit
#!/usr/bin/env bash
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
HF_HUB_OFFLINE=1 /path/to/microindex-mcp/.venv/bin/python -u -m src.indexer \
--project "$PROJECT_ROOT" \
--db-dir "$PROJECT_ROOT/.lancedb_data" >/dev/null 2>&1 &
EOF
chmod +x .git/hooks/post-commit
Simplified, drawn from ingvar-soloma/microindex-mcp's README (2026-12-04); omits embedding-provider switching and per-language parsing details.
Compared to Existing Approaches
| microindex-mcp | plain grep/rg | codebase-memory-mcp (knowledge graph) | Cursor / Sourcegraph Cody (built-in indexing) | |
|---|---|---|---|---|
| Unit returned | AST chunk (function/class) | matched lines, full file read required | graph node + call chain | chunks, protocol not exposed |
| Local embedding, no API key | Yes (default all-MiniLM-L6-v2) | No embedding needed | Needs separate setup | No (tied to each vendor's service) |
| Number of MCP tools | 2 (deliberately minimal) | 0 (not an MCP tool) | 15 | Not exposed as a standalone MCP |
| Cross-file call-chain analysis | No (chunk-level semantic search only, for now) | No | Yes (call graph, cross-service calls) | Partial |
| Maturity | Just released, 3 stars | Built into every shell | 43,000+ stars | Commercial product, already at scale |
Caveats
- The v1.0-lite README is upfront about its accuracy ceiling. Pure dense embeddings miss top-5 on roughly 10-20% of queries involving exact
camelCaseidentifiers, dot-separated event names (chat.message.sent), or methods that lost their parent-class context when split into chunks. The author's plannedv2.0-hybridadds BM25 hybrid search to close that gap, but it's not there yet. - The index doesn't update itself. You either rerun
make indexby hand after changes, or wire up thepost-commitgit hook from the Advanced Usage section above. Forget to reindex, and the agent is searching stale code. - It's one day old with 3 stars. It hasn't been through community scrutiny or issue-driven hardening yet. Against codebase-memory-mcp — the 43,000+ star knowledge-graph tool covering the same "stop grepping" territory — this is a much younger project; run
make bench-repoagainst your own repo before rolling it out to a team. - The license text is slightly nonstandard. GitHub's automatic license detector reports
NOASSERTION(likely because the LICENSE file appends a non-binding "attribution request" paragraph after the standard MIT text, which seems to confuse the detector), but the file itself is the standard MIT License in full — the terms are MIT, just with an extra, legally non-binding attribution ask tacked on.
Today's Takeaway
Two "cut the agent's token bill" tools showed up months apart solving the same underlying problem differently: September's codebase-memory-mcp uses a knowledge graph to remember cross-file call relationships, and today's microindex-mcp uses AST-plus-vector chunk search. Neither is really competing on model size — both are betting on precomputing the codebase's structure once so the agent never has to re-derive it on every query. grep isn't expensive because it's slow; it's expensive because it carries no structural information, so it compensates by reading more. Both tools trade indexing time for query time, so each exploration pulls back only the few dozen lines that actually matter.