A MCP (Model Context Protocol) server that provides Rust development tools for Cursor editor.
This project is forked from terhechte/cursor-rust-tools with the following improvements:
- Removed GUI functionality: Focus on command-line mode for simplified deployment and usage
- Upgraded dependencies: Updated to latest versions of dependency libraries for improved performance and stability
- Official MCP implementation: Replaced with official MCP
rmcpRust SDK to ensure protocol compatibility - Config hot-reloading: Added configuration watcher for live updates without restart
- Multi-transport support: Added SSE and Streamable HTTP transport options
- Enhanced project management: Improved project tracking and indexing notifications
- Get hover information for symbols (type, description)
- Find all references of a symbol
- Get implementation code of a symbol
- Resolve symbols by name
- Real-time indexing progress tracking
- Execute
cargo testwith backtrace support - Execute
cargo checkwith error filtering - Stream test output directly to client
- Add/remove projects from workspace
- List active projects and their indexing status
- Automatic configuration persistence
- Project discovery by file path
cargo install --git https://github.com/cupnfish/rust-devtools-mcprust-devtools-mcp serve --port 4000# Add project
rust-devtools-mcp projects add /path/to/project
# Remove project
rust-devtools-mcp projects remove /path/to/project
# List projects
rust-devtools-mcp projects listConfigure projects in ~/.rust-devtools-mcp.toml:
[projects]
"/path/to/project1" = { root = "/path/to/project1", ignore_crates = [] }
"/path/to/project2" = { root = "/path/to/project2", ignore_crates = ["large-crate"] }ignore_crates is an optional list of crate dependency names to exclude from analysis.
- The server will print its MCP configuration when started
- Create
.cursor/mcp.jsonfile using the provided configuration - Cursor will automatically detect and enable the MCP server
- Check server status in Cursor settings under MCP section
- Select Agent mode in chat to access development tools
The project uses a modular design:
src/main.rs- Main entry point, CLI handling and server startupsrc/context.rs- Global context management, project state, and notificationssrc/cargo_remote.rs- Cargo command execution and output parsingsrc/config_watcher.rs- Config file monitoring and hot reloadingsrc/lsp/- Rust Analyzer LSP integrationsrc/mcp/- MCP server implementation with SSE/HTTP transportssrc/project.rs- Project abstraction and URI handling
- LSP functionality: Manages independent Rust Analyzer instances per project
- Project tracking: Uses DashMap for concurrent project access
- Config management: Automatically saves/loads project configuration
- Notification system: Provides real-time updates on indexing and tool usage
- Multi-transport: Supports Stdio, SSE, and Streamable HTTP transports
cupnfish
Inherits the license from the original project.