
dexwritescode/rust-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
dexwritescode/rust-mcp - кандидат на сервер MCP, импортированный из https://github.com/dexwritescode/rust-mcp.
Обзор
dexwritescode/rust-mcp - кандидат на сервер MCP, импортированный из https://github.com/dexwritescode/rust-mcp.
Обзор (машинный перевод)
Комплексный сервер Model Context Protocol (MCP), который обеспечивает интеграцию с анализатором ржавчины для разработки с помощью LLM Rust. Этот сервер позволяет инструментам искусственного интеллекта, таким как Claude, работать с кодом Rust идиоматически через возможности протокола сервера языка rust-analyzer, избегая манипулирования строками и обеспечивая интеллектуальный анализ кода и рефакторинг.
Быстрый старт
- Build:
cargo build --release - **Настройте ** Ваш MCP-клиент для использования
target/release/rustmcp - Использовать через помощников ИИ с подсказками на естественном языке, такими как «Создать структуру пользователя с помощью Debug and Clone deriveds»
Полный набор инструментов / Complete Tool Suite (19 Tools)
Анализ кода (4 инструмента)
find_definition- Навигация по определениям символовfind_references- Найти все используемые символыget_diagnostics- Получить ошибки компилятора / предупреждения с исправлениямиworkspace_symbols- Поиск символов проекта
Поколение кода (4 инструмента)
[[Т6]] - Создание структур с производными и конструкторами
[[Т7]] - Создавать числа с вариантами
generate_trait_impl - Генерировать реализации черт с заглушками
generate_tests - Создание шаблонов для тестирования блоков или интеграции
Рефакторинг (5 инструментов)
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Rust MCP Server
A comprehensive Model Context Protocol (MCP) server that provides rust-analyzer integration for LLM-assisted Rust development. This server enables AI tools like Claude to work with Rust code idiomatically through rust-analyzer’s Language Server Protocol capabilities, avoiding string manipulation and providing intelligent code analysis and refactoring.
Quick Start
- Build:
cargo build --release - Configure your MCP client to use
target/release/rustmcp - Use through AI assistants with natural language prompts like “Generate a User struct with Debug and Clone derives”
Features - Complete Tool Suite (19 Tools)
Code Analysis (4 tools)
find_definition- Navigate to symbol definitionsfind_references- Find all symbol usesget_diagnostics- Get compiler errors/warnings with fixesworkspace_symbols- Search project symbols
Code Generation (4 tools)
generate_struct- Create structs with derives and constructorsgenerate_enum- Create enums with variantsgenerate_trait_impl- Generate trait implementations with stubsgenerate_tests- Create unit or integration test templates
Refactoring (5 tools)
rename_symbol- Rename with scope awarenessextract_function- Extract code into functionsinline_function- Inline function callsorganize_imports- Sort and organize use statementsformat_code- Apply rustfmt formatting
Quality Assurance (2 tools)
apply_clippy_suggestions- Apply clippy automatic fixesvalidate_lifetimes- Check lifetime and borrow checker issues
Project Management (2 tools)
analyze_manifest- Parse and analyze Cargo.tomlrun_cargo_check- Execute cargo check with error parsing
Advanced Features (4 tools)
get_type_hierarchy- Get type relationships for symbolssuggest_dependencies- Recommend crates based on code patternscreate_module- Create new Rust modules with visibility controlmove_items- Move code items between files
Additional Advanced Tools
change_signature- Modify function signatures safely
Prerequisites
- Rust toolchain (1.70+)
- rust-analyzer installed (defaults to
~/.cargo/bin/rust-analyzer) - An MCP-compatible client (Claude, Roo, etc.)
Installation
- Clone this repository:
git clone
cd rust-mcp
- Build the server:
cargo build --release
- The server binary will be available at
target/release/rustmcp
Configuration
Environment Variables
The server supports the following environment variables:
RUST_ANALYZER_PATH- Path to rust-analyzer binary (default:~/.cargo/bin/rust-analyzer)
You can set this when running the server:
RUST_ANALYZER_PATH=/usr/local/bin/rust-analyzer ./target/release/rustmcp
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"rust-analyzer": {
"command": "/path/to/rust-mcp/target/release/rustmcp",
"args": [],
"env": {
"RUST_ANALYZER_PATH": "/custom/path/to/rust-analyzer"
}
}
}
}