
cursor-rust-tools
by terhechte·★ 83·综合分 40
一个能让 Cursor 中的 Rust LLM 访问 Rust 分析器、Crate 文档和 Cargo 命令的 MCP 服务器。
概述
Cursor Rust Tools 是一个专业的 MCP 服务器,通过模型上下文协议将 AI 助手与 Rust 开发工具连接起来。它通过运行专用的 Rust 分析器实例并本地解析 cargo 文档,使 AI 代理能够访问实时类型信息、文档和 cargo 命令。该服务器提供了获取 crate 或特定符号文档、悬停信息、引用、实现以及 cargo 命令输出的工具。 该实现使用 Rust 编写,并包含用于配置和项目管理的 UI。它在项目根目录维护文档缓存,并可配置忽略特定 crate 以管理资源使用。服务器通过配置文件专门集成到 Cursor 编辑器中,可在代理模式下启用 MCP 服务器。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
使用 Cursor 进行 Rust 开发需要 AI 访问实时类型信息、文档和 Cargo 命令的开发者。
什么时候不要选它
不使用 Cursor 的用户或需要比当前暴露功能更全面 LSP 功能的用户。
此 server 暴露的工具
从 README 抽取出 7 个工具get_crate_docsGet the documentation for a crate or for a specific symbol in the crate
get_hover_infoGet the hover information (type, description) for a specific symbol in a file
get_referencesGet a list of all the references for a specific symbol in a file
get_implementationGet the implementation of a symbol in a file
find_typeFind a type just by name in a file the project and return the hover information
cargo_testGet the output of cargo test
cargo_checkGet the output of cargo check
可对比工具
安装
安装
cargo install --git https://github.com/terhechte/cursor-rust-tools带 UI 运行
cursor-rust-tools无 UI 运行
cursor-rust-tools --no-ui配置
创建一个 ~/.cursor-rust-tools 配置文件,使用 TOML 格式:
[[projects]]
root = "/path/to/your/rust/project"
ignore_crates = []Claude Desktop 配置
将以下内容添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"cursor-rust-tools": {
"command": "cursor-rust-tools",
"args": []
}
}
}然后为您的项目配置 .cursor/mcp.json 文件,以在特定项目中启用服务器。
FAQ
- 为什么服务器不能使用我编辑器中现有的 Rust Analyzer?
- 因为 Rust Analyzer 被设计为只能由单个消费者使用,并且需要正确的文档打开/关闭顺序,所以服务器会启动自己的实例以避免与编辑器冲突。
- 文档缓存是如何工作的?
- 服务器运行 'cargo docs' 并将 HTML 文档解析为 markdown,将其存储在项目根目录的 '.docs-cache' 文件夹中以实现更快访问。
- 我可以在 Cursor 以外的编辑器中使用此工具吗?
- 目前,该服务器专门为 Cursor 集成而设计,但计划创建 Zed 扩展。
Hacker News 讨论
开发者社区最近的相关讨论。
- 帖子 by terhechte · 2025-04-08
cursor-rust-tools 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。