pub struct McpConfig {
pub enabled: bool,
pub path: String,
pub flightsql_url: Option<String>,
pub default_rows: usize,
pub max_rows: usize,
pub max_bytes: usize,
pub skills_dir: Option<PathBuf>,
pub allowed_hosts: Vec<String>,
pub allowed_origins: Vec<String>,
pub max_request_body_bytes: usize,
}Expand description
Settings of the MCP route, read once at startup.
Fields§
§enabled: bool§path: StringFull path of the route, including any base path (e.g. /micromegas/mcp).
flightsql_url: Option<String>Fixed FlightSQL target; when unset the host decides (e.g. the default data source).
default_rows: usizeRow count used when a call gives no limit.
max_rows: usizeLargest limit a call may ask for.
max_bytes: usizeByte cap on a rendered result.
skills_dir: Option<PathBuf>§allowed_hosts: Vec<String>§allowed_origins: Vec<String>Empty means no Origin validation, as the Streamable HTTP spec requires of non-browser servers.
max_request_body_bytes: usizeImplementations§
Source§impl McpConfig
impl McpConfig
Sourcepub fn from_lookup(
base_path: &str,
lookup: impl Fn(&str) -> Option<String>,
) -> Self
pub fn from_lookup( base_path: &str, lookup: impl Fn(&str) -> Option<String>, ) -> Self
Same as Self::from_env with an injectable variable source.
Sourcepub fn clamp(self) -> Self
pub fn clamp(self) -> Self
Applies the compiled-in ceilings and keeps the defaults inside them.
Sourcepub fn effective_limit(&self, requested: Option<usize>) -> usize
pub fn effective_limit(&self, requested: Option<usize>) -> usize
Resolves a caller-supplied limit to the number of rows to return.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpConfig
impl RefUnwindSafe for McpConfig
impl Send for McpConfig
impl Sync for McpConfig
impl Unpin for McpConfig
impl UnsafeUnpin for McpConfig
impl UnwindSafe for McpConfig
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].