MCP Directory

How to add Rust Docs MCP Server to Cursor

Gives AI coding assistants up-to-date, crate-specific Rust documentation via semantic search and LLM summarization. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 281 · stdio · apikey

Cursor 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 Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the Rust Docs MCP Server config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of Rust Docs MCP Server's tools to confirm it's connected.

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 Cursor

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 + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.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 Cursor?

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