https://github.com/spacemeowx2/cargo-doc-mcp
https://github.com/spacemeowx2/cargo-doc-mcp
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/spacemeowx2/cargo-doc-mcp
- Owner: spacemeowx2
- License: mit
- Created: 2025-03-04T19:08:45.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-19T03:56:26.000Z (8 months ago)
- Last Synced: 2025-05-07T17:21:32.522Z (7 months ago)
- Language: TypeScript
- Size: 43 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- toolsdk-mcp-registry - ❌ docs.rs
- metorial-index - Rust Documentation Manager - Manage and interact with Rust documentation, performing tasks such as checking, building, and searching through project documentation. Access crate documentation and symbol listings to enhance development workflows. (Document Processing)
README
# cargo doc MCP Server
A MCP server for managing Rust documentation through cargo doc commands. This server provides tools to check, build, and search Rust documentation locally.
## Features
### Tools
- `get_crate_doc` - Get crate's main documentation page for understanding overall concepts and usage
- Parameters:
- `project_path`: Path to the Rust project (must be absolute path)
- `crate_name`: Name of the crate to get documentation for
- `list_symbols` - List all symbols (structs, enums, traits, etc.) in a crate's documentation
- Parameters:
- `project_path`: Path to the Rust project (must be absolute path)
- `crate_name`: Name of the crate to list symbols for
- `search_doc` - Search within a crate's documentation
- Parameters:
- `project_path`: Path to the Rust project (must be absolute path)
- `crate_name`: Name of the crate to search in
- `query`: Search query (keyword or symbol)
- `limit` (optional): Maximum number of results to return (default: 10)
## Requirements
- Node.js 16 or later
- Rust and Cargo installed
## Installation
Install dependencies:
```bash
pnpm install
```
Build the server:
```bash
pnpm run build
```
For development with auto-rebuild:
```bash
pnpm run watch
```
## Usage
Add the following configuration:
```json
{
"mcpServers": {
"docs-rs-mcp": {
"command": "/absolute/path/to/docs-rs-mcp/build/index.js"
}
}
}
```
## Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector:
```bash
pnpm run inspector
```
The Inspector will provide a URL to access debugging tools in your browser.
## Cache System
The server maintains a cache of built documentation paths to improve performance. Cache entries expire after 24 hours to ensure documentation stays up-to-date.
## License
MIT