抄写蟹
](https://github.com/blue-orange-yellow/scribe-crab/stargazers)
为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"
}
}
}
}用法
- 将格式文件路径设置为环境变量
- 启动MCP服务器
- 通过MCP客户端(如Cursor)使用该工具
- 询问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语言
此自述文件也可在以下网址获得:
