内容
# scribe-crab


[](https://github.com/blue-orange-yellow/scribe-crab/stargazers)
生成 Rust 文档注释的 MCP 服务器。

## 概述
scribe-crab 是一个 MCP(模型上下文协议)服务器,帮助开发者为他们的 Rust 函数生成文档注释。它以 Rust 函数代码作为输入,并生成遵循可自定义格式的文档注释。
## 特性
- 为 Rust 函数生成文档注释
- 使用可自定义的格式模板
- 与 MCP 客户端(如 Cursor IDE)集成
## 安装
克隆仓库并构建:
```bash
git clone https://github.com/blue-orange-yellow/scribe-crab.git
cd scribe-crab
cargo build --release
```
## 配置
要与像 Cursor 这样的客户端一起使用,您需要将其配置为 MCP 服务器。示例 Cursor 配置:
```json
{
"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` 文件进行自定义。
示例:
```rust
/// # 描述
///
/// 该函数执行 XYZ.
///
/// # 参数
///
/// * - 第一个参数的描述
/// * - 第二个参数的描述
///
/// # 返回
///
/// 返回值的描述
```
## 语言
此 README 也提供以下语言版本:
- [日本語](docs/translations/README.ja.md)
- [中文](docs/translations/README.zh.md)
- [Español](docs/translations/README.es.md)