1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! 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 use McpServer;
pub use ;