Skip to main content

BackendConfig

Struct BackendConfig 

Source
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: String

Unique backend name, used as the namespace prefix for its tools/resources.

§transport: TransportType

Transport 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: u32

Percentage 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: bool

Forward 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: bool

Hide tools annotated as destructive (destructive_hint = true).

§read_only_only: bool

Only 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: u32

Failover 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: u32

Routing weight for canary deployments (default: 100). Higher values receive proportionally more traffic.

Implementations§

Source§

impl BackendConfig

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BackendConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for BackendConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,