Cargo Doc MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Enables management of Rust documentation through cargo doc commands, providing tools to check, build, and search Rust documentation locally. Features include retrieving crate documentation pages, listing symbols (structs, enums, traits), and searching within crate documentation.

货物文档 MCP 服务器

一个 MCP 服务器,用于通过 Cargo doc 命令管理 Rust 文档。该服务器提供本地检查、构建和搜索 Rust 文档的工具。

特征

工具

  • get_crate_doc - 获取 crate 的主文档页面,以了解整体概念和用法
    • 参数:
      • project_path :Rust 项目的路径(必须是绝对路径)
      • crate_name :获取文档的包的名称
  • list_symbols - 列出包文档中的所有符号(结构、枚举、特征等)
    • 参数:
      • project_path :Rust 项目的路径(必须是绝对路径)
      • crate_name :列出符号的包的名称
  • search_doc - 在板条箱的文档中搜索
    • 参数:
      • project_path :Rust 项目的路径(必须是绝对路径)
      • crate_name :要搜索的包的名称
      • query :搜索查询(关键字或符号)
      • limit (可选):返回的最大结果数(默认值:10)

要求

  • Node.js 16 或更高版本
  • Rust 和 Cargo 安装

安装

安装依赖项:

pnpm install

构建服务器:

pnpm run build

对于使用自动重建的开发:

pnpm run watch

用法

添加以下配置:

{ "mcpServers": { "docs-rs-mcp": { "command": "/absolute/path/to/docs-rs-mcp/build/index.js" } } }

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们建议使用 MCP Inspector:

pnpm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

缓存系统

服务器会维护已构建文档路径的缓存,以提高性能。缓存条目会在 24 小时后过期,以确保文档保持最新状态。

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

用于管理 Rust 文档的服务器,使用户能够通过 cargo doc 命令在本地检查、构建和搜索 Rust 文档。

  1. Features
    1. Tools
  2. Requirements
    1. Installation
      1. Usage
        1. Debugging
          1. Cache System
            1. License
              ID: l4augy7aft