rustdoc
Rustdoc MCP server
claude mcp add --transport stdio kevint3hu-rustdoc-mcp-server ./target/release/rustdoc-mcp start --cwd /path/to/your/rust/project \ --env RUST_LOG="debug"
How to use
rustdoc-mcp provides real-time access to Rust crate documentation for your project dependencies. Once running, it inspects your Cargo.toml to discover dependencies, can generate per-crate documentation using cargo +nightly rustdoc, and serves a set of tools to query and retrieve docs in Markdown format. You can use tools like list_deps to see dependencies, list_crate_items to inspect items in a crate (such as std or tokio), search_docs to perform fuzzy searches across available docs, get_module to summarize public items in a module path, and get_docs to fetch the full Markdown documentation for a specific item path (for example std::vec::Vec). Start the server with the provided binary and point it at your Rust project directory with the --cwd flag. The server caches and indexes generated rustdoc JSON for fast responses to queries.
How to install
Prerequisites:
- Rust nightly toolchain (required for rustdoc JSON output): rustup toolchain install nightly
From Source:
-
Clone the repository: git clone https://github.com/KevinT3Hu/rustdoc-mcp.git cd rustdoc-mcp
-
Build the project in release mode: cargo build --release
-
The executable will be available at: target/release/rustdoc-mcp
Usage reminder:
- Ensure your target Rust project compiles and has dependencies via Cargo.toml.
- The server uses cargo +nightly rustdoc to generate JSON docs on demand and caches them in memory for quick access.
Additional notes
Tips and common issues:
- Ensure the Rust nightly toolchain is installed and available in your environment. The server uses nightly rustdoc JSON outputs.
- You can customize the working directory to point to your Rust project with the --cwd option when starting the server.
- For troubleshooting, the server writes logs to /tmp/rustdoc-mcp/server.log. You can enable verbose logs by setting RUST_LOG=debug before starting the server.
- If rustdoc JSON generation fails for a crate, verify that the crate builds successfully with cargo +nightly build and that the crate exposes public documentation notes in its docs.
Related MCP Servers
goose
an open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
cunzhi
告别AI提前终止烦恼,助力AI更加持久
probe
AI-friendly semantic code search engine for large codebases. Combines ripgrep speed with tree-sitter AST parsing. Powers AI coding assistants with precise, context-aware code understanding.
mcp-center
A centralized platform for managing and connecting MCP servers. MCP Center provides a high-performance proxy service that enables seamless communication between MCP clients and multiple MCP servers.
backlog -rust
MCP server for Backlog, project management service.
perplexity-web-api
🔍 Perplexity AI MCP without API key