pub struct McpServerConfig { /* private fields */ }Expand description
One MCP server’s configuration.
Mirrors what McpAddCommand can register, so the
two describe the same thing whether it is persisted or scoped to a run.
Implementations§
Source§impl McpServerConfig
impl McpServerConfig
Sourcepub fn arg(self, value: impl Into<String>) -> Self
pub fn arg(self, value: impl Into<String>) -> Self
Append a launch argument. Ignored for an HTTP server.
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable for the subprocess.
Sourcepub fn bearer_token_env_var(self, env_var: impl Into<String>) -> Self
pub fn bearer_token_env_var(self, env_var: impl Into<String>) -> Self
Name the environment variable holding the bearer token.
The token itself is never part of the configuration: only the name of
the variable to read it from, matching mcp add --bearer-token-env-var.
Ignored for a stdio server.
Sourcepub fn env_http_header(
self,
header: impl Into<String>,
env_var: impl Into<String>,
) -> Self
pub fn env_http_header( self, header: impl Into<String>, env_var: impl Into<String>, ) -> Self
Source an HTTP request header from an environment variable.
Both arguments are names: header is sent on each request and
env_var is read by Codex for its value. The secret itself therefore
stays out of argv and persistent configuration. Ignored for a stdio
server.
Trait Implementations§
Source§impl Clone for McpServerConfig
impl Clone for McpServerConfig
Source§fn clone(&self) -> McpServerConfig
fn clone(&self) -> McpServerConfig
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 McpServerConfig
impl Debug for McpServerConfig
impl Eq for McpServerConfig
Source§impl PartialEq for McpServerConfig
impl PartialEq for McpServerConfig
impl StructuralPartialEq for McpServerConfig
Auto Trait Implementations§
impl Freeze for McpServerConfig
impl RefUnwindSafe for McpServerConfig
impl Send for McpServerConfig
impl Sync for McpServerConfig
impl Unpin for McpServerConfig
impl UnsafeUnpin for McpServerConfig
impl UnwindSafe for McpServerConfig
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