Rust Docs MCP Server
An MCP server that answers an agent's questions from the documentation of one Rust crate at an exact version
- 300 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The server runs `cargo doc` for the chosen crate, which means building third-party code on your machine
- Documentation fragments and the agent questions go to OpenAI together with your key
Install
- Works in
Manual install
{
"mcpServers": {
"rust-docs-reqwest": {
"command": "/path/to/your/rustdocs_mcp_server",
"args": ["reqwest@0.12"],
"env": {"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"}
}
}
}Example for `mcp_settings.json`; run the server for the crate by hand first so the cache is built.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The server runs `cargo doc` for the chosen crate, which means building third-party code on your machine
- Documentation fragments and the agent questions go to OpenAI together with your key
This is third-party code. Review the repository files before installing.
What it does
Rust Docs MCP Server starts for one crate and gives the agent the query_rust_docs tool. The agent asks a question such as "how do I make a simple GET with reqwest", and the server finds the relevant documentation sections and answers from them without relying on model memory. The crate is set with a Cargo spec such as `serde@^1.0` or `reqwest@0.12.0`, and the `-F` flag turns on the crate features needed. On first start the server builds the docs with `cargo doc`, parses the HTML and builds embeddings through OpenAI with the text-embedding-3-small model. gpt-4o-mini writes the answer from the retrieved context. Documentation and embeddings are cached in the XDG data directory separately for each crate, version and feature set, so later starts are fast. The crate://<name> resource reports which crate a server is set up for.
Who it is for. For Rust developers working with Cursor, Cline or Roo Code who want the agent to check the documentation of the exact crate version.
Good fit when
- A crate updates often and the agent suggests calls from old versions that no longer exist in the API
- You need an answer for the crate version pinned in Cargo.toml
- A crate needs features without which `cargo doc` does not build, such as `async-stripe` with `runtime-tokio-hyper-rustls`
- One session needs the documentation of several crates: each gets its own instance
- You want to pay for embeddings once and then work from the local cache
Not a fit when
- You have no OpenAI key or access to its API: without them the server cannot build embeddings or answer
- You need documentation for a language other than Rust, or for something that is not a registry crate
- You need an answer with no language model in the loop: the server has the model retell what it found rather than return verbatim excerpts
- The agent has to read the dependency source code: the server works only with built documentation
Example request
First query the reqwest docs on how to send a POST with JSON and an authorization header. Then write the function for version 0.12.MCP
- Transport
- stdio
- Authentication
- API key
Environment variables
OPENAI_API_KEYrequired, secret- OpenAI key for embeddings and documentation answers.
Limitations
You need an OpenAI key in the `OPENAI_API_KEY` variable and network access, and the OpenAI API is unavailable from Russia. The embedding and answer models are fixed, and the documentation offers no setting to pick another. The author advises running the first build for a new crate, version or feature set by hand before connecting it to an agent. Embeddings cost money, though not much: for async-stripe with more than 5,000 pages they came to 0.18 US dollars. The repository was last updated in November 2025.
How to disable. Remove the server entry from the client configuration, for example from mcp_settings.json in Roo Code. The documentation cache lives in ~/.local/share/rustdocs-mcp-server/ and can be deleted by hand.
FAQ
How do I connect Rust Docs MCP Server to Roo Code or Cursor?
Download the binary from the releases, run it once for the needed crate and add an mcpServers entry with the rustdocs_mcp_server command, the `reqwest@0.12` argument and the OpenAI key in the environment.
How much do the embeddings cost?
For most crates it is fractions of a cent, and the large async-stripe with more than 5,000 documentation pages cost 0.18 US dollars. The result is cached, so you pay once.
How do I set the crate version and features?
The version goes in the argument: `serde@^1.0`, `reqwest@0.12.0` or plain `tokio` for the latest. Features are listed with `-F`, for example `rustdocs_mcp_server "async-stripe@0.40" -F runtime-tokio-hyper-rustls`.
Can I keep the docs of several crates at once?
Yes, with one instance per crate. In the client configuration you create separate entries such as rust-docs-reqwest and rust-docs-async-stripe.
What does the server expose over MCP?
The query_rust_docs tool with a single question parameter, the crate://<name> resource with the crate name, and logs through logging/message notifications. Answers begin with the prefix "From <crate> docs:".
Discussion
No questions or reviews yet.
Related
MCP serversrust-analyzer MCP: Rust code navigation for agents
r3bl-rust-analyzer-mcp-server
A Rust MCP server on standard threads: the agent gets hover info, go to definition, references, formatting and compiler diagnostics from rust-analyzer
Docs MCP Server
Grounded Docs MCP Server
A local MCP server that indexes docs from websites, GitHub, npm, PyPI and files and gives the agent version-aware search
Ref's MCP server: documentation search for APIs and libraries that hands the agent only the relevant parts of pages
A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks
A fast MCP server in Rust extended with WebAssembly plugins: plugins load from OCI, files, http(s) and s3, and OCI signatures can be verified
An MCP server and CLI for code research: search and understand your project and all of GitHub with fewer tokens
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Rust Docs MCP Server (this entry) | no | API key | 300 | |
| mcpdoc | no | not required | 1,030 | serves documentation from llms.txt files you pick, with no embeddings |
| Context Hub | no | 13,986 | a CLI with curated API docs by version and language plus local notes |
README in short
The author explains the motivation: assistants know syntax well but lag behind fast-moving crates because of their training cutoff. The server closes that gap with a targeted source and runs as an ordinary stdio MCP server. Compiled archives for Windows, Linux and macOS are on the releases page, and building from source is optional.