Function start_sse

Source
pub async fn start_sse() -> SdkResult<()>
Expand description

Starts the MCP server in SSE (Server-Sent Events) mode.

Hosts an HTTP endpoint on http://0.0.0.0:8000/mcp that streams MCP responses.

§Errors

Returns an SdkResult error if the HTTP server fails to bind or run.

§Example

use mcp_rust_server::start_sse;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    start_sse().await?;
    Ok(())
}