Dynamically retrieves and converts Rust crate documentation from docs.rs and crates.io, enabling instant library informa...
Created byApr 22, 2025
CrateDocs MCP
This is an MCP (Model Context Protocol) server that provides tools for Rust crate documentation lookup. It allows LLMs to look up documentation for Rust crates they are unfamiliar with.
Features
Lookup crate documentation: Get general documentation for a Rust crate
Search crates: Search for crates on crates.io based on keywords
Lookup item documentation: Get documentation for a specific item (e.g., struct, function, trait) within a crate
Installation
Running the Server
There are multiple ways to run the documentation server:
Using the Unified CLI
The unified command-line interface provides subcommands for all server modes:
Directly Testing Documentation Tools
You can directly test the documentation tools from the command line without starting a server:
By default, the HTTP server will listen on http://127.0.0.1:8080/sse.
Available Tools
The server provides the following tools:
1. `lookup_crate`
Retrieves documentation for a specified Rust crate.
Parameters:
crate_name (required): The name of the crate to look up
version (optional): The version of the crate (defaults to latest)
Example:
2. `search_crates`
Searches for Rust crates on crates.io.
Parameters:
query (required): The search query
limit (optional): Maximum number of results to return (defaults to 10, max 100)
Example:
3. `lookup_item`
Retrieves documentation for a specific item in a crate.
Parameters:
crate_name (required): The name of the crate
item_path (required): Path to the item (e.g., 'std::vec::Vec')
version (optional): The version of the crate (defaults to latest)
Example:
Implementation Notes
The server includes a caching mechanism to prevent redundant API calls for the same documentation
It interfaces with docs.rs for crate documentation and crates.io for search functionality
Results are returned as plain text/HTML content that can be parsed and presented by the client
MCP Protocol Integration
This server implements the Model Context Protocol (MCP) which allows it to be easily integrated with LLM clients that support the protocol. For more information about MCP, visit the MCP repository.
License
MIT License
CrateDocs MCP
This is an MCP (Model Context Protocol) server that provides tools for Rust crate documentation lookup. It allows LLMs to look up documentation for Rust crates they are unfamiliar with.
Features
Lookup crate documentation: Get general documentation for a Rust crate
Search crates: Search for crates on crates.io based on keywords
Lookup item documentation: Get documentation for a specific item (e.g., struct, function, trait) within a crate
Installation
Running the Server
There are multiple ways to run the documentation server:
Using the Unified CLI
The unified command-line interface provides subcommands for all server modes:
Directly Testing Documentation Tools
You can directly test the documentation tools from the command line without starting a server:
By default, the HTTP server will listen on http://127.0.0.1:8080/sse.
Available Tools
The server provides the following tools:
1. `lookup_crate`
Retrieves documentation for a specified Rust crate.
Parameters:
crate_name (required): The name of the crate to look up
version (optional): The version of the crate (defaults to latest)
Example:
2. `search_crates`
Searches for Rust crates on crates.io.
Parameters:
query (required): The search query
limit (optional): Maximum number of results to return (defaults to 10, max 100)
Example:
3. `lookup_item`
Retrieves documentation for a specific item in a crate.
Parameters:
crate_name (required): The name of the crate
item_path (required): Path to the item (e.g., 'std::vec::Vec')
version (optional): The version of the crate (defaults to latest)
Example:
Implementation Notes
The server includes a caching mechanism to prevent redundant API calls for the same documentation
It interfaces with docs.rs for crate documentation and crates.io for search functionality
Results are returned as plain text/HTML content that can be parsed and presented by the client
MCP Protocol Integration
This server implements the Model Context Protocol (MCP) which allows it to be easily integrated with LLM clients that support the protocol. For more information about MCP, visit the MCP repository.