mcp-rustdoc-parser
The mcp-rustdoc-parser is a tool designed to parse Rust documentation and generate structured data. This tool facilitates the visualization and management of documentation within Rust projects. By converting Rust documentation into JSON format, it enables seamless integration with other tools.
GitHub Stars
2
User Rating
Not Rated
Favorites
0
Views
16
Forks
1
Issues
0
π MCP Rust Documentation Parser Server
A Model Context Protocol (MCP) server that parses Rust project documentation and extracts detailed information about requested items, communicating over stdio transport.
β¨ Features
- π Parse Rust Documentation: Generate markdown documentation from Rust libraries
- π§© Extract Item Details: Find and extract specific items (functions, structs, enums) from the documentation
- π Stdio Transport: Simple and efficient communication using standard input/output
- π οΈ MCP Compatible: Fully compliant with the Model Context Protocol specification
- π Async Processing: Built with Tokio for efficient asynchronous operations
π Installation
Prerequisites
- Rust and Cargo (latest stable version)
- For documentation generation:
rustdoc-jsonandrustdoc-mdtools
Setup
- Clone the repository:
git clone https://github.com/yourusername/mcp-rs.git
cd mcp-rs
- Build the project:
cargo build
π§ Usage
Running the Server
cargo run --bin doc_parser_server
Testing with MCP Inspector
The server can be tested using the MCP Inspector tool:
# Install and run the MCP Inspector
RUST_LOG=debug npx @modelcontextprotocol/inspector cargo run --bin doc_parser_server
# In another terminal, run the server
cargo run --bin doc_parser_server
Then open the Inspector at http://localhost:6274 and connect to your server using:
- Transport Type: STDIO
- Command: cargo
- Arguments: run --bin doc_parser_server
API
The server exposes the following MCP tool:
parse_docs
Parses Rust project documentation and extracts information about a specific item.
Parameters:
project_path: Path to the Rust projectlibrary: Name of the library to parseitem: Name of the item to find (function, struct, enum, etc.)
Returns:
- Detailed information about the requested item, including documentation, signature, and other metadata
ποΈ Architecture
The server is built with the following components:
- doc_parser_server.rs: Main server implementation with MCP protocol handling
- doc_generator.rs: Generates markdown documentation from Rust projects
- doc_item_finder.rs: Extracts specific items from the generated documentation
π¦ Dependencies
rmcp: Rust implementation of the MCP protocoltokio: Asynchronous runtimetracing: Logging and diagnosticsserdeandserde_json: JSON serialization/deserializationregex: Pattern matching for documentation parsinganyhowandthiserror: Error handling
π§ͺ Testing
Manual Testing
- Start the server:
cargo run --bin doc_parser_server
- Use MCP Inspector to send requests and view responses:
npx @modelcontextprotocol/inspector cargo run --bin doc_parser_server
- Open http://localhost:6274 and use the Tools tab to test the
parse_docstool
Automated Testing
Run the test suite:
cargo test
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Model Context Protocol for the protocol specification
- Rust MCP SDK for the Rust implementation of the MCP protocol
0
Followers
0
Repositories
0
Gists
0
Total Contributions
π Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integration. β‘οΈ
echokit_server is a high-performance server software built in Rust, offering efficient data processing and API management. Designed for developers, it boasts high scalability and adaptability for various applications. It is particularly well-suited for real-time data processing and microservices architecture.