pub struct HttpServerConfig {
pub mcp_path: String,
pub health_path: String,
pub max_connections: usize,
pub handler_config: HttpHandlerConfig,
}Expand description
Configuration for the turnkey HTTP server started by Server::run_http.
All fields have sensible defaults. Use the builder methods to customise.
§Example
ⓘ
use fastmcp_server::HttpServerConfig;
let config = HttpServerConfig::new()
.mcp_path("/api/mcp")
.health_path("/healthz")
.max_connections(128);Fields§
§mcp_path: StringPath where MCP JSON-RPC requests are accepted (default: "/mcp").
health_path: StringPath for the health-check endpoint (default: "/health").
max_connections: usizeMaximum number of concurrent connections (default: 64).
handler_config: HttpHandlerConfigInner HTTP handler configuration (CORS, body size, timeouts).
Implementations§
Source§impl HttpServerConfig
impl HttpServerConfig
Sourcepub fn health_path(self, path: impl Into<String>) -> Self
pub fn health_path(self, path: impl Into<String>) -> Self
Sets the health-check endpoint path.
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Sets the maximum number of concurrent connections.
Sourcepub fn handler_config(self, config: HttpHandlerConfig) -> Self
pub fn handler_config(self, config: HttpHandlerConfig) -> Self
Sets the inner HTTP handler configuration.
Trait Implementations§
Source§impl Clone for HttpServerConfig
impl Clone for HttpServerConfig
Source§fn clone(&self) -> HttpServerConfig
fn clone(&self) -> HttpServerConfig
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 moreSource§impl Debug for HttpServerConfig
impl Debug for HttpServerConfig
Auto Trait Implementations§
impl Freeze for HttpServerConfig
impl RefUnwindSafe for HttpServerConfig
impl Send for HttpServerConfig
impl Sync for HttpServerConfig
impl Unpin for HttpServerConfig
impl UnsafeUnpin for HttpServerConfig
impl UnwindSafe for HttpServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).