Rust 文档 MCP 服务器
一个MCP(模型上下文协议)服务器,提供来自docs.rs的Rust文档访问。此服务器允许AI工具搜索文档、类型信息、功能标志、版本号和符号定义/源代码。
特性
- 在 docs.rs 上搜索 crates
- 获取特定包和版本的文档
- 获取类型信息(结构体、枚举、特性等)
- 获取包的特性标志
- 获取包的可用版本
- 获取特定项目的源代码
- 在包内搜索符号
安装
这个项目使用Bun进行开发,但构建后的服务器可以用Node.js运行。
# Clone the repository
git clone https://github.com/yourusername/rust-docs-mcp-server.git
cd rust-docs-mcp-server
# Install dependencies
bun install建筑
# Build the server
bun run build这将创建一个包含编译后的JavaScript文件的构建目录。
奔跑
# Run the development server
bun run dev
# Or run the built server
bun run start使用MCP客户端
此服务器实现了模型上下文协议,可与任何MCP客户端配合使用。要与MCP客户端配合使用,您需要配置客户端以连接到此服务器。
可用工具
服务器提供以下工具:
search_crates在 docs.rs 上搜索 crateget_crate_documentation获取特定crate的文档get_type_info获取特定项目的类型信息get_feature_flags获取一个crate的特性标志get_crate_versions获取一个包的可用版本get_source_code获取特定项目的源代码search_symbols在crate内搜索符号
测试
# Run tests
bun test许可证
麻省理工学院
