VR

vaiz/rust-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

37 stars 3 forks 质量 70 趋势 20Unlicense

用于 Rust 开发的 MCP 服务器

概览

Rust-mcp-server 是一个实现模型上下文协议(MCP)的服务器。它作为大型语言模型(LLM)如 GitHub Copilot 与本地 Rust 开发环境之间的桥梁。 通过向LLM暴露本地工具和项目上下文,rust-mcp-server允许模型代表你执行操作,如构建、测试和分析你的Rust代码。 通过rust-mcp-server将LLM与本地开发环境集成,可以显著提升你的生产力。LLM可以: * :直接运行货物检查、货物建造、货物测试和货物fmt。* :通过货物添加添加新依赖,用cargo-machete查找未使用的依赖 *:使用cargo clippy整理代码并发现常见错误,确保遵守Rust指南。LLM还可以利用其他工具帮助你编写习惯性且稳健的Rust代码。

概述(AI 翻译)

rust-mcp-server 是一个实现模型上下文协议(MCP)的服务器。它作为大型语言模型(LLM)如 GitHub Copilot 与本地 Rust 开发环境之间的桥梁。

通过向LLM暴露本地工具和项目上下文,rust-mcp-server允许模型代表你执行操作,如构建、测试和分析你的Rust代码。

目录

  • 为什么使用rust-mcp-server?
  • 特色
  • 核心货物指挥
  • 项目管理
  • 依赖管理
  • 代码质量与安全
  • Rust 工具链管理
  • 命令行参数
  • 使用 VS Code 配置
  • HTTP 模式
  • GitHub Copilot 编码代理集成

为什么要用rust-mcp-server?

通过rust-mcp-server将LLM与本地开发环境集成,可以显著提升你的生产力。LLM可以:

  • 自动化常见任务:直接运行cargo check、cargo build、cargo test和cargo fmt。
  • 管理依赖:添加cargo add的新依赖,查找cargo-machete未使用的依赖]
  • 应用Rust最佳实践:使用cargo clippy来润色代码并发现常见错误,确保遵守Rust指南。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Rust MCP Server

rust-mcp-server is a server that implements the Model Context Protocol (MCP). It acts as a bridge between a large language model (LLM) like GitHub Copilot and your local Rust development environment.

By exposing local tools and project context to the LLM, rust-mcp-server allows the model to perform actions on your behalf, such as building, testing, and analyzing your Rust code.

Table of Contents

Why use rust-mcp-server?

Integrating an LLM with your local development environment via rust-mcp-server can significantly enhance your productivity. The LLM can:

  • Automate common tasks: Run cargo check, cargo build, cargo test, and cargo fmt directly.
  • Manage dependencies: Add new dependencies with cargo add, find unused dependencies with cargo-machete
  • Apply Rust best practices: Use cargo clippy to lint your code and catch common mistakes, ensuring adherence to Rust guidelines. The LLM can also leverage other tools to help you write idiomatic and robust Rust code.

Essentially, it turns your AI assistant into an active participant in your development workflow, capable of executing commands and helping you manage your project.

Features

rust-mcp-server exposes a comprehensive set of Rust development tools to the LLM:

Core Cargo Commands

  • cargo-build: Compile your package
  • cargo-check: Analyze the current package and report errors, but don’t build it
  • cargo-test: Run the tests
  • cargo-doc: Build documentation for your package (recommended with --no-deps and specific --package for faster builds)
  • cargo-fmt: Format the code according to the project’s style
  • cargo-clippy: Check for common mistakes and improve code quality using Clippy
  • cargo-clean: Clean the target directory

Project Management

  • cargo-new: Create a new cargo package
  • cargo-generate_lockfile: Generate or update the Cargo.lock file
  • cargo-package: Assemble the local package into a distributable tarball
  • cargo-list: List installed cargo commands

Dependency Management

  • cargo-add: Add dependencies to your Cargo.toml
  • cargo-remove: Remove dependencies from your Cargo.toml
  • cargo-update: Update dependencies to newer versions
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →