pub struct McpConfigBuilder { /* private fields */ }Expand description
A set of MCP servers for one run.
Implementations§
Source§impl McpConfigBuilder
impl McpConfigBuilder
Sourcepub fn server(self, name: impl Into<String>, config: McpServerConfig) -> Self
pub fn server(self, name: impl Into<String>, config: McpServerConfig) -> Self
Add a server.
Sourcepub fn stdio_server(
self,
name: impl Into<String>,
command: impl Into<String>,
) -> Self
pub fn stdio_server( self, name: impl Into<String>, command: impl Into<String>, ) -> Self
Add a subprocess server. Shorthand for McpServerConfig::stdio.
Sourcepub fn http_server(
self,
name: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn http_server( self, name: impl Into<String>, url: impl Into<String>, ) -> Self
Add an HTTP server. Shorthand for McpServerConfig::http.
Sourcepub fn config_overrides(&self) -> Vec<String>
pub fn config_overrides(&self) -> Vec<String>
key=value strings for
ExecCommand::config, or for the client
builder’s config when the whole client should carry them.
Ordered, so the same set produces the same arguments.
Sourcepub fn to_toml(&self) -> String
pub fn to_toml(&self) -> String
The same configuration as a TOML document.
Suitable for a $CODEX_HOME/<name>.config.toml profile, which
--profile layers over the base config.
Sourcepub fn write_profile(
&self,
codex_home: impl AsRef<Path>,
profile: &str,
) -> Result<PathBuf>
pub fn write_profile( &self, codex_home: impl AsRef<Path>, profile: &str, ) -> Result<PathBuf>
Write to_toml to $CODEX_HOME/<profile>.config.toml
and return the path.
Reachable afterwards as --profile <profile>. This writes into the
user’s codex home, so it is persistent: prefer
config_overrides for a single run.
Trait Implementations§
Source§impl Clone for McpConfigBuilder
impl Clone for McpConfigBuilder
Source§fn clone(&self) -> McpConfigBuilder
fn clone(&self) -> McpConfigBuilder
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 Debug for McpConfigBuilder
impl Debug for McpConfigBuilder
Source§impl Default for McpConfigBuilder
impl Default for McpConfigBuilder
Source§fn default() -> McpConfigBuilder
fn default() -> McpConfigBuilder
Returns the “default value” for a type. Read more
impl Eq for McpConfigBuilder
Source§impl PartialEq for McpConfigBuilder
impl PartialEq for McpConfigBuilder
impl StructuralPartialEq for McpConfigBuilder
Auto Trait Implementations§
impl Freeze for McpConfigBuilder
impl RefUnwindSafe for McpConfigBuilder
impl Send for McpConfigBuilder
impl Sync for McpConfigBuilder
impl Unpin for McpConfigBuilder
impl UnsafeUnpin for McpConfigBuilder
impl UnwindSafe for McpConfigBuilder
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