Skip to main content
Version: 1.1.0 (latest)

Server Sessions

When running with Streamable HTTP (Axum or Actix backends), each connected client gets a session.

Auth Infoโ€‹

// Get session auth data
let auth_info = runtime.auth_info().await;
if let Some(auth) = &*auth_info {
println!("Client authenticated as: {:?}", auth.user_id);
}

Session Identityโ€‹

The SDK manages sessions automatically. Each HTTP connection carries a session ID that maps to a specific client's initialization state and auth context.

For Stdio transport, there is a single session since only one client connects via stdin/stdout.