Rust Docs
๐ฆ 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.
What is Rust Docs?
Rust Docs is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐ฆ 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.
๐ฆ 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.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- ๐ฆ Prevents outdated Rust code suggestions from AI assistants
Use Cases
Maintainer
Works with
Installation
NPM
npx -y rust-docsManual Installation
npx -y rust-docsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Rust Docs
The Rust Docs MCP server solves the problem of AI assistants suggesting outdated or hallucinated Rust API calls by fetching live crate documentation from docs.rs, generating semantic embeddings, and returning accurate, version-specific answers through the query_rust_docs tool. You configure one server instance per crate, and the server caches documentation locally so repeated queries are fast. It requires an OpenAI API key for the embedding and summarization pipeline, making it a practical addition for any Rust developer using an AI coding assistant.
Prerequisites
- Rust toolchain installed (cargo) to build the binary, or a pre-built binary from GitHub Releases
- An OpenAI API key with access to embeddings models (set as OPENAI_API_KEY)
- An MCP-compatible client such as Claude Desktop, Cursor, VS Code with Roo Code, or similar
- Internet access to fetch documentation from docs.rs on first run
Download or build the binary
Download a pre-built binary from GitHub Releases for your platform, or build from source using cargo.
# Build from source
git clone https://github.com/Govcraft/rust-docs-mcp-server.git
cd rust-docs-mcp-server
cargo build --release
# Binary will be at: ./target/release/rustdocs_mcp_serverPlace the binary on your PATH
Copy or symlink the compiled binary to a directory on your PATH so MCP clients can launch it by name.
cp target/release/rustdocs_mcp_server /usr/local/bin/Set your OpenAI API key
The server requires OPENAI_API_KEY at runtime. Set it in your shell environment or provide it directly in the MCP client configuration.
export OPENAI_API_KEY="sk-...your-key-here..."Configure a server instance for a specific crate
Each server instance targets one crate and version. Add a block to your MCP client config for every crate you want documentation for. The crate name and version are passed as command arguments.
{
"mcpServers": {
"rust-docs-serde": {
"command": "rustdocs_mcp_server",
"args": ["serde@^1.0"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
},
"rust-docs-tokio": {
"command": "rustdocs_mcp_server",
"args": ["tokio"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}Wait for first-run caching
On the first launch for a crate, the server fetches and indexes all documentation, which may take a minute or two. Subsequent starts use the cache at ~/.local/share/rustdocs-mcp-server/ and are much faster.
Enable optional crate features
If the crate has feature flags that affect its API, pass them with the -F flag so the documentation index includes those feature-gated items.
rustdocs_mcp_server "[email protected]" -F rustls-tls,jsonRust Docs Examples
Client configuration
Claude Desktop configuration with two crate instances (serde and reqwest). Each instance is a separate named server.
{
"mcpServers": {
"rust-docs-serde": {
"command": "rustdocs_mcp_server",
"args": ["serde@^1.0"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
},
"rust-docs-reqwest": {
"command": "rustdocs_mcp_server",
"args": ["[email protected]"],
"env": {
"OPENAI_API_KEY": "sk-your-key-here"
}
}
}
}Prompts to try
Questions to ask your AI assistant that will trigger the query_rust_docs tool and return accurate, version-specific answers.
- "How do I implement a custom Deserialize for a struct with serde?"
- "What's the correct way to make an async HTTP GET request with reqwest 0.12?"
- "Show me the tokio::select! macro signature and how to cancel futures"
- "How do I configure connection pooling in reqwest?"
- "What serde attributes control field renaming during serialization?"Troubleshooting Rust Docs
Server fails to start with 'OPENAI_API_KEY not set' error
Provide the key in the MCP client config under the 'env' object for the server entry, or set it in your shell profile if running the server manually.
First run is very slow or appears to hang
This is normal โ the server is fetching and embedding the entire crate documentation on first run. For large crates like tokio or async-std this can take several minutes. Check your internet connection if it never completes.
query_rust_docs returns answers that don't match your crate version
Ensure you pin the version precisely in the args (e.g., '[email protected]' rather than just 'reqwest') so the server fetches documentation for exactly the version you are using.
Frequently Asked Questions about Rust Docs
What is Rust Docs?
Rust Docs is a Model Context Protocol (MCP) server that ๐ฆ 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. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Rust Docs?
Install via npm with the command: npx -y rust-docs. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Rust Docs?
Rust Docs works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Rust Docs free to use?
Yes, Rust Docs is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Rust Docs Alternatives โ Similar Developer Tools Servers
Looking for alternatives to Rust Docs? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
โ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
โ 155.8kJava ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Gemini CLI
โ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
โ 87.3kโญ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
โ 86.0kModel Context Protocol Servers
CC Switch
โ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Rust Docs in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Rust Docs?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.