scan_crate 0.1.0-alpha.1

Fast regex search through Rust crate source code - supports crates.io, GitHub repos, and local paths
Documentation

scan_crate

Fast regex search through Rust crate source code. Supports crates.io, GitHub repos, and local paths.

Features

  • Multiple sources: Automatically detects and fetches from:
    • crates.io registry
    • GitHub/git repositories
    • Local directories
    • Workspace dependencies (via cargo metadata)
  • Smart caching: Uses existing Cargo cache when available, maintains its own cache for other sources
  • Regex search: Powered by ripgrep for fast pattern matching
  • MCP server: Integrates with AI assistants via Model Context Protocol
  • CLI tool: Direct command-line usage

Installation

From crates.io (Recommended)

cargo install scan_crate --version 0.1.0-alpha.1

# Requires ripgrep
# macOS: brew install ripgrep
# Linux: apt-get install ripgrep

From source

git clone https://github.com/verse-pbc/scan_crate.git
cd scan_crate
cargo build --release

Usage

CLI Examples

# Search crates.io package
scan_crate --crate-spec "serde@1.0.130" --query "Serialize"

# Search GitHub repository
scan_crate --crate-spec "https://github.com/rust-lang/cargo.git@0.70.0" --query "cargo_metadata"

# Search local directory
scan_crate --crate-spec "./" --query "TODO"

# Case-sensitive search
scan_crate --crate-spec "tokio" --query "Runtime" --case-sensitive

MCP Server Setup

Configure your MCP client (e.g., Cursor) by adding to ~/.cursor/mcp.json:

{
    "mcpServers": {
        "scan-crate": {
            "command": "/path/to/scan_crate/target/release/scan_crate",
            "args": ["--mcp"]
        }
    }
}

License

This project is licensed under the MIT License. See the LICENSE file for details.