pub struct MCPServer { /* private fields */ }
Implementations§
Source§impl MCPServer
impl MCPServer
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn with_tools_from_inventory(self) -> Self
pub fn add_tool(&mut self, tool: impl Tool + Send + Sync + 'static)
pub fn get_tool(&self, name: &str) -> Option<&BoxedTool>
pub fn list_tools(&self) -> impl Iterator<Item = &BoxedTool>
Sourcepub fn list_resources(&self) -> impl Iterator<Item = Resource>
pub fn list_resources(&self) -> impl Iterator<Item = Resource>
List the resources available on this server.
Sourcepub fn list_prompts(&self) -> impl Iterator<Item = Prompt>
pub fn list_prompts(&self) -> impl Iterator<Item = Prompt>
List the prompts available on this server.
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_instructions(self, instructions: impl Into<String>) -> Self
Set the instructions for the server which will be sent to the client on initialize.
Auto Trait Implementations§
impl Freeze for MCPServer
impl !RefUnwindSafe for MCPServer
impl Send for MCPServer
impl Sync for MCPServer
impl Unpin 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