Rust language server integration for code intelligence, diagnostics, and completions in Rust projects.
## Rust Analyzer MCP Server: Intelligent Rust Development The **Rust Analyzer MCP Server** brings the power of rust-analyzer directly into Google Antigravity, providing world-class Rust language intelligence. Get real-time error checking, intelligent code completion, and powerful refactoring tools for Rust projects without leaving your IDE. ### Why Rust Analyzer MCP? Rust is known for its steep learning curve but incredible safety guarantees. The Rust Analyzer MCP makes Rust development more accessible by providing: - **Real-time Diagnostics**: Catch errors before compilation - **Smart Completions**: Context-aware suggestions with type information - **Inline Type Hints**: See inferred types without explicit annotations - **Powerful Refactoring**: Rename, extract, and restructure code safely - **Macro Expansion**: Understand what procedural macros generate ### Key Features #### 1. Code Intelligence Get comprehensive code understanding: ``` "Show me the type of this variable" "Find all implementations of this trait" "Go to the definition of this function" "Show documentation for this struct" ``` #### 2. Error Diagnostics Real-time error checking with fixes: - Borrow checker violations with explanations - Type mismatch errors with suggestions - Missing trait implementations - Unused variable warnings #### 3. Refactoring Tools Safe code transformations: - Rename symbols across the codebase - Extract functions and modules - Inline variables and functions - Convert between different Rust idioms #### 4. Cargo Integration Full Cargo workspace support: - Dependency management - Feature flag handling - Build script integration - Workspace member navigation ### Configuration ```json { "mcpServers": { "rust-analyzer": { "command": "rust-analyzer", "args": ["--mcp"], "env": { "CARGO_HOME": "~/.cargo" } } } } ``` ### Best Practices 1. **Keep rust-analyzer Updated**: New Rust features need latest analyzer 2. **Use Clippy Lints**: Enable additional linting for better code 3. **Configure Workspace**: Set up rust-analyzer.toml for large projects 4. **Check Macro Expansion**: Debug procedural macros with expansion view The Rust Analyzer MCP transforms Rust development into a smooth, IDE-like experience with the full power of Gemini 3 assistance.
{
"mcpServers": {
"rust-analyzer": {}
}
}