Get the FREE Ultimate OpenClaw Setup Guide →

rustdoc

Rustdoc MCP server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository: git clone https://github.com/KevinT3Hu/rustdoc-mcp.git cd rustdoc-mcp

  2. Build the project in release mode: cargo build --release

  3. 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

Sponsor this space

Reach thousands of developers