pub struct McpClientConfig {
pub transport: Option<McpTransport>,
pub url: Option<String>,
pub auth: Option<McpClientCredentials>,
pub auth_provider: Option<Arc<dyn McpAuthProvider>>,
pub headers: Option<BTreeMap<String, String>>,
pub options: McpClientOptions,
}Available on crate feature
mcp only.Expand description
Fields§
§transport: Option<McpTransport>A transport. Mutually exclusive with url.
url: Option<String>The server URL; the client builds a streamable HTTP transport on every connect.
auth: Option<McpClientCredentials>OAuth client credentials for machine-to-machine auth. Requires url.
auth_provider: Option<Arc<dyn McpAuthProvider>>Supplies bearer tokens. Requires url; mutually exclusive with auth.
headers: Option<BTreeMap<String, String>>Headers sent with every request. Requires url.
options: McpClientOptionsThe client’s behaviour.
Implementations§
Source§impl McpClientConfig
impl McpClientConfig
Sourcepub fn builder() -> McpClientConfigBuilder
pub fn builder() -> McpClientConfigBuilder
Create an instance of McpClientConfig using the builder syntax
Trait Implementations§
Source§impl Clone for McpClientConfig
impl Clone for McpClientConfig
Source§impl Debug for McpClientConfig
impl Debug for McpClientConfig
Auto Trait Implementations§
impl !RefUnwindSafe for McpClientConfig
impl !UnwindSafe for McpClientConfig
impl Forget for McpClientConfig
impl Freeze for McpClientConfigwhere
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync>>: Freeze,
*const ArcInner<Mutex<Option<BoxedTransport>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<BoxedTransport>>>>: Freeze,
&'static str: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<dyn McpAuthProvider> is !null: Freeze,
PhantomData<ArcInner<dyn McpAuthProvider>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<McpToolMatcher>: Freeze,
*const ArcInner<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync>>: Freeze,
*const ArcInner<dyn ElicitationCallback> is !null: Freeze,
PhantomData<ArcInner<dyn ElicitationCallback>>: Freeze,
*const ArcInner<dyn Fn(&McpLogMessage) + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&McpLogMessage) + Send + Sync>>: Freeze,
impl Move for McpClientConfig
impl Send for McpClientConfigwhere
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync>: Send,
Arc<Mutex<Option<BoxedTransport>>>: Send,
&'static str: Send,
RawVecInner: Send,
Arc<dyn McpAuthProvider>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
Arc<RegexI>: Send,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: Send,
Arc<str>: Send,
Arc<dyn Fn(&McpTool) -> bool + Send + Sync>: Send,
Arc<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync>: Send,
Arc<dyn ElicitationCallback>: Send,
Arc<dyn Fn(&McpLogMessage) + Send + Sync>: Send,
impl Sync for McpClientConfigwhere
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync>: Sync,
Arc<Mutex<Option<BoxedTransport>>>: Sync,
RawVecInner: Sync,
Arc<dyn McpAuthProvider>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
Arc<RegexI>: Sync,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: Sync,
Arc<str>: Sync,
Arc<dyn Fn(&McpTool) -> bool + Send + Sync>: Sync,
Arc<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync>: Sync,
Arc<dyn ElicitationCallback>: Sync,
Arc<dyn Fn(&McpLogMessage) + Send + Sync>: Sync,
impl Unpin for McpClientConfigwhere
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync>: Unpin,
Arc<Mutex<Option<BoxedTransport>>>: Unpin,
&'static str: Unpin,
*const u8 is !null: Unpin,
Arc<dyn McpAuthProvider>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
Arc<RegexI>: Unpin,
Box<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: Unpin,
Arc<str>: Unpin,
Arc<dyn Fn(&McpTool) -> bool + Send + Sync>: Unpin,
Arc<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync>: Unpin,
Arc<dyn ElicitationCallback>: Unpin,
Arc<dyn Fn(&McpLogMessage) + Send + Sync>: Unpin,
impl UnsafeUnpin for McpClientConfigwhere
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<BoxedTransport, McpError>> + Send>> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<Mutex<Option<BoxedTransport>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<BoxedTransport>>>>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn McpAuthProvider> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn McpAuthProvider>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<McpToolMatcher>: UnsafeUnpin,
*const ArcInner<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(McpProgress) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send>> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<dyn ElicitationCallback> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ElicitationCallback>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&McpLogMessage) + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&McpLogMessage) + Send + Sync>>: UnsafeUnpin,
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
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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 moreCreates a shared type from an unshared type.