pub struct McpServer { /* private fields */ }Expand description
An MCP Server that wraps an AgentRuntime and exposes it as an MCP tool.
External orchestrators call tools/list to discover the run tool,
then tools/call with a prompt argument to execute tasks.
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub fn new(runtime: AgentRuntime, config: McpServeConfig) -> McpServer
pub fn new(runtime: AgentRuntime, config: McpServeConfig) -> McpServer
Create a new MCP server wrapping the given runtime.
Sourcepub async fn serve(&self) -> Result<(), AgentError>
pub async fn serve(&self) -> Result<(), AgentError>
Start serving requests. This blocks until the transport closes.
Auto Trait Implementations§
impl !RefUnwindSafe for McpServer
impl !UnwindSafe for McpServer
impl Freeze for McpServer
impl Send for McpServer
impl Sync for McpServer
impl Unpin for McpServer
impl UnsafeUnpin 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