R rust-code-mcp v0.1
NEW Hybrid BM25 + vector search for Rust codebases

Semantic code search,
built for Rust.

An MCP server that pairs full-text search with vector embeddings and rust-analyzer's semantic graph — so your agent can navigate, trace, and reason about your codebase like you do.

// features

Search that actually understands Rust.

Three search modes that compose: keyword, semantic, and the AST. Built on tantivy, fastembed, and rust-analyzer.

Hybrid search

BM25 keyword matching fused with vector similarity. Find code by what it does, not just what it's called.

Symbol navigation

Goto definition and find references across the project, powered by rust-analyzer's IDE engine.

Call graph

Trace function relationships up and down the stack — who calls what, and from where.

Complexity metrics

Lines of code, cyclomatic complexity, and function counts per file or module — at a glance.

Incremental indexing

Merkle-tree change detection re-indexes only what changed. First run is full; everything after is fast.

GPU acceleration

ONNX Runtime + CUDA for 10–15× faster embedding on NVIDIA GPUs. CPU fallback when no GPU is present.

// tools

Ten tools, exposed over MCP.

Drop the server into Claude Code (or any MCP client) and these become callable from your agent.

search
Keyword search using hybrid BM25 + vector ranking.
get_similar_code
Find semantically similar code snippets to a query.
find_definition
Locate where a symbol is defined, by name.
find_references
Enumerate all usages of a symbol across the project.
get_dependencies
List the imports declared in a file.
get_call_graph
Show function call relationships in both directions.
analyze_complexity
Compute LOC, cyclomatic complexity, and function counts.
read_file_content
Read raw file contents from the indexed project.
index_codebase
Manually trigger an indexing run for a directory.
health_check
Report system status, index state, and configuration.
// installation

Three steps to running.

Build the binary, wire it into your MCP client, and point it at a Rust project.

1 · build
# clone and build the release binary
git clone https://github.com/molaco/rust-code-mcp
cd rust-code-mcp
cargo build --release

# optional: drop on PATH
cp target/release/file-search-mcp ~/.local/bin/
2 · .mcp.json
{
  "mcpServers": {
    "rust-code-mcp": {
      "command": "/abs/path/to/file-search-mcp"
    }
  }
}
3 · index & query
# inside Claude Code, ask:
> index my codebase at /abs/path/to/my-rust-project

# then call any tool — for example:
> find_references for "parse_expression"
> get_similar_code to "retry with exponential backoff"
> get_call_graph from "main"
// architecture

Three indexes, one query plane.

A document index, a vector index, and a semantic AST — kept in sync by a Merkle-tree watcher.

01 · source
Rust project
Files on disk. Hashed via Merkle tree to detect change.
02 · index
tantivy + lancedb
BM25 document index alongside an embedded vector store.
03 · semantics
rust-analyzer
AST + IDE engine for definitions, references, call graphs.
04 · surface
MCP server
rmcp bridge — ten tools exposed to any MCP client.
// performance

Built to scale with your codebase.

Throughput measured on the embedding pipeline. CPU is fine for small projects; GPU unlocks large monorepos.

CPU only
~50chunks/sec
Baseline throughput, no accelerator required.
GPU · isolated
~8,000chunks/sec
Embedding model alone, batched on-device.
// stack

Standing on good shoulders.

Each piece is the best-in-class option for its job — and stays a thin wrapper over the upstream library.

MIT licensed · self-hosted

Give your agent eyes on the codebase.

Clone the repo, plug it into Claude Code, and watch the difference good search makes.