Rust文档注释生成器

scribe-crab是一个MCP服务器,帮助开发者为其Rust函数生成文档注释,支持自定义格式模板并与MCP客户端(如Cursor IDE)集成。

  • by blue-orange-yellow
  • Rust
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 blue-orange-yellow/scribe-crab

使用说明

抄写蟹

为Rust生成文档注释的MCP服务器。

概述

scribe crab是一个MCP(模型上下文协议)服务器,它帮助开发人员为他们的Rust函数生成文档注释。它将Rust函数代码作为输入,并按照可定制的格式生成文档注释。

特性

  • 为Rust函数生成文档注释
  • 使用可自定义的格式模板
  • 与MCP客户端(如Cursor IDE)集成

安装

克隆存储库并构建:

git clone https://github.com/blue-orange-yellow/scribe-crab.git
cd scribe-crab
cargo build --release

配置

要与Cursor等客户端一起使用,您需要将其配置为MCP服务器。光标配置示例:

{
  "mcpServers": {
    "scribe-crab": {
      "command": "/path/to/scribe-crab/target/release/scribe-crab",
      "args": [],
      "cwd": "/path/to/scribe-crab",
      "env": {
        "FORMAT_PATH": "/path/to/scribe-crab/.format.md"
      }
    }
  }
}

用法

  1. 将格式文件路径设置为环境变量
  2. 启动MCP服务器
  3. 通过MCP客户端(如Cursor)使用该工具
  4. 询问Cursor Agent“为XX功能生成文档注释”或类似说明

文档格式

文档格式可以通过编辑来定制 .format.md 文件。 例子:

/// # Description
/// 
/// This function does XYZ.
/// 
/// # Arguments
/// 
/// * - Description of the first parameter
/// * - Description of the second parameter
/// 
/// # Returns
/// 
/// Description of the return value

语言

此自述文件也可在以下网址获得: