这是一个模型上下文协议(MCP)服务器,用于解析Rust项目文档并提取关于请求项的详细信息,通过标准输入输出进行通信。
rustdoc-json 和 rustdoc-md 工具git clone https://github.com/yourusername/mcp-rs.git
cd mcp-rs
cargo build
cargo run --bin doc_parser_server
可以使用MCP Inspector工具来测试服务器:
# 安装并运行MCP Inspector
RUST_LOG=debug npx @modelcontextprotocol/inspector cargo run --bin doc_parser_server
# 在另一个终端运行服务器
cargo run --bin doc_parser_server
然后在浏览器中打开Inspector http://localhost:6274,并使用以下设置连接到你的服务器:
服务器暴露了以下MCP工具:
parse_docs解析Rust项目文档并提取关于特定项的信息。
参数:
project_path:Rust项目的路径library:要解析的库的名称item:要查找的项的名称(函数、结构体、枚举等)返回:
服务器由以下组件构建:
rmcp:MCP协议的Rust实现tokio:异步运行时tracing:日志和诊断serde 和 serde_json:JSON序列化/反序列化regex:文档解析的模式匹配anyhow 和 thiserror:错误处理cargo run --bin doc_parser_server
npx @modelcontextprotocol/inspector cargo run --bin doc_parser_server
运行测试套件:
cargo test
欢迎贡献!请随意提交Pull Request。
git checkout -b feature/amazing-feature)git commit -m '添加一些惊人的功能')git push origin feature/amazing-feature)本项目采用MIT许可证——详情见LICENSE文件。