rust-docs-mcp-server

MCP.Pizza Chef: Govcraft

Rust libraries change quickly, and coding assistants often suggest code that no longer works. Run one copy of this for each library you care about, and it downloads that library's current documentation, indexes it, and answers questions from that text alone, so the advice matches today's version rather than a memory of an old one. An OpenAI account is needed for the indexing and the answers, usually costing well under a dollar per library. Nothing has changed since November 2025.

Coding

Use This MCP server To

Ask how a Rust library expects a function to be used Check whether an option still exists in the current version Get an answer drawn only from the official documentation Stop my assistant suggesting code that no longer compiles Keep several libraries' documentation on hand at once

README

Rust Docs MCP Server

License: MIT

⭐ Like this project? Please star the repository on GitHub to show your support and stay updated! ⭐

Motivation

Modern AI-powered coding assistants (like Cursor, Cline, Roo Code, etc.) excel at understanding code structure and syntax but often struggle with the specifics of rapidly evolving libraries and frameworks, especially in ecosystems like Rust where crates are updated frequently. Their training data cutoff means they may lack knowledge of the latest APIs, leading to incorrect or outdated code suggestions.

This MCP server addresses this challenge by providing a focused, up-to-date knowledge source for a specific Rust crate. By running an instance of this server for a crate (e.g., serde, tokio, reqwest), you give your LLM coding assistant a tool (query_rust_docs) it can use before writing code related to that crate.

When instructed to use this tool, the LLM can ask specific questions about the crate's API or usage and receive answers derived directly from the current documentation. This significantly improves the accuracy and relevance of the generated code, reducing the need for manual correction and speeding up development.

Multiple instances of this server can be run concurrently, allowing the LLM assistant to access documentation for several different crates during a coding session.

This server fetches the documentation for a specified Rust crate, generates embeddings for the content, and provides an MCP tool to answer questions about the crate based on the documentation context.

Features

  • Targeted Documentation: Focuses on a single Rust crate per server instance.
  • Feature Support: Allows specifying required crate features for documentation generation.
  • Semantic Search: Uses OpenAI's text-embedding-3-small model to find the most relevant documentation sections for a given question.
  • LLM Summarization: Leverages OpenAI's gpt-4o-mini-2024-07-18 model to generate concise answers based only on the retrieved documentation context.
  • Caching: Caches generated documentation content and embeddings in the user's XDG data directory (~/.local/share/rustdocs-mcp-server/ or similar) based on crate, version, and requested features to speed up subsequent launches.
  • MCP Integration: Runs as a standard MCP server over stdio, exposing tools and resources.

Prerequisites

  • OpenAI API Key: Needed for generating embeddings and summarizing answers. The server expects this key to be available in the OPENAI_API_KEY environment variable. (The server also requires network access to download crate dependencies and interact with the OpenAI API).

Installation

rust-docs-mcp-server FAQ

Is this still maintained?
It has gone quiet. The repository is not archived, but the last change was in November 2025 and no successor project is named.
Which apps does it work in?
The author names Claude Desktop, Cursor, Cline and Roo Code, and other apps that speak the same protocol should work as well.
Do I need a key?
Yes. An OpenAI key is required, since the documentation is indexed and the answers are written using their models.
What does it cost to run?
Very little. The author measured fractions of a penny for typical libraries and about eighteen cents for an unusually large one.
Can I use this to get up-to-date advice on a fast-moving library?
Yes. That is exactly the point, since answers come from the documentation it just downloaded rather than older knowledge.
Why is the first run so slow?
It has to fetch and index the whole documentation set the first time. After that, the saved copy makes startup fast.
Does one copy cover every library?
No. You run a separate copy per library, though several can run side by side during the same session.
How hard is the setup?
It leans developer: you download a program, run it once from a terminal per library, and add it to your app's settings.