
zeenix/rust-analyzer-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
zeenix/rust-analyzer-mcp - кандидат на сервер MCP, импортированный из https://github.com/zeenix/rust-analyzer-mcp.
Обзор
zeenix/rust-analyzer-mcp - кандидат на сервер MCP, импортированный из https://github.com/zeenix/rust-analyzer-mcp.
Обзор (машинный перевод)
Это сервер Model Context Protocol (MCP), который обеспечивает интеграцию с ржавчиной-анализатором. Ассистенты ИИ для анализа кода Rust, получения информации о зависании, поиска определений, ссылок и многого другого. Написано в Rust для оптимальной производительности и нативной интеграции.
Предпосылки
1.Ржавый анализатор: Убедитесь, что ржавый анализатор установлен и доступен в вашем PATH.
- Rust: версия 1.70 или выше
- Проект Rust: сервер лучше всего работает с действительным рабочим пространством Rust (содержащим
Cargo.toml)
##Почему ржавчина?
Эта реализация Rust предлагает несколько преимуществ перед альтернативными реализациями:
Performance: Native Rust binary с минимальными накладными расходами Безопасность памяти: отсутствие ошибок во время выполнения при проблемах с памятью Экосистемная интеграция: идеально подходит для рабочих процессов разработки Rust Малый двоичный размер: Оптимизированная сборка с LTO Конкурентная безопасность: время выполнения Tokio async эффективно обрабатывает несколько запросов
- Нативная обработка LSP Прямая интеграция с протоколом rust-analyzer
##Установка
от crates.io (рекомендуется)
Установить непосредственно с crates.io:
Бинарный код будет установлен в вашем каталоге Cargo bin (обычно ~ /).
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
rust-analyzer MCP Server
This is a Model Context Protocol (MCP) server that provides integration with rust-analyzer, allowing AI assistants to analyze Rust code, get hover information, find definitions, references, and more. Written in Rust for optimal performance and native integration.
Prerequisites
-
rust-analyzer: Make sure rust-analyzer is installed and available in your PATH
# Install via rustup (recommended) rustup component add rust-analyzer # Or install directly cargo install rust-analyzer # Verify installation rust-analyzer --version -
Rust: Version 1.70 or higher with Cargo
-
A Rust project: The server works best with a valid Rust workspace (containing
Cargo.toml)
Why Rust?
This Rust implementation offers several advantages over alternative implementations:
- Performance: Native Rust binary with minimal overhead
- Memory Safety: No runtime errors from memory issues
- Ecosystem Integration: Perfect fit for Rust development workflows
- Small Binary Size: Optimized release builds with LTO
- Concurrent Safety: Tokio async runtime handles multiple requests efficiently
- Native LSP Handling: Direct integration with rust-analyzer’s protocol
Installation
From crates.io (Recommended)
Install directly from crates.io:
cargo install rust-analyzer-mcp
The binary will be installed to your Cargo bin directory (usually ~/.cargo/bin/rust-analyzer-mcp).
From Source
-
Clone the repository:
git clone https://github.com/zeenix/rust-analyzer-mcp.git cd rust-analyzer-mcp -
Build the project:
cargo build --release -
The binary will be available at
target/release/rust-analyzer-mcp
Configuration
Claude Code Configuration
Add an MCP server configuration to one of these locations:
Option 1: Project-specific (.mcp.json in your Rust project root):
{
"mcpServers": {
"rust-analyzer": {
"command": "rust-analyzer-mcp"
}
}
}
Option 2: User-wide (~/.claude.json or ~/.claude/settings.json):
{
"mcpServers": {
"rust-analyzer": {
"command": "rust-analyzer-mcp"
}
}
}
Note: If you installed from crates.io, the command will be in your PATH. If you built from source, use the full path to the binary. You can also configure servers using Claude Code’s CLI wizard too.
Claude Desktop Configuration
Add this to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"rust-analyzer": {
"command": "rust-analyzer-mcp"
}
}
}
Note: If installed from crates.io, the command will be in your PATH. For Claude Desktop, you
may want to specify a cwd parameter if you want to analyze a specific project by default.
Cargo features
By default rust-analyzer analyses and checks your crate with whatever features its manifest makes
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"rust-analyzer": {
"command": "rust-analyzer-mcp"
}
}
}