npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iflow-mcp/0xkoda-mcp-rust-docs

v1.0.1

Published

MCP server for fetching Rust crate documentation

Downloads

128

Readme

MCP Rust Documentation Server

This is a Model Context Protocol (MCP) server that fetches and returns documentation for Rust crates providing essential context for LLM's when working with Rust code.

Features

  • Fetches documentation for any Rust crate available on docs.rs
  • Strips HTML and formats the content for readability
  • Limits response size to prevent overwhelming the client
  • Uses the latest MCP SDK (v1.6.1)

Installation

# Clone the repository
git https://github.com/0xKoda/mcp-rust-docs.git
cd mcp-rust-docs

# Install dependencies
npm install

Prerequisites

  • Node.js
  • npm

Usage

# Start the server directly
npm start

Integrating with AI Assistants

Claude Desktop

Add the following to your Claude Desktop configuration file (claude_desktop_config.json):

{
  "mcpServers": {
    "rust-docs": {
      "command": "node",
      "args": ["/absolute/path/to/index.js"]
    }
  }
}

Replace /absolute/path/to/index.js with the absolute path to the index.js file in this repository.

Example Usage

Once the server is running and configured with your AI assistant, you can ask questions like:

  • "Look up the documentation for the 'tokio' crate"
  • "What features does the 'serde' crate provide?"
  • "Show me the documentation for 'ratatui'"
  • "Can you explain the main modules in the 'axum' crate?"

The AI will use the lookup_crate_docs tool to fetch and display the relevant documentation.

Testing with MCP Inspector

You can test this server using the MCP Inspector:

npx @modelcontextprotocol/inspector

Then select the "Connect to a local server" option and follow the prompts.

How It Works

This server implements a single MCP tool called lookup_crate_docs that:

  1. Takes a Rust crate name as input (optional, defaults to 'tokio' if not provided)
  2. Fetches the documentation from docs.rs
  3. Converts the HTML to plain text using the html-to-text library
  4. Truncates the content if it exceeds 8000 characters
  5. Returns the formatted documentation in the proper MCP response format

SDK Implementation Notes

This server uses the MCP SDK with carefully structured import paths. If you're modifying the code, be aware that:

  1. The SDK requires importing from specific paths (e.g., @modelcontextprotocol/sdk/server/mcp.js)
  2. We use the high-level McpServer API rather than the low-level tools
  3. The tool definition uses Zod for parameter validation
  4. Console output is redirected to stderr to avoid breaking the MCP protocol
  5. The tool returns properly formatted MCP response objects

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT