pub struct McpServer { /* private fields */ }Expand description
An MCP server for AgentBuilder::mcp_server. Every value (arguments,
environment, URL, headers) is used exactly as given: a ${VAR} in one is
never expanded from the process’s environment or the keyring, as it would be
in a config file, so pass resolved values.
Implementations§
Source§impl McpServer
impl McpServer
Sourcepub fn stdio<S: Into<String>>(
command: impl Into<String>,
args: impl IntoIterator<Item = S>,
) -> Self
pub fn stdio<S: Into<String>>( command: impl Into<String>, args: impl IntoIterator<Item = S>, ) -> Self
A server agent86 starts as command with args, speaking MCP on its
standard streams. It gets agent86’s scrubbed environment plus
McpServer::env, never the whole of this process’s.
Sourcepub fn env(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, name: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable for a stdio server.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Send a header with every request to a remote server.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
How long the server has to start and list its tools (30 seconds by default).
Sourcepub fn call_timeout(self, timeout: Duration) -> Self
pub fn call_timeout(self, timeout: Duration) -> Self
How long one tool call may take (120 seconds by default).
Sourcepub fn max_result_chars(self, chars: usize) -> Self
pub fn max_result_chars(self, chars: usize) -> Self
The most characters of a result the model is shown (8000 by default).
Trait Implementations§
Auto Trait Implementations§
impl Forget for McpServer
impl Freeze for McpServer
impl Move for McpServer
impl RefUnwindSafe for McpServer
impl Send for McpServer
impl Sync for McpServer
impl Unpin for McpServer
impl UnsafeUnpin for McpServer
impl UnwindSafe for McpServer
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more