MCPSERV.CLUB
Govcraft

Rust Docs MCP Server

MCP Server

On‑demand, up-to-date Rust crate documentation for LLMs

Stale(55)
193stars
2views
Updated 22 days ago

About

A lightweight MCP server that fetches, embeds, and summarizes the current documentation of a specified Rust crate. It provides an LLM tool for precise API queries, improving coding assistant accuracy.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Rust Docs MCP Server

The Rust Docs MCP Server fills a critical gap for AI‑powered coding assistants that operate in the rapidly evolving Rust ecosystem. While many assistants excel at parsing code syntax, they often lack up‑to‑date knowledge of third‑party crates because their training data is frozen at a specific point in time. This server solves that problem by acting as an authoritative, real‑time source of documentation for a single Rust crate. By running an instance per crate (e.g., , , or ), developers can provide their LLM assistant with a dedicated tool——that the model can invoke before generating code that depends on that crate. The result is a significant reduction in incorrect or outdated API usage, leading to faster development cycles and fewer manual corrections.

At its core, the server fetches the current documentation for a specified crate from crates.io, generates semantic embeddings using OpenAI’s lightweight model, and stores both the raw content and embeddings in a local cache. When an LLM asks a question about the crate, the server performs a vector‑search to retrieve the most relevant sections of the documentation. It then forwards those snippets to OpenAI’s model, which produces a concise, context‑aware answer that the assistant can relay to the developer. Because all data is pulled from the live crate documentation, the answers reflect the latest API surface and feature set.

Key capabilities include:

  • Targeted Scope: One server per crate keeps the knowledge base focused and lightweight.
  • Feature Awareness: Users can specify which optional features of a crate to include, ensuring the documentation reflects the exact build configuration they plan to use.
  • Semantic Search: Embedding‑based retrieval guarantees that the assistant receives the most relevant documentation snippets, even for complex queries.
  • LLM Summarization: The summarization step strips away extraneous detail, delivering clear, actionable information.
  • Efficient Caching: By persisting documentation and embeddings in the XDG data directory, subsequent launches are fast and avoid redundant API calls.

Real‑world scenarios where this MCP shines include: a developer working on a new library that integrates and needs precise knowledge of async primitives; a team maintaining a large codebase that frequently updates and wants to avoid breaking changes; or an AI assistant guiding a newcomer through the nuances of ’s request builder. In each case, the assistant can query the server to confirm method signatures, recommended patterns, or feature flags before generating code.

Integration is straightforward for any MCP‑compatible workflow. The server exposes a standard tool over stdio, allowing LLMs to invoke it with natural language prompts. The assistant can then seamlessly weave the returned answer into its code suggestions, creating a smooth developer experience that blends AI reasoning with authoritative, up‑to‑date documentation.