by Govcraft
🦀 Prevents outdated Rust code suggestions from AI assistants. This MCP server fetches current crate docs, uses embeddings/LLMs, and provides accurate context via a tool call.
# Add to your Claude Code skills
git clone https://github.com/Govcraft/rust-docs-mcp-server⭐ Like this project? Please star the repository on GitHub to show your support and stay updated! ⭐
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.
text-embedding-3-small model to find the
most relevant documentation sections for a given question.gpt-4o-mini-2024-07-18 model to
generate concise answers based only on the retrieved documentation context.~/.local/share/rustdocs-mcp-server/ or similar)
based on crate, version, and requested features to speed up subsequent
launches.OPENAI_API_KEY
environment variable. (The server also requires network access to download
crate dependencies and interact with the OpenAI API).The recommended way to install is to download the pre-compiled binary for your operating system from the [GitHub Releases pag...