pub struct RemoteMcpServerConfig {
pub public_url: Url,
pub authorization_server: Url,
pub citation_url_prefix: Option<Url>,
pub allowed_origins: Vec<String>,
pub max_results: usize,
pub max_scan_files: usize,
pub max_scan_bytes: usize,
pub max_request_body_bytes: usize,
pub session_ttl: Duration,
/* private fields */
}Expand description
Runtime configuration for the remote MCP transport.
The proxy bearer token is intentionally private and is omitted from the
Debug implementation. It must never be copied into a URL or persisted.
Fields§
§public_url: UrlCanonical external HTTPS URL, normally the legacy /sse/ endpoint.
External authorization server URL advertised in protected-resource metadata.
citation_url_prefix: Option<Url>Optional URL prefix for escaped file citations.
allowed_origins: Vec<String>Separate allowlist for supplied MCP Origin headers.
max_results: usizeMaximum number of search results.
max_scan_files: usizeMaximum files inspected by search.
max_scan_bytes: usizeMaximum UTF-8 content bytes inspected by search.
max_request_body_bytes: usizeMaximum legacy MCP request body size.
session_ttl: DurationLegacy SSE session inactivity lifetime.
Implementations§
Source§impl RemoteMcpServerConfig
impl RemoteMcpServerConfig
Sourcepub fn new(
public_url: impl AsRef<str>,
authorization_server: impl AsRef<str>,
proxy_bearer_token: impl Into<String>,
) -> WebmcpResult<Self>
pub fn new( public_url: impl AsRef<str>, authorization_server: impl AsRef<str>, proxy_bearer_token: impl Into<String>, ) -> WebmcpResult<Self>
Create a validated remote MCP configuration with the default bounds.
Sourcepub fn validate(&self) -> WebmcpResult<()>
pub fn validate(&self) -> WebmcpResult<()>
Validate URL, authentication, and resource bounds.
Sourcepub fn with_citation_url_prefix(self, prefix: Option<Url>) -> WebmcpResult<Self>
pub fn with_citation_url_prefix(self, prefix: Option<Url>) -> WebmcpResult<Self>
Set the citation prefix after parsing it as a URL.
Sourcepub fn with_allowed_origins(self, origins: Vec<String>) -> WebmcpResult<Self>
pub fn with_allowed_origins(self, origins: Vec<String>) -> WebmcpResult<Self>
Set the separate MCP Origin allowlist.
Sourcepub fn with_limits(
self,
max_results: usize,
max_scan_files: usize,
max_scan_bytes: usize,
max_request_body_bytes: usize,
session_ttl: Duration,
) -> WebmcpResult<Self>
pub fn with_limits( self, max_results: usize, max_scan_files: usize, max_scan_bytes: usize, max_request_body_bytes: usize, session_ttl: Duration, ) -> WebmcpResult<Self>
Set the search and legacy transport bounds.
Trait Implementations§
Source§impl Clone for RemoteMcpServerConfig
impl Clone for RemoteMcpServerConfig
Source§fn clone(&self) -> RemoteMcpServerConfig
fn clone(&self) -> RemoteMcpServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more