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§impl Debug for McpConfigBuilder
impl Debug for McpConfigBuilder
Source§impl Default for McpConfigBuilder
impl Default for McpConfigBuilder
impl Eq for McpConfigBuilder
Source§impl PartialEq for McpConfigBuilder
impl PartialEq for McpConfigBuilder
impl StructuralPartialEq for McpConfigBuilder
Auto Trait Implementations§
impl Forget for McpConfigBuilder
impl Freeze for McpConfigBuilderwhere
*const LeafNode<String, McpServerConfig> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, McpServerConfig)>>: Freeze,
impl Move for McpConfigBuilder
impl RefUnwindSafe for McpConfigBuilder
impl Send for McpConfigBuilderwhere
NodeRef<Owned, String, McpServerConfig, LeafOrInternal>: Send,
BoxRaw<(String, McpServerConfig)>: Send,
impl Sync for McpConfigBuilderwhere
NodeRef<Owned, String, McpServerConfig, LeafOrInternal>: Sync,
BoxRaw<(String, McpServerConfig)>: Sync,
impl Unpin for McpConfigBuilderwhere
*const LeafNode<String, McpServerConfig> is !null: Unpin,
Box<(String, McpServerConfig)>: Unpin,
impl UnsafeUnpin for McpConfigBuilderwhere
*const LeafNode<String, McpServerConfig> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, McpServerConfig)>>: UnsafeUnpin,
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