cursor-rust-tools
A MCP server to allow the LLM in Cursor to access Rust Analyzer, Crate Docs and Cargo Commands.
claude mcp add --transport stdio terhechte-cursor-rust-tools cargo install --git https://github.com/terhechte/cursor-rust-tools
How to use
Cursor Rust Tools provides MCP endpoints that let your LLM query Rust type information, crate docs, and cargo command outputs directly from your codebase. The server spins up an index layer using Rust Analyzer for LSP-like capabilities to retrieve hover information, symbol references, and implementations, and it also builds local HTML documentation via cargo docs to expose up-to-date crate documentation in Markdown. Use the included UI to add projects and generate the mcp.json configuration, then enable the MCP server in Cursor. Once configured, you can request tools such as cargo_check, cargo_test, and crate/documentation queries to surface accurate Rust information during conversations. The UI helps you manage multiple projects and inspect activity, which makes it easier to keep your toolchain aligned with your codebase.
How to install
Prerequisites:
- Rust toolchain (cargo) installed
- Git installed
- Access to the internet to fetch the repository
Installation steps:
-
Ensure Rust is installed on your system. If not, install it from https://rust-lang.org or using rustup.
-
Install Cursor Rust Tools from the Git repository:
cargo install --git https://github.com/terhechte/cursor-rust-tools
- Run the tool with the UI to set up projects and generate the MCP configuration:
cursor-rust-tools
-
If you prefer running without the UI, you can still generate the mcp.json and add your projects manually by creating a mcp.json in your project directory and pointing Cursor to the MCP server.
-
For Cursor integration, ensure your project contains a mcp.json (cursor-rust-tools UI can create it) and enable the MCP server in Cursor under MCP settings.
Additional notes
Notes and tips:
- The server uses cargo docs to generate crate documentation locally and caches it in the project root as .docs-cache. This improves response times for doc queries but may require disk space for large projects.
- You can control which crates are indexed by adjusting ignore_crates in your project configuration.
- If you encounter build or index errors, ensure your Rust toolchain is up to date and that the project paths referenced in mcp.json are accessible.
- The MCP endpoints expose tools like cargo_check and cargo_test, which can help the LLM verify type information and compile status before presenting results.
- When using Cursor, you may want to set up Cursor rules to prefer using these tools for relevant queries to improve accuracy.
Related MCP Servers
swiftlens
SwiftLens is a Model Context Protocol (MCP) server that provides deep, semantic-level analysis of Swift codebases to any AI models. By integrating directly with Apple's SourceKit-LSP, SwiftLens enables AI models to understand Swift code with compiler-grade accuracy.
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
kanban
MCP Kanban is a specialized middleware designed to facilitate interaction between Large Language Models (LLMs) and Planka, a Kanban board application. It serves as an intermediary layer that provides LLMs with a simplified and enhanced API to interact with Planka's task management system.
spec-kit
MCP server enabling AI assistants to use GitHub's spec-kit methodology
memory
A MCP (Model Context Protocol) server providing long-term memory for LLMs
shodan
Shodan MCP server for Claude, Cursor & VS Code. 20 tools for passive reconnaissance, CVE/CPE intelligence, DNS analysis, and device search. 4 tools work free without an API key. OSINT and vulnerability research from your IDE.