pub struct McpStdioServer { /* private fields */ }Available on crate feature
stdio-server only.Expand description
MCP Server with stdio transport.
This server reads JSON-RPC messages from stdin and writes responses
to stdout. It wraps the core McpServer and bridges stdio I/O to
the internal channel-based communication.
Implementations§
Source§impl McpStdioServer
impl McpStdioServer
Sourcepub async fn run(config: McpServerConfig) -> Result<(), ServerError>
pub async fn run(config: McpServerConfig) -> Result<(), ServerError>
Runs an MCP server with stdio transport.
This is the main entry point for running a stdio-based MCP server. The function blocks until the server stops (stdin closed or error).
§Example
ⓘ
let config = McpServerConfig::builder()
.name("my-server")
.version("1.0.0")
.with_tool(MyTool)
.build();
McpStdioServer::run(config).await?;Auto Trait Implementations§
impl Freeze for McpStdioServer
impl !RefUnwindSafe for McpStdioServer
impl Send for McpStdioServer
impl Sync for McpStdioServer
impl Unpin for McpStdioServer
impl !UnwindSafe for McpStdioServer
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