Go

Govcraft/rust-docs-mcp-server

πŸ¦€ 🏠 Provides up-to-date documentation context for a specific Rust crate to LLMs via an MCP tool, using semantic search (embeddings) and LLM summarization.

#Rust#documentation#semantic search
PublisherGovcraft/rust-docs-mcp-server
Submitted date4/19/2025

Rust Docs MCP Server - Overview

Title

Rust Docs MCP Server

A server that fetches and processes Rust crate documentation, enabling AI coding assistants to provide accurate, up-to-date answers about specific crates via semantic search and LLM summarization.

How to Use

Installation

  1. Download Pre-Compiled Binary:

    • Visit the GitHub Releases page.
    • Download the appropriate binary for your OS (Windows/macOS/Linux).
    • Place it in a directory listed in your system’s PATH.
  2. Build from Source (Optional):

    • Requires the Rust toolchain (rustup).
    • Clone the repo and run cargo build --release.

Running the Server

  1. Set your OpenAI API key:
    export OPENAI_API_KEY="sk-..."
  2. Start the server with a crate specification (e.g., serde@^1.0, tokio).
    rustdocs_mcp_server "crate_name@version" --features "feat1,feat2"
  3. For first-time use with a crate, allow time for documentation download and embedding generation (~minutes). Subsequent runs use cached data for faster startup.

MCP Integration

  • The server exposes a tool (query_rust_docs) for AI assistants to query crate documentation.
  • Example MCP call:
    { "method": "callTool", "params": { "tool_name": "query_rust_docs", "arguments": { "question": "How to make a GET request with reqwest?" } } }

Key Features

  • Targeted Documentation: Focuses on a single Rust crate per instance.
  • Semantic Search: Uses OpenAI embeddings to find relevant documentation sections.
  • LLM Summarization: Generates concise answers using gpt-4o-mini.
  • Feature Support: Allows specifying crate features for accurate docs.
  • Caching: Stores docs and embeddings locally (~/.local/share/rustdocs-mcp-server/) to avoid repeated costs.
  • MCP Compliance: Runs over stdio for seamless integration with AI coding tools.

Use Cases

  • AI Coding Assistants: Provide accurate, up-to-date Rust crate API answers (e.g., for serde, tokio, or reqwest).
  • Development Workflow: Reduce manual corrections by ensuring LLM suggestions align with the latest crate versions.
  • Multi-Crate Projects: Run multiple server instances for different crates simultaneously.

License: MIT
GitHub: https://github.com/Govcraft/rust-docs-mcp-server

Visit More

View All