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
ripgrepfor fast pattern matching - MCP server: Integrates with AI assistants via Model Context Protocol
- CLI tool: Direct command-line usage
Installation
From crates.io (Recommended)
# Requires ripgrep
# macOS: brew install ripgrep
# Linux: apt-get install ripgrep
From source
Usage
CLI Examples
# Search crates.io package
# Search GitHub repository
# Search local directory
# Case-sensitive search
MCP Server Setup
Configure your MCP client (e.g., Cursor) by adding to ~/.cursor/mcp.json:
License
This project is licensed under the MIT License. See the LICENSE file for details.