Cargo Doc MCP Server
货物文档 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)
Related MCP server: MCP Rust Docs Server
要求
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 小时后过期,以确保文档保持最新状态。
执照
麻省理工学院
Available Tools
3 toolsget_crate_docA
Get crate's main documentation page. Useful for unresolved imports (e.g. use get_crate_doc when seeing 'unresolved import tokio::sync') or understanding crate features.
Inputs: project_path (required), crate_name (required).
list_symbolsB
List all symbols in a crate. Use when implementing traits or exploring available types. Shows structs, enums, traits with their paths.
Inputs: project_path (required), crate_name (required).
search_docB
Search crate docs for specific features, error messages, or usage examples. Helps debug compilation issues or learn new APIs.
Inputs: project_path (required), crate_name (required), query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: get_crate_doc retrieves main documentation pages, list_symbols enumerates all symbols in a crate, and search_doc performs targeted searches within documentation. There is no overlap in functionality, making it easy for an agent to select the appropriate tool based on the task.
All tool names follow a consistent verb_noun pattern (get_crate_doc, list_symbols, search_doc) with clear, descriptive verbs. There are no deviations in naming conventions, making the tool set predictable and easy to understand.
With only 3 tools, the server feels somewhat thin for a documentation-focused domain, as it might lack operations like updating or managing documentation. However, the tools cover core use cases, so it's borderline but not severely mismatched.
The tools provide good coverage for basic documentation tasks: retrieving main docs, listing symbols, and searching. Minor gaps exist, such as no direct support for navigating between documentation sections or handling version-specific docs, but agents can likely work around these limitations.
Maintenance
Related MCP Connectors
Search and read Rust documentation for the standard library and any crate on crates.io
Versioned documentation registry and semantic search for AI tools and coding assistants.
Search and read official Proa Rust framework documentation. Public, read-only, no credentials.
MCP server for opencode documentation, generated by doc2mcp.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides AI tools with access to Rust documentation from docs.rs, enabling search for crates, documentation, type information, feature flags, version information, and source code.33-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server for fetching Rust crate documentation from docs.rs using the rustdoc JSON API.13Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server that enables searching for Rust crates and their documentation from docs.rs, allowing AI agents to find required crates and access the latest documentation.422 npm38MIT
- AlicenseAqualityCmaintenanceMCP server that fetches and searches the latest stable documentation for any package from PyPI, npm, and crates.io.5MIT