Rust Docs MCP Server is an MCP server that provides up-to-date documentation and semantic API search for specific Rust crates to AI coding assistants. It connects local Rust documentation generated via Cargo to language models through the Model Context Protocol over standard input/output. Designed for Rust developers using coding environments like Claude Desktop, Cursor, and Roo Code, it enables assistants to consult precise library APIs before writing code. When configured for a targeted crate such as serde or reqwest, the server downloads the documentation, parses the HTML, generates semantic embeddings using OpenAI models, and caches the indexed vectors locally. LLM assistants can invoke the query_rust_docs tool to retrieve verified API signatures, usage patterns, and framework explanations directly from the documentation context. By grounding answers in specific crate versions and active feature flags, the server helps prevent hallucinated functions and outdated syntax caused by LLM training cutoffs, significantly improving the accuracy of Rust code generation.
Category: Developer Tools & Code Intelligence
Tags: crates, documentation, programming, rust
rustdocs_mcp_server, and move it into your system PATH (or build from source using cargo build --release). 2. Set your OpenAI API key in your environment: bash export OPENAI_API_KEY="sk-..." 3. Pre-cache your crate by running the server once in your terminal until it displays startup confirmation, then stop it with Ctrl+C: bash rustdocs_mcp_server "serde@^1.0" 4. Register the server in your MCP client configuration (such as Claude Desktop or Roo Code mcp_settings.json): json { "mcpServers": { "rust-docs-serde": { "command": "rustdocs_mcp_server", "args": ["serde@^1.0"] } } }Part of MCP Servers
You can download the pre-compiled binary for Linux, macOS, or Windows directly from the GitHub releases page and add it to your system PATH. Alternatively, you can clone the repository and compile the source code locally using the Rust toolchain by executing cargo build --release.
It serves documentation for a specified Rust crate using semantic search and language model summarization. When an AI coding assistant asks a question, the server queries cached documentation embeddings and returns focused answers and code examples grounded in the current crate version.
Any client supporting the standard Model Context Protocol over stdio can connect to this server. Tested clients include Claude Desktop, Roo Code, Cursor, and Cline. You can configure multiple instances simultaneously to target different crates.
Yes, an OpenAI API key must be provided via the OPENAI_API_KEY environment variable. The server relies on OpenAI models to generate text embeddings for the documentation and to summarize query answers before sending them to your MCP client.
Yes, the repository is released as open-source software under the MIT license on GitHub, allowing free usage, modification, and integration with your development workflows.