fix(mcp): Codex MCP declarative (config base), not blocking CLI#37
Merged
Conversation
#36's 'codex mcp add --url' blocks/fails on remote servers in non-interactive chezmoi apply (seen on the jetson: slow then 'failed'; CI missed it — unauthed codex failed fast). Codex MCP belongs in ~/.codex/config.toml [mcp_servers], already managed by modify_config.toml — so render it declaratively in codex-config-base.toml from the shared mcp: list. No CLI, no node/auth/network during apply. Claude keeps its working 'claude mcp add' (no declarative user-scope path exists). Same single source (packages.yaml mcp:).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regression (from #36)
codex mcp add --url <remote>blocks/fails in non-interactivechezmoi apply— on the jetson it ran slow then printedcodex mcp add context7 failed. CI missed it (CI's codex is unauthed → fails fast, no hang). The graceful|| echo failedmeant apply still completed, but Codex MCP never registered + the slow-fail is ugly.Fix — declarative, not CLI
Codex MCP servers live in
~/.codex/config.toml [mcp_servers], which the repo already manages viamodify_config.toml+codex-config-base.toml. So render them there from the sharedmcp:list:No CLI, no node/auth/network during apply — just config. (Schema verified against Codex config reference; remote-http MCP is stable, not experimental.)
Claude keeps
claude mcp add -s user --transport http(works; no declarative user-scope config file exists for it).Still one source
packages.yaml mcp:drives both — Claude reads it in the 70 script (CLI), Codex's config base renders it (declarative). Removed the hangingcodex mcp addloop from 70.Verified
claude mcp add×1,codex mcp add×0;sh -nOK.chezmoi cat ~/.codex/config.toml(full modify_ pipeline) → valid TOML with[mcp_servers.context7] url=…(merge preserves it — proven earlier).