
Rust Docs MCP Server

2025.03.03
13
TypeScriptRust文档服务开发工具开发效率
Rust Docs MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,提供对 docs.rs 上 Rust 文档的访问。该服务器允许 AI 工具搜索文档、类型信息、特性标志、版本号以及符号定义/源代码。
View on GitHub
Overview
基本能力
产品定位
Rust Docs MCP Server 是一个专门为 Rust 开发者设计的文档访问服务,通过 MCP 协议提供对 docs.rs 上 Rust 文档的全面访问。
核心功能
- 搜索 docs.rs 上的 crate
- 获取特定 crate 和版本的文档
- 获取类型信息(结构体、枚举、特性等)
- 获取 crate 的特性标志
- 获取 crate 的可用版本
- 获取特定项目的源代码
- 在 crate 中搜索符号
适用场景
- AI 工具集成 Rust 文档查询功能
- 开发者工具链中集成 Rust 文档访问
- 自动化文档生成和分析工具
工具列表
search_crates
: 在 docs.rs 上搜索 crateget_crate_documentation
: 获取特定 crate 的文档get_type_info
: 获取特定项目的类型信息get_feature_flags
: 获取 crate 的特性标志get_crate_versions
: 获取 crate 的可用版本get_source_code
: 获取特定项目的源代码search_symbols
: 在 crate 中搜索符号
使用教程
使用依赖
- 需要安装 Bun 或 Node.js 运行环境
安装教程
# 克隆仓库
git clone https://github.com/yourusername/rust-docs-mcp-server.git
cd rust-docs-mcp-server
# 安装依赖
bun install
# 构建服务器
bun run build
调试方式
# 运行开发服务器
bun run dev
# 或运行构建后的服务器
bun run start
# 运行测试
bun test