
Rustdocs
STDIOComprehensive Rust documentation server with code analysis and module visualization capabilities.
Comprehensive Rust documentation server with code analysis and module visualization capabilities.
Rust is the language of AI
An MCP (Model Context Protocol) server that provides comprehensive access to Rust crate documentation, source code analysis, dependency trees, and module structure visualization. Built for agents to gain quality insights into Rust projects and build with confidence.
cache_crate_from_cratesio
- Download and cache a specific crate version from crates.iocache_crate_from_github
- Download and cache from GitHub (specify branch or tag)cache_crate_from_local
- Cache from a local file system pathremove_crate
- Remove cached crate versions to free disk spacelist_cached_crates
- View all cached crates with versions and sizeslist_crate_versions
- List cached versions for a specific crateget_crates_metadata
- Batch metadata queries for multiple cratessearch_items_preview
- Lightweight search returning only IDs, names, and typessearch_items
- Full search with complete documentation (may hit token limits)list_crate_items
- Browse all items in a crate with optional filteringget_item_details
- Detailed information about specific items (signatures, fields, etc.)get_item_docs
- Extract just the documentation string for an itemget_item_source
- View source code with configurable context linesget_dependencies
- Analyze direct and transitive dependencies with filteringstructure
- Generate hierarchical module tree using integrated cargo-modulesBy default, crates are cached in ~/.rust-docs-mcp/cache/
. You can customize this location using:
# Command line option rust-docs-mcp --cache-dir /custom/path/to/cache # or set the environment variable export RUST_DOCS_MCP_CACHE_DIR=/custom/path/to/cache rust-docs-mcp
source/
directorymetadata.json
members/
directory:
members/{member-name}/docs.json
- Rustdoc JSON documentationmembers/{member-name}/dependencies.json
- Cargo dependency metadatamembers/{member-name}/metadata.json
- Member-specific cache metadatadocs.json
- Rustdoc JSON documentationdependencies.json
- Cargo dependency metadatacurl -sSL https://raw.githubusercontent.com/snowmead/rust-docs-mcp/main/install.sh | bash
curl -sSL https://raw.githubusercontent.com/snowmead/rust-docs-mcp/main/install.sh | bash
curl -sSL https://raw.githubusercontent.com/snowmead/rust-docs-mcp/main/install.sh | bash -s -- --install-dir /usr/local/bin
Note: This crate is not yet published to crates.io because it depends on
rmcp
which is awaiting its first release.
Rust nightly toolchain (for Rustdoc JSON generation)
rustup toolchain install nightly
Network access to download crates from crates.io
git clone https://github.com/snowmead/rust-docs-mcp cd rust-docs-mcp/rust-docs-mcp cargo build --release ./target/release/rust-docs-mcp install
rust-docs-mcp # Start MCP server rust-docs-mcp install # Install to ~/.local/bin rust-docs-mcp install --force # Force overwrite existing installation rust-docs-mcp --help # Show help
Add the server to your MCP configuration:
{ "rust-docs": { "command": "/path/to/rust-docs-mcp/target/release/rust-docs-mcp", "transport": "stdio" } }