research-master 0.1.40

MCP server for searching and downloading academic papers from multiple research sources
Documentation
//! MCP (Model Context Protocol) implementation.
//!
//! This module provides the MCP server implementation using the [pmcp] crate
//! for proper JSON-RPC handling over stdio and HTTP/SSE.
//!
//! # Components
//!
//! - [`McpServer`]: Main MCP server that can run in stdio or HTTP/SSE mode
//! - [`ToolRegistry`]: Registry of available MCP tools
//! - [`Tool`]: Tool descriptor with name, description, and handler
//!
//! # Server Modes
//!
//! ## stdio Mode
//!
//! For integration with Claude Desktop and other MCP clients that communicate
//! over standard input/output:
//!
//! ```rust,no_run
//! use research_master::{mcp::McpServer, sources::SourceRegistry};
//! use std::sync::Arc;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let sources = Arc::new(SourceRegistry::new());
//! let server = McpServer::new(sources)?;
//! server.run().await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## HTTP/SSE Mode
//!
//! For web-based clients using Server-Sent Events:
//!
//! ```rust,no_run
//! use research_master::{mcp::McpServer, sources::SourceRegistry};
//! use std::sync::Arc;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let sources = Arc::new(SourceRegistry::new());
//! let server = McpServer::new(sources)?;
//! let (addr, handle) = server.run_http("127.0.0.1:3000").await?;
//! # Ok(())
//! # }
//! ```
//!
//! [pmcp]: https://docs.rs/pmcp

pub mod server;
mod tools;
mod unified_tools;

pub use server::McpServer;
pub use tools::{Tool, ToolRegistry};