egui_mcp 0.3.0

MCP server that drives live egui apps over the egui_inspection protocol
Documentation
//! MCP server entry point, built on the official `rmcp` SDK over stdio.
//!
//! [`run`] constructs a [`crate::tools::Server`] (which derives its tool router via
//! `#[tool_router]`) and serves it on `(stdin, stdout)`. Returns once the client closes
//! the connection (EOF on stdin) or the runtime is shut down.

use rmcp::{ServiceExt as _, transport};

use crate::tools::Server;

/// Serve the MCP tool set on stdio until the client disconnects.
///
/// # Errors
/// If the stdio transport fails to start or the connection ends in error.
pub async fn run() -> Result<(), Box<dyn std::error::Error>> {
    let server = Server::new();
    let running = server.serve(transport::stdio()).await?;
    let _reason = running.waiting().await?;
    Ok(())
}