rust-docs-mcp-server
by: laptou
rust docs mcp server
📌Overview
Purpose: To provide an access point for AI tools to retrieve Rust documentation through an MCP server.
Overview: The Rust Docs MCP Server is a Model Context Protocol server designed to facilitate access to comprehensive Rust documentation from docs.rs. It enables various features including searching for crates, retrieving documentation, and obtaining type information, thereby enhancing the development experience with Rust.
Key Features:
-
Search for Crates: Allows users to search for specific Rust crates available on docs.rs, enhancing discoverability.
-
Get Documentation: Enables access to detailed documentation for specific crates and their respective versions, ensuring developers have the information they need.
-
Get Type Information: Provides in-depth type information including structs, enums, and traits, supporting developers in understanding data structures.
-
Get Feature Flags: Offers details on feature flags for crates, aiding developers in managing library capabilities.
-
Get Available Versions: Lists available versions for crates, ensuring compatibility and up-to-date usage.
-
Get Source Code: Accesses source code for specific items, allowing for deeper insights into library implementations.
-
Search Symbols: Facilitates the search for symbols within crates, promoting easier navigation and usage of the codebase.
Rust Docs MCP Server
An MCP (Model Context Protocol) server that provides access to Rust documentation from docs.rs. This server allows AI tools to search for documentation, type information, feature flags, version numbers, and symbol definitions/source code.
Features
- Search for crates on docs.rs
- Get documentation for specific crates and versions
- Get type information (structs, enums, traits, etc.)
- Get feature flags for crates
- Get available versions for crates
- Get source code for specific items
- Search for symbols within crates
Installation
This project uses Bun for development, but the built server can run with Node.js.
# Clone the repository
git clone https://github.com/yourusername/rust-docs-mcp-server.git
cd rust-docs-mcp-server
# Install dependencies
bun install
Building
# Build the server
bun run build
This will create a build directory with the compiled JavaScript files.
Running
# Run the development server
bun run dev
# Or run the built server
bun run start
Usage with MCP Clients
This server implements the Model Context Protocol and can be used with any MCP client. Configure the client to connect to this server.
Available Tools
search_crates
: Search for crates on docs.rsget_crate_documentation
: Get documentation for a specific crateget_type_info
: Get type information for a specific itemget_feature_flags
: Get feature flags for a crateget_crate_versions
: Get available versions for a crateget_source_code
: Get source code for a specific itemsearch_symbols
: Search for symbols within a crate
Testing
# Run tests
bun test
License
MIT