pub struct SimpleMCPServer { /* private fields */ }Implementations§
Source§impl SimpleMCPServer
impl SimpleMCPServer
Sourcepub fn with_version(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn with_version(name: impl Into<String>, version: impl Into<String>) -> Self
Create a new simple MCP server with an explicit version.
Sourcepub fn register_tool<F>(&mut self, tool: MCPTool, handler: F)
pub fn register_tool<F>(&mut self, tool: MCPTool, handler: F)
Register a tool with the server.
Sourcepub fn register_sdk_tool(&mut self, tool: SdkMcpTool)
pub fn register_sdk_tool(&mut self, tool: SdkMcpTool)
Register a pre-built SDK MCP tool with the server.
Sourcepub fn list_tools(&self) -> Vec<&MCPTool>
pub fn list_tools(&self) -> Vec<&MCPTool>
Get all registered tools.
Trait Implementations§
Source§impl Clone for SimpleMCPServer
impl Clone for SimpleMCPServer
Source§fn clone(&self) -> SimpleMCPServer
fn clone(&self) -> SimpleMCPServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SimpleMCPServer
impl !UnwindSafe for SimpleMCPServer
impl Freeze for SimpleMCPServer
impl Send for SimpleMCPServer
impl Sync for SimpleMCPServer
impl Unpin for SimpleMCPServer
impl UnsafeUnpin for SimpleMCPServer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more