pub struct BackendConfig {Show 34 fields
pub name: String,
pub transport: TransportType,
pub command: Option<String>,
pub args: Vec<String>,
pub url: Option<String>,
pub env: HashMap<String, String>,
pub timeout: Option<TimeoutConfig>,
pub circuit_breaker: Option<CircuitBreakerConfig>,
pub rate_limit: Option<RateLimitConfig>,
pub concurrency: Option<ConcurrencyConfig>,
pub retry: Option<RetryConfig>,
pub outlier_detection: Option<OutlierDetectionConfig>,
pub hedging: Option<HedgingConfig>,
pub mirror_of: Option<String>,
pub mirror_percent: u32,
pub cache: Option<BackendCacheConfig>,
pub bearer_token: Option<String>,
pub forward_auth: bool,
pub aliases: Vec<AliasConfig>,
pub default_args: Map<String, Value>,
pub inject_args: Vec<InjectArgsConfig>,
pub param_overrides: Vec<ParamOverrideConfig>,
pub expose_tools: Vec<String>,
pub hide_tools: Vec<String>,
pub expose_resources: Vec<String>,
pub hide_resources: Vec<String>,
pub expose_prompts: Vec<String>,
pub hide_prompts: Vec<String>,
pub hide_destructive: bool,
pub read_only_only: bool,
pub failover_for: Option<String>,
pub priority: u32,
pub canary_of: Option<String>,
pub weight: u32,
}Expand description
Configuration for a single backend MCP server.
Fields§
§name: StringUnique backend name, used as the namespace prefix for its tools/resources.
transport: TransportTypeTransport protocol to use when connecting to this backend.
command: Option<String>Command for stdio backends
args: Vec<String>Arguments for stdio backends
url: Option<String>URL for HTTP backends
env: HashMap<String, String>Environment variables for subprocess backends
timeout: Option<TimeoutConfig>Per-backend timeout
circuit_breaker: Option<CircuitBreakerConfig>Per-backend circuit breaker
rate_limit: Option<RateLimitConfig>Per-backend rate limit
concurrency: Option<ConcurrencyConfig>Per-backend concurrency limit
retry: Option<RetryConfig>Per-backend retry policy
outlier_detection: Option<OutlierDetectionConfig>Per-backend outlier detection (passive health checks)
hedging: Option<HedgingConfig>Per-backend request hedging (parallel redundant requests)
mirror_of: Option<String>Mirror traffic from another backend (fire-and-forget). Set to the name of the source backend to mirror.
mirror_percent: u32Percentage of requests to mirror (1-100, default: 100).
cache: Option<BackendCacheConfig>Per-backend cache policy
bearer_token: Option<String>Static bearer token for authenticating to this backend (HTTP only).
Supports ${ENV_VAR} syntax for env var resolution.
forward_auth: boolForward the client’s inbound auth token to this backend. Only works with HTTP backends when the proxy has auth enabled.
aliases: Vec<AliasConfig>Tool aliases: rename tools exposed by this backend
default_args: Map<String, Value>Default arguments injected into all tool calls for this backend. Merged into tool call arguments (does not overwrite existing keys).
inject_args: Vec<InjectArgsConfig>Per-tool argument injection rules.
param_overrides: Vec<ParamOverrideConfig>Per-tool parameter overrides: hide, rename, and inject defaults.
expose_tools: Vec<String>Capability filtering: only expose these tools (allowlist)
hide_tools: Vec<String>Capability filtering: hide these tools (denylist)
expose_resources: Vec<String>Capability filtering: only expose these resources (allowlist, by URI)
hide_resources: Vec<String>Capability filtering: hide these resources (denylist, by URI)
expose_prompts: Vec<String>Capability filtering: only expose these prompts (allowlist)
hide_prompts: Vec<String>Capability filtering: hide these prompts (denylist)
hide_destructive: boolHide tools annotated as destructive (destructive_hint = true).
read_only_only: boolOnly expose tools annotated as read-only (read_only_hint = true).
failover_for: Option<String>Failover: name of the primary backend this is a failover for. When set, this backend’s tools are hidden and requests are only routed here when the primary returns an error.
priority: u32Failover priority for ordering multiple failover backends.
Lower values are preferred (tried first). Default is 0.
When multiple backends declare failover_for the same primary,
they are tried in ascending priority order until one succeeds.
canary_of: Option<String>Canary routing: name of the primary backend this is a canary for. When set, this backend’s tools are hidden and requests targeting the primary are probabilistically routed here based on weight.
weight: u32Routing weight for canary deployments (default: 100). Higher values receive proportionally more traffic.
Implementations§
Source§impl BackendConfig
impl BackendConfig
Sourcepub fn build_filter(&self, separator: &str) -> Result<Option<BackendFilter>>
pub fn build_filter(&self, separator: &str) -> Result<Option<BackendFilter>>
Build a BackendFilter from this backend’s expose/hide lists.
Returns None if no filtering is configured.
Canary and failover backends automatically hide all capabilities so
their tools don’t appear in ListTools responses (traffic reaches
them via routing middleware, not direct tool calls).
Trait Implementations§
Source§impl Debug for BackendConfig
impl Debug for BackendConfig
Source§impl<'de> Deserialize<'de> for BackendConfig
impl<'de> Deserialize<'de> for BackendConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BackendConfig
impl RefUnwindSafe for BackendConfig
impl Send for BackendConfig
impl Sync for BackendConfig
impl Unpin for BackendConfig
impl UnsafeUnpin for BackendConfig
impl UnwindSafe for BackendConfig
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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>
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