Expand description
Multi-Server Session Manager for MCP Clients
This module provides a SessionManager for coordinating multiple MCP server sessions.
Unlike traditional HTTP connection pooling, MCP uses long-lived, stateful sessions
where each connection maintains negotiated capabilities and subscription state.
§Key Concepts
- Session: A long-lived, initialized MCP connection to a server
- Multi-Server: Manage connections to different MCP servers (GitHub, filesystem, etc.)
- Health Monitoring: Automatic ping-based health checks per session
- Lifecycle Management: Proper initialize → operate → shutdown for each session
§Features
- Multiple server sessions with independent state
- Automatic health checking with configurable intervals
- Per-session state tracking (healthy, degraded, unhealthy)
- Session lifecycle management
- Metrics and monitoring per session
§When to Use
Use SessionManager when your application needs to coordinate multiple different
MCP servers (e.g., IDE with GitHub server + filesystem server + database server).
For single server scenarios:
Client<T>is cheaply cloneable via Arc - share one session across multiple async tasksTurboTransport- Add retry/circuit breaker to one session
Structs§
- Connection
Info - Information about a managed connection
- Manager
Config - Configuration for the connection manager
- Server
Group - Server group configuration for failover support
- Session
Manager - Multi-Server Session Manager for MCP Clients
Enums§
- Connection
State - Connection state for a managed client