CrateDocs MCP logo

CrateDocs MCP

by d6e

CrateDocs MCP is an MCP server designed to provide Rust crate documentation lookup for LLMs. It enables LLMs to access documentation for Rust crates they are unfamiliar with.

View on GitHub

Last updated: N/A

What is CrateDocs MCP?

CrateDocs MCP is a Model Context Protocol (MCP) server that provides tools for looking up documentation for Rust crates. It allows Large Language Models (LLMs) to access and utilize Rust crate documentation.

How to use CrateDocs MCP?

To use the server, you can either run it using the unified CLI in STDIN/STDOUT or HTTP/SSE mode. Alternatively, you can directly test the documentation tools from the command line. The server provides tools to lookup crate documentation, search crates, and lookup item documentation. See the README for detailed instructions and examples.

Key features of CrateDocs MCP

  • Lookup crate documentation

  • Search crates on crates.io

  • Lookup item documentation within a crate

  • Supports multiple output formats (markdown, text, json)

  • Implements the Model Context Protocol (MCP)

  • Includes a caching mechanism to prevent redundant API calls

Use cases of CrateDocs MCP

  • Enabling LLMs to understand and generate Rust code

  • Providing context to LLMs when working with unfamiliar Rust crates

  • Automated documentation lookup for code analysis tools

  • Integrating Rust documentation into IDEs and other development environments

FAQ from CrateDocs MCP

What is the Model Context Protocol (MCP)?

MCP is a protocol that allows servers to provide context to LLMs. It enables easy integration with LLM clients that support the protocol.

How do I run the server?

You can run the server using the unified CLI in STDIN/STDOUT or HTTP/SSE mode. See the 'Running the Server' section in the README for detailed instructions.

What tools are available?

The server provides three tools: lookup_crate (retrieves crate documentation), search_crates (searches crates on crates.io), and lookup_item (retrieves documentation for a specific item in a crate).

How do I specify the version of a crate?

You can specify the version of a crate using the --version parameter in the lookup_crate and lookup_item tools.

Where does the server get its documentation from?

The server interfaces with docs.rs for crate documentation and crates.io for search functionality.