MCP Directory

How to add Rust Docs MCP Server to Claude Desktop

Gives AI coding assistants up-to-date, crate-specific Rust documentation via semantic search and LLM summarization. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.

Last updated June 14, 2026 ยท 281โ˜… ยท stdio ยท apikey

Claude Desktop config for Rust Docs MCP Server

cargo build --release
{
  "mcpServers": {
    "rust-docs-mcp-server": {
      "command": "rustdocs_mcp_server",
      "args": [
        "serde@^1.0"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
      }
    }
  }
}

Setup steps

  1. 1Open Claude Desktop โ†’ Settings โ†’ Developer โ†’ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
  2. 2Paste the Rust Docs MCP Server config below under the top-level "mcpServers" key.
  3. 3Fill in any placeholder secrets (API keys, paths) in the snippet.
  4. 4Save the file, then fully quit and reopen Claude Desktop.
  5. 5Open a chat and confirm Rust Docs MCP Server's tools appear under the ๐Ÿ”Œ tools menu.

Before you start

  • OpenAI API key set in the OPENAI_API_KEY environment variable
  • Network access to download crate dependencies and reach the OpenAI API
  • The rustdocs_mcp_server binary (download a pre-compiled release, or build from source with the Rust toolchain via `cargo build --release`)

What Rust Docs MCP Server can do in Claude Desktop

query_rust_docs

Query documentation for the specific Rust crate the server was started for, using semantic search and LLM summarization. Takes a required `question` string about the crate's API or usage and returns a text answer derived only from the relevant documentation context, prefixed with `From <crate_name> docs:`.

Security

Requires an OpenAI API key supplied via the OPENAI_API_KEY environment variable; the key is used to call the OpenAI API for embedding generation and answer summarization. The server needs network access to download crate dependencies and reach the OpenAI API. First-run embedding generation incurs a small OpenAI cost (the README cites fractions of a US penny for most crates, up to $0.18 for a very large crate).

Rust Docs MCP Server + Claude Desktop FAQ

Where is the Claude Desktop config file?

Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Rust Docs MCP Server config there under the "mcpServers" key and restart the client.

Is Rust Docs MCP Server safe to use with Claude Desktop?

Requires an OpenAI API key supplied via the OPENAI_API_KEY environment variable; the key is used to call the OpenAI API for embedding generation and answer summarization. The server needs network access to download crate dependencies and reach the OpenAI API. First-run embedding generation incurs a small OpenAI cost (the README cites fractions of a US penny for most crates, up to $0.18 for a very large crate).

Do I need an OpenAI API key?

Yes. The server uses OpenAI's text-embedding-3-small model to generate embeddings and gpt-4o-mini-2024-07-18 to summarize answers. Provide the key via the OPENAI_API_KEY environment variable.

How much does it cost to run?

Only the first run for a given crate, version, and feature set incurs an OpenAI cost for generating embeddings โ€” typically fractions of a US penny for most crates. The README notes that even a large crate like async-stripe (5000+ doc pages) cost about $0.18 USD during testing. Results are cached, so subsequent launches don't re-incur the cost.

Can one server handle multiple crates?

No โ€” each server instance targets a single crate, specified by a Cargo Package ID (e.g. `serde@^1.0`). To cover several crates, configure multiple server instances, each with its own entry in your MCP client's mcpServers config.

View repo Full Rust Docs MCP Server page