A code intelligence MCP server with Tantivy BM25 search and tree-sitter structural analysis, backed by a Rhai scripting engine.
Mira provides code intelligence capabilities for Claude Code via the Model Context Protocol (MCP). It indexes your Rust codebase for fast full-text search and maintains a call graph for cross-reference queries.
- BM25 Search: Fast full-text search with custom tokenization for camelCase and snake_case
- Call Graph: Track function relationships (callers/callees)
- Dead Code Detection: Find unreferenced private functions
- Rhai Scripting: Query API via Rhai scripts
- Tree-sitter Parsing: Accurate Rust AST parsing
cargo build --release# Start MCP server
mira serve
# Initialize project with .mcp.json
mira init
# Check index status
mira index status
# Index entire project
mira index projectMira exposes two MCP tools:
Execute a Rhai script with access to Mira's code intelligence API.
Available functions:
search(query, limit)- BM25 search for codesymbols(file_path)- List symbols in a filecallers(function_name)- Find callers of a functioncallees(function_name)- Find callees of a functiondead_code()- Find unreferenced symbolsindex_project()- Force full re-indexindex_status()- Get index healthhelp()- Show API reference
Example:
let hits = search("authentication", 10);
Trigger index operations:
action: "project"- Full re-indexaction: "status"- Check index status
Claude Code → stdio → rmcp → MiraServer → Rhai Engine → Bindings
↓
Search / Graph / Parser
search/- Tantivy BM25 indexgraph/- Call graph and symbol relationshipsparser/- Tree-sitter Rust parserengine/- Rhai script executionbindings/- Rhai function registrationstokenizer/- Custom Tantivy tokenizer for code
# Run tests
cargo test
# Run specific test
cargo test test_name
# Build
cargo buildMIT