DR

dexwritescode/rust-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

36 stars 17 forks 品質 59 トレンド 0MIT

dexwritescode/rust-mcp は [https://github.com/dexwritescode/rust-mcp.] からインポートされた MCP サーバーの候補です

概要

dexwritescode/rust-mcp は [https://github.com/dexwritescode/rust-mcp.] からインポートされた MCP サーバーの候補です

概要(AI 翻訳)

LLM-assisted Rust開発のためのrust-analyzer統合を提供する包括的なモデルコンテキストプロトコル(MCP)サーバー。 このサーバーは、ClaudeのようなAIツールを使用して、rust-analyzerの言語サーバープロトコル機能を使用してRustコードを慣用的に動作させ、文字列操作を回避し、インテリジェントなコード解析と再ファクタリングを提供します。

クイックスタート

1.ビルド: [[T0] 2.MCP クライアントが [[T1] を使用するように構成 3。「DebugとCloneの派手なユーザー structを生成」のような自然な言語プロンプトを持つAIのアシスタントを通して使用**

機能 - 完全なツールスイート(19ツール)

コード解析 (4 ツール)

  • [find_definition - シンボル定義に移動
  • [find_references - すべてのシンボルの使用を検索
  • [get_diagnostics - コンパイラのエラー/ワーニングを固定で取得
  • [workspace_symbols - プロジェクトシンボルの検索

コード生成 (4 ツール)

  • [generate_struct - 導体とコンストラクタでstructを作成
  • [generate_enum - バリエーションで列を作成する
  • [generate_trait_impl - トレイト実装をスタブで生成する
  • [generate_tests - ユニットまたは統合テストテンプレートを作成する

##Refactoring (5つのツール)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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

  1. Build: cargo build --release
  2. Configure your MCP client to use target/release/rustmcp
  3. 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 definitions
  • find_references - Find all symbol uses
  • get_diagnostics - Get compiler errors/warnings with fixes
  • workspace_symbols - Search project symbols

Code Generation (4 tools)

  • generate_struct - Create structs with derives and constructors
  • generate_enum - Create enums with variants
  • generate_trait_impl - Generate trait implementations with stubs
  • generate_tests - Create unit or integration test templates

Refactoring (5 tools)

  • rename_symbol - Rename with scope awareness
  • extract_function - Extract code into functions
  • inline_function - Inline function calls
  • organize_imports - Sort and organize use statements
  • format_code - Apply rustfmt formatting

Quality Assurance (2 tools)

  • apply_clippy_suggestions - Apply clippy automatic fixes
  • validate_lifetimes - Check lifetime and borrow checker issues

Project Management (2 tools)

  • analyze_manifest - Parse and analyze Cargo.toml
  • run_cargo_check - Execute cargo check with error parsing

Advanced Features (4 tools)

  • get_type_hierarchy - Get type relationships for symbols
  • suggest_dependencies - Recommend crates based on code patterns
  • create_module - Create new Rust modules with visibility control
  • move_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

  1. Clone this repository:
git clone 
cd rust-mcp
  1. Build the server:
cargo build --release
  1. 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
GitHub で README 全文を見る

インストール

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" } } } }