pub struct McpServer { /* private fields */ }Expand description
The core MCP server — holds configuration and the routing table.
Create one with McpServer::builder() then call .serve_stdio() or
another transport extension method to start accepting connections.
Implementations§
Source§impl McpServer
impl McpServer
pub fn builder() -> McpServerBuilder
Sourcepub async fn handle_message(
&self,
msg: JsonRpcMessage,
session: &mut Session,
) -> Option<JsonRpcMessage>
pub async fn handle_message( &self, msg: JsonRpcMessage, session: &mut Session, ) -> Option<JsonRpcMessage>
Handle a single incoming JSON-RPC message, returning the response (if any).
pub fn info(&self) -> &ServerInfo
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpServer
impl !RefUnwindSafe for McpServer
impl Send for McpServer
impl Sync for McpServer
impl Unpin for McpServer
impl UnsafeUnpin for McpServer
impl !UnwindSafe for McpServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more