pub struct BackendServerConfig {
pub name: String,
pub command: String,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub cwd: Option<PathBuf>,
pub timeout: Option<Duration>,
pub transport: BackendTransport,
pub headers: HashMap<String, String>,
pub header_provider: Option<Arc<dyn Fn() -> Result<BTreeMap<String, String>, Error> + Sync + Send>>,
pub auth_mode: BackendAuthMode,
pub oauth_app_name: Option<String>,
}Expand description
Configuration for one upstream MCP server.
Fields§
§name: String§command: String§args: Vec<String>§env: HashMap<String, String>§cwd: Option<PathBuf>§timeout: Option<Duration>§transport: BackendTransport§headers: HashMap<String, String>§header_provider: Option<Arc<dyn Fn() -> Result<BTreeMap<String, String>, Error> + Sync + Send>>§auth_mode: BackendAuthMode§oauth_app_name: Option<String>Implementations§
Source§impl BackendServerConfig
impl BackendServerConfig
pub fn new( name: impl Into<String>, command: impl Into<String>, args: impl IntoIterator<Item = impl Into<String>>, ) -> BackendServerConfig
pub fn with_env( self, env: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> BackendServerConfig
pub fn with_cwd(self, cwd: impl Into<PathBuf>) -> BackendServerConfig
pub fn with_timeout(self, timeout: Duration) -> BackendServerConfig
pub fn with_headers( self, headers: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> BackendServerConfig
pub fn with_auth_mode(self, auth_mode: BackendAuthMode) -> BackendServerConfig
pub fn with_header_provider( self, provider: Arc<dyn Fn() -> Result<BTreeMap<String, String>, Error> + Sync + Send>, ) -> BackendServerConfig
pub fn with_oauth_app_name( self, app_name: impl Into<String>, ) -> BackendServerConfig
pub fn has_dynamic_headers(&self) -> bool
pub fn should_use_oauth(&self) -> bool
Trait Implementations§
Source§impl Clone for BackendServerConfig
impl Clone for BackendServerConfig
Source§fn clone(&self) -> BackendServerConfig
fn clone(&self) -> BackendServerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<FfiBackendConfig> for BackendServerConfig
impl From<FfiBackendConfig> for BackendServerConfig
Source§fn from(value: FfiBackendConfig) -> BackendServerConfig
fn from(value: FfiBackendConfig) -> BackendServerConfig
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BackendServerConfig
impl !RefUnwindSafe for BackendServerConfig
impl Send for BackendServerConfig
impl Sync for BackendServerConfig
impl Unpin for BackendServerConfig
impl UnsafeUnpin for BackendServerConfig
impl !UnwindSafe for BackendServerConfig
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