Rust Docs

v1.0.0โ€ขDeveloper Toolsโ€ขstable

๐Ÿฆ€ 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.

aiai-safetycachingcargocoding-assistant
Share:
276
Stars
0
Downloads
0
Weekly
0/5

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

Fetch current Rust crate documentation
Prevent outdated code suggestions
Ensure accurate Rust context
Govcraft

Maintainer

LicenseMIT
Languagerust
Versionv1.0.0
UpdatedMay 14, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y rust-docs

Manual Installation

npx -y rust-docs

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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_server
2

Place 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/
3

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..."
4

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"
      }
    }
  }
}
5

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.

6

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,json

Rust 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.

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.

Quick Config Preview

{ "mcpServers": { "rust-docs": { "command": "npx", "args": ["-y", "rust-docs"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides