pub struct CodexMcp {
pub config_path: PathBuf,
}Expand description
Codex CLI MCP 配置读写(~/.codex/config.toml)
官方格式(developers.openai.com/codex/mcp):[mcp_servers.<name>] 表,
stdio 用 command(必填)+ args。项目级 .codex/config.toml 只在
项目被信任时加载,install 场景写全局文件(一次注册所有仓库可用)。
用文本级表编辑而非 toml::Value 往返:Codex 配置可能含用户手写的 注释与其他表(provider/auth 等),toml::Value 序列化会重排整文件丢注释; 本 writer 只替换/追加本 server 的虚线表块,其余内容原样保留。
Fields§
§config_path: PathBuf用户级 Codex 配置路径
Implementations§
Auto Trait Implementations§
impl Freeze for CodexMcp
impl RefUnwindSafe for CodexMcp
impl Send for CodexMcp
impl Sync for CodexMcp
impl Unpin for CodexMcp
impl UnsafeUnpin for CodexMcp
impl UnwindSafe for CodexMcp
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> 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