pub struct ActixServerOptions {Show 23 fields
pub host: String,
pub port: u16,
pub session_id_generator: Option<Arc<dyn IdGenerator<SessionId>>>,
pub custom_streamable_http_endpoint: Option<String>,
pub transport_options: Arc<TransportOptions>,
pub event_store: Option<Arc<dyn EventStore>>,
pub task_store: Option<Arc<ServerTaskStore>>,
pub client_task_store: Option<Arc<ClientTaskStore>>,
pub enable_json_response: Option<bool>,
pub ping_interval: Duration,
pub sse_support: bool,
pub custom_sse_endpoint: Option<String>,
pub custom_messages_endpoint: Option<String>,
pub auth: Option<Arc<dyn AuthProvider>>,
pub health_endpoint: Option<String>,
pub health_handler: Option<Arc<dyn HealthHandler>>,
pub message_observer: Option<Arc<dyn McpObserver<ClientMessage, ServerMessage>>>,
pub max_request_body_size: Option<usize>,
pub dns_rebinding: DnsRebindingOptions,
pub session_store: Option<Arc<dyn SessionStore>>,
pub enable_ssl: bool,
pub ssl_cert_path: Option<String>,
pub ssl_key_path: Option<String>,
}Expand description
Configuration for the Actix MCP server.
Used to configure the turnkey server created via
create_actix_server().
Fields§
§host: StringHostname or IP address the server will bind to (default: "127.0.0.1")
port: u16TCP port (default: 8080)
session_id_generator: Option<Arc<dyn IdGenerator<SessionId>>>Optional session ID generator
custom_streamable_http_endpoint: Option<String>Custom Streamable HTTP endpoint path (default: /mcp)
transport_options: Arc<TransportOptions>Shared transport configuration
event_store: Option<Arc<dyn EventStore>>Event store for resumability support
task_store: Option<Arc<ServerTaskStore>>Task store for server-side tasks
client_task_store: Option<Arc<ClientTaskStore>>Task store for client-side tasks
enable_json_response: Option<bool>If true, return JSON instead of SSE stream
ping_interval: DurationInterval between keep-alive pings
sse_support: boolEnable SSE transport support (default: true)
custom_sse_endpoint: Option<String>Custom SSE endpoint path (default: /sse)
custom_messages_endpoint: Option<String>Custom SSE messages endpoint path (default: /messages)
auth: Option<Arc<dyn AuthProvider>>Optional authentication provider
health_endpoint: Option<String>Health check endpoint path (None disables)
health_handler: Option<Arc<dyn HealthHandler>>Custom health check handler
message_observer: Option<Arc<dyn McpObserver<ClientMessage, ServerMessage>>>Optional message observer for telemetry
max_request_body_size: Option<usize>Maximum request body size in bytes. Defaults to 4 MiB when None.
dns_rebinding: DnsRebindingOptionsDNS rebinding protection configuration (enabled by default).
When dns_rebinding_protection is true and no allowed_hosts or
allowed_origins are configured, allowed_hosts is auto-derived from
host:port unless the bind address is a wildcard.
session_store: Option<Arc<dyn SessionStore>>Optional session store implementation. Defaults to a bounded
InMemorySessionStore (10k max sessions, no idle TTL) when None.
Pass your own SessionStore implementation to use Redis, custom
limits, or any other session backend.
enable_ssl: boolEnable TLS/SSL (requires ssl feature, default: false)
ssl_cert_path: Option<String>Path to TLS certificate PEM file
ssl_key_path: Option<String>Path to TLS private key PEM file
Implementations§
Source§impl ActixServerOptions
impl ActixServerOptions
Sourcepub fn resolve_server_address(&self) -> Result<SocketAddr, String>
pub fn resolve_server_address(&self) -> Result<SocketAddr, String>
Resolves the SocketAddr from host and port.
pub fn base_url(&self) -> String
pub fn streamable_http_url(&self) -> String
pub fn sse_url(&self) -> String
pub fn sse_message_url(&self) -> String
pub fn sse_endpoint(&self) -> &str
pub fn sse_messages_endpoint(&self) -> &str
pub fn streamable_http_endpoint(&self) -> &str
Sourcepub fn max_request_body_size(&self) -> usize
pub fn max_request_body_size(&self) -> usize
Maximum incoming HTTP request body size in bytes, falling back to the default (4 MiB) when not configured.
Sourcepub fn resolve_mount_options(&self) -> McpMountOptions
pub fn resolve_mount_options(&self) -> McpMountOptions
Resolves mount options from this server configuration.