pub struct McpServer { /* private fields */ }Expand description
MCP Server runtime.
Use McpServer::run(config) to start a server with the given configuration.
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub async fn run(config: McpServerConfig) -> Result<(), ServerError>
pub async fn run(config: McpServerConfig) -> Result<(), ServerError>
Sourcepub fn server_info(&self) -> McpServerInfo
pub fn server_info(&self) -> McpServerInfo
Returns server info for MCP protocol.
Sourcepub async fn handle_request(&self, request_str: &str) -> JsonRpcResponse
pub async fn handle_request(&self, request_str: &str) -> JsonRpcResponse
Handles a JSON-RPC request.
Sourcepub async fn handle_rpc_request(
&self,
request: JsonRpcRequest,
) -> JsonRpcResponse
pub async fn handle_rpc_request( &self, request: JsonRpcRequest, ) -> JsonRpcResponse
Handles a parsed JSON-RPC request.
Sourcepub async fn call_tool(&self, name: &str, args: Value) -> ToolCallResult
pub async fn call_tool(&self, name: &str, args: Value) -> ToolCallResult
Calls a tool directly by name.
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