Rust Docs
БесплатноНе проверенFetches and returns Rust crate documentation from docs.rs, providing essential context for working with Rust code.
Описание
Fetches and returns Rust crate documentation from docs.rs, providing essential context for working with Rust code.
README
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:
- Takes a Rust crate name as input (optional, defaults to 'tokio' if not provided)
- Fetches the documentation from docs.rs
- Converts the HTML to plain text using the html-to-text library
- Truncates the content if it exceeds 8000 characters
- 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:
- The SDK requires importing from specific paths (e.g.,
@modelcontextprotocol/sdk/server/mcp.js) - We use the high-level McpServer API rather than the low-level tools
- The tool definition uses Zod for parameter validation
- Console output is redirected to stderr to avoid breaking the MCP protocol
- The tool returns properly formatted MCP response objects
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Установка Rust Docs
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/0xkoda/mcp-rust-docsFAQ
Rust Docs MCP бесплатный?
Да, Rust Docs MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Rust Docs?
Нет, Rust Docs работает без API-ключей и переменных окружения.
Rust Docs — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Rust Docs в Claude Desktop, Claude Code или Cursor?
Открой Rust Docs на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
автор: duxiaohuiSupabase
Database, auth and storage
автор: SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Rust Docs with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
