Skip to content

ConaryLabs/Mira

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,910 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mira v2

A code intelligence MCP server with Tantivy BM25 search and tree-sitter structural analysis, backed by a Rhai scripting engine.

Overview

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.

Features

  • 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

Installation

cargo build --release

Usage

CLI Commands

# Start MCP server
mira serve

# Initialize project with .mcp.json
mira init

# Check index status
mira index status

# Index entire project
mira index project

MCP Tools

Mira exposes two MCP tools:

run - Execute Rhai Scripts

Execute a Rhai script with access to Mira's code intelligence API.

Available functions:

  • search(query, limit) - BM25 search for code
  • symbols(file_path) - List symbols in a file
  • callers(function_name) - Find callers of a function
  • callees(function_name) - Find callees of a function
  • dead_code() - Find unreferenced symbols
  • index_project() - Force full re-index
  • index_status() - Get index health
  • help() - Show API reference

Example:

let hits = search("authentication", 10);

index - Index Operations

Trigger index operations:

  • action: "project" - Full re-index
  • action: "status" - Check index status

Architecture

Claude Code → stdio → rmcp → MiraServer → Rhai Engine → Bindings
                                                    ↓
                                              Search / Graph / Parser

Key Modules

  • search/ - Tantivy BM25 index
  • graph/ - Call graph and symbol relationships
  • parser/ - Tree-sitter Rust parser
  • engine/ - Rhai script execution
  • bindings/ - Rhai function registrations
  • tokenizer/ - Custom Tantivy tokenizer for code

Development

# Run tests
cargo test

# Run specific test
cargo test test_name

# Build
cargo build

License

MIT

Packages

 
 
 

Contributors

Languages