profiles for "codex mcp" mode: enable "codex mcp --profile=[model profile key defined in config.toml]"

Resolved 💬 3 comments Opened Aug 27, 2025 by neurostream Closed Jan 24, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

please allow codex running in MCP server mode ("codex mcp") to use the "profile" scheme already supported by the TUI and EXEC modes.


codex mcp --help
Experimental: run Codex as an MCP server

Usage: codex mcp [OPTIONS]

Options:
  -c, --config <key=value>
          Override a configuration value that would otherwise be loaded from `~/.codex/config.toml`. Use a dotted path (`foo.bar.baz`) to override nested values. The `value` portion is parsed as JSON. If it fails to parse as JSON, the raw string is used as a literal.
          
          Examples: - `-c model="o3"` - `-c 'sandbox_permissions=["disk-full-read-access"]'` - `-c shell_environment_policy.inherit=all`

  -h, --help
          Print help (see a summary with '-h')

if I run the codex TUI (the MCP _CLIENT_ in this scenario) with a config.toml entry like:

[mcp_servers.codex]
env = { "CODEX_HOME" = "/home/codex/mcp/codex" }
command = "codex"
args = [ "mcp", "--profile", "gpt-oss" ]

then the codex mcp server should read ${CODEX_HOME}/config.toml where a [profiles.gpt-oss] block is defined - instead of having break it out as "-c" options in the command line.

or, is there a design reason why "codex mcp" isn't supporting the same config.toml scheme that "codex [tui]" and "codex exec" does?

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

neurostream · 11 months ago

to avoid conflation with other feature requests, to be clear:

This is about when you run "codex mcp" from a shell. This is a request to support the "--profile" command line switch.

"codex exec --profile=mygpt" works
"codex mcp --profile=mygpt" does not work

etraut-openai contributor · 7 months ago

This feature request hasn't received any upvotes or activity in many months, so I'm going to close.