query_rust_docsLABSCO SUMMARY
One crate per instance, and the answer is grounded in that crate's docs only.
That constraint is the point: the model is told to answer from the retrieved documentation and nothing else, which is what stops it inventing an API that was renamed two releases ago. Run several instances for several crates. The first run per crate and feature set does the embedding work and caches it — do that from a terminal, not from inside your editor, or the first question will look like a hang.
What it is
A server that fetches one crate's documentation, embeds it, and answers questions about that crate from the retrieved text. One server instance per crate.
What you get
- query_rust_docs — ask a specific question about the crate's API or usage and get an answer built only from its documentation
- Semantic search over the docs using OpenAI's text-embedding-3-small, with the answer summarised by gpt-4o-mini-2024-07-18
- A crate:// resource naming the crate this instance is configured for
- Feature-aware documentation: pass -F or --features for crates that need a feature enabled for cargo doc to succeed
- Caching by crate, version and feature set in the XDG data directory, so later launches skip generation
- Several instances side by side, one per crate, in the same client
Requirements
An OpenAI API key in OPENAI_API_KEY, and network access. Download the prebuilt binary from the releases page or build with the Rust toolchain. Launch it with a Cargo package ID — a crate name, or a name with a version requirement. Run it once from the command line for a new crate before wiring it into an assistant: first-run embedding takes a while and costs a fraction of a cent for most crates.
Setup effort
Follow the published steps — Go to the Releases page.
USE CASES
Writing against a crate that changed recently
Ask about the current API and get an answer from documentation generated now, not from training data.
Getting a working snippet for a common task
Ask how to do the thing — a simple GET request, say — and have the crate's own docs answer.
Covering several crates in one session
Run one instance per crate in your client, each named for the crate it serves.
Working with a crate that needs a feature enabled
Pass the feature list at launch so documentation generation succeeds at all.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation. Each instance serves one crate at one version and feature set, so covering five crates means running five servers; -F/--features changes which docs query_rust_docs sees.
Requires
OPENAI_API_KEY in your environment
INSTALLATION
Connect your client
Server setup
Go to the Releases page.
Download the appropriate archive (.zip for Windows, .tar.gz for Linux/macOS) for your system.
Extract the rustdocs_mcp_server (or rustdocs_mcp_server.exe) binary.
Place the binary in a directory included in your system's PATH environment variable (e.g., /usr/local/bin, ~/bin).
MCP Clients
Claude Desktop
{
"mcpServers": {
"rust-docs-serde": {
"command": "<YOUR_PATH_TO_RUSTDOCS_MCP_SERVER>",
"args": [
"serde@^1.0"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
},
"rust-docs-async-stripe-rt": {
"command": "rustdocs_mcp_server",
"args": [
"async-stripe@0.40",
"-F",
"runtime-tokio-hyper-rustls"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}The two entries show both ways to name the binary: once the steps above have put it on your PATH, the bare rustdocs_mcp_server is enough; otherwise <YOUR_PATH_TO_RUSTDOCS_MCP_SERVER> is its full path. Each entry serves one crate — the key is a name you choose, and the argument (serde@^1.0) is the crate and version it documents.
Roo Code
{
"mcpServers": {
"rust-docs-reqwest": {
"command": "<YOUR_PATH_TO_RUSTDOCS_MCP_SERVER>",
"args": [
"reqwest@0.12"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
},
"disabled": false,
"alwaysAllow": []
},
"rust-docs-async-stripe": {
"command": "rustdocs_mcp_server",
"args": [
"async-stripe@0.40",
"-F",
"runtime-tokio-hyper-rustls"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
},
"disabled": false,
"alwaysAllow": []
}
}
}The two entries show both ways to name the binary: once the steps above have put it on your PATH, the bare rustdocs_mcp_server is enough; otherwise <YOUR_PATH_TO_RUSTDOCS_MCP_SERVER> is its full path. Each entry serves one crate — the key is a name you choose, and the argument (reqwest@0.12) is the crate and version it documents.