pub struct McpAppState {
pub session_store: Arc<dyn SessionStore>,
pub id_generator: Arc<dyn IdGenerator<SessionId>>,
pub stream_id_gen: Arc<FastIdGenerator>,
pub server_details: Arc<InitializeResult>,
pub handler: Arc<dyn McpServerHandler>,
pub ping_interval: Duration,
pub transport_options: Arc<TransportOptions>,
pub enable_json_response: bool,
pub allowed_hosts: Option<Vec<String>>,
pub allowed_origins: Option<Vec<String>>,
pub dns_rebinding_protection: bool,
pub event_store: Option<Arc<dyn EventStore>>,
}Expand description
Application state struct for the Hyper ser
Holds shared, thread-safe references to session storage, ID generator, server details, handler, ping interval, and transport options.
Fields§
§session_store: Arc<dyn SessionStore>§id_generator: Arc<dyn IdGenerator<SessionId>>§stream_id_gen: Arc<FastIdGenerator>§server_details: Arc<InitializeResult>§handler: Arc<dyn McpServerHandler>§ping_interval: Duration§transport_options: Arc<TransportOptions>§enable_json_response: bool§allowed_hosts: Option<Vec<String>>List of allowed host header values for DNS rebinding protection. If not specified, host validation is disabled.
allowed_origins: Option<Vec<String>>List of allowed origin header values for DNS rebinding protection. If not specified, origin validation is disabled.
dns_rebinding_protection: boolEnable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). Default is false for backwards compatibility.
event_store: Option<Arc<dyn EventStore>>Event store for resumability support If provided, resumability will be enabled, allowing clients to reconnect and resume messages
Implementations§
Source§impl McpAppState
impl McpAppState
pub fn needs_dns_protection(&self) -> bool
Trait Implementations§
Source§impl Clone for McpAppState
impl Clone for McpAppState
Source§fn clone(&self) -> McpAppState
fn clone(&self) -> McpAppState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for McpAppState
impl !RefUnwindSafe for McpAppState
impl Send for McpAppState
impl Sync for McpAppState
impl Unpin for McpAppState
impl !UnwindSafe for McpAppState
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