Expose MCP management APIs in the TypeScript SDK (codex.mcp.*)
Resolved 💬 2 comments Opened Oct 24, 2025 by SockingPanda Closed Jan 14, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
Background
The CLI already ships codex mcp ... subcommands to list, add/remove, and log into MCP servers. The TypeScript SDK, however, only consumes streamed events and lacks management capabilities. We’d like to reuse the same API surface in Node/plugin environments by exposing MCP controls from the SDK.
Proposal
- Introduce
codex.mcp.*APIs (list / get / add / remove / login / logout / enable / disable / enableOnce / disableOnce) that reuse the existing CLI binary under the hood. - Extract shared helpers for resolving the CLI binary and applying
--configoverrides so bothCodexExecand MCP helpers share the same code path. - For behaviour not covered by CLI subcommands (e.g. permanently toggling
enabled/enabled_tools), mirror the CLI’s TOML write logic inside the SDK to keep semantics aligned. - Add documentation and sample code showing typical usage, plus unit tests covering MCP management.
Additional information
Status
A working prototype already lives on my fork: codex.mcp APIs, a sample (samples/mcp_management.ts), and a dedicated test (pnpm test -- mcp.test.ts). Before raising a PR, I’d like to confirm the change fits your roadmap and whether any additional design or compatibility considerations are needed.
2 Comments
This feature request has received only twos upvotes in many months, so I'm going to close it.
Can we enable the @openai/codex-sdk to also have a capability similar to createSdkMcpServer from the @anthropic-ai/claude-agent-sdk?