ciresnave/rust-analyzer-mcp-server
If you are the rightful owner of rust-analyzer-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Rust Analyzer MCP Server is a Model Context Protocol server that integrates with rust-analyzer to provide advanced Rust language analysis capabilities.
The Rust Analyzer MCP Server is designed to enhance AI assistants and other MCP clients by providing comprehensive Rust code analysis features. By leveraging the capabilities of rust-analyzer, this server offers a suite of tools for developers working with Rust projects. It supports diagnostics, hover information, navigation to definitions, reference finding, and intelligent code completions. The server is compatible with Windows, macOS, and Linux, and requires Rust 1.85.1+ and the rust-analyzer binary to be available in the system PATH. Installation is straightforward, with scripts provided for various platforms, ensuring that users can quickly set up and start using the server. The server communicates using JSON-RPC over stdin/stdout, adhering to the Model Context Protocol specification, making it easy to integrate with various MCP-compatible clients.
Features
- Diagnostics: Provides compiler errors, warnings, and lints for Rust files.
- Hover Information: Retrieves type information and documentation for symbols.
- Go to Definition: Allows navigation to symbol definitions.
- Find References: Locates all references to a symbol.
- Code Completions: Offers intelligent code completion suggestions.
Usages
usage with VS Code
{ "mcp.servers": { "rust-analyzer-mcp": { "command": "/path/to/rust-analyzer-mcp-server", "args": ["${workspaceFolder}"], "env": {} } } }
usage with Claude Desktop
{ "mcpServers": { "rust-analyzer": { "command": "/path/to/rust-analyzer-mcp-server", "args": ["/path/to/your/rust/project"] } } }
Tools
get_diagnostics
Get diagnostics for a Rust file.
get_hover_info
Get hover information for a symbol.
goto_definition
Go to definition of a symbol.
find_references
Find all references to a symbol.
get_completions
Get code completions.
analyze_workspace
Analyze the entire workspace.