pub struct McpServer { /* private fields */ }Expand description
MCP Server - Expose tools and capabilities via MCP protocol
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub fn with_capabilities(self, capabilities: ServerCapabilities) -> Self
pub fn with_capabilities(self, capabilities: ServerCapabilities) -> Self
Configure server capabilities
Sourcepub fn with_auth_handler<H: AuthHandler + 'static>(self, handler: H) -> Self
pub fn with_auth_handler<H: AuthHandler + 'static>(self, handler: H) -> Self
Configure authentication handler
Sourcepub fn with_tool_provider<P: ToolProvider + 'static>(self, provider: P) -> Self
pub fn with_tool_provider<P: ToolProvider + 'static>(self, provider: P) -> Self
Configure tool provider
Sourcepub fn with_server_info(self, server_info: ServerInfo) -> Self
pub fn with_server_info(self, server_info: ServerInfo) -> Self
Configure server info
Sourcepub fn handle_request(
&self,
request: &UniversalRequest,
) -> Result<UniversalResponse, ProtocolError>
pub fn handle_request( &self, request: &UniversalRequest, ) -> Result<UniversalResponse, ProtocolError>
Handle incoming MCP request
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