Enable MCP Settings Per Profile

Resolved 💬 6 comments Opened Jan 15, 2026 by TylonHH Closed Aug 5, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

Summary

On Windows (PowerShell), profile-scoped MCP server enablement does not appear to take effect. MCP servers only load when enabled at the top level or when forced via CLI override.

Version / Environment

  • Codex CLI v0.84.0
  • Windows (PowerShell)
  • Config: C:\Users\Rene\.codex\config.toml

Config (sanitized)

[mcp_servers.home-assistant]
command = "npx"
args = ["-y", "@coolver/home-assistant-mcp@latest"]
env = { "HA_AGENT_URL" = "http://homeassistant.local:8099" }
env_vars = ["HA_AGENT_KEY"]
enabled = false

[profiles.ha.mcp_servers.github]
enabled = false
[profiles.ha.mcp_servers.n8n]
enabled = false
[profiles.ha.mcp_servers.home-assistant]
enabled = true

$env:HA_AGENT_KEY is present in the same shell before launching Codex.

Steps to Reproduce

1) Run codex --profile ha
2) Run /mcp in the Codex REPL

Actual

/mcp shows No MCP tools available.

Expected

Home Assistant MCP server should be loaded because profiles.ha.mcp_servers.home-assistant.enabled = true.

Workarounds that work

  • Enable the MCP server at the top level ([mcp_servers.home-assistant] enabled = true), or
  • Force enable via CLI override:

codex --profile ha -c 'mcp_servers.home-assistant.enabled=true'

Notes

This looks like profile-scoped MCP enablement is not being applied (or is being overridden) in v0.84.0 on Windows.

View original on GitHub ↗

6 Comments

etraut-openai contributor · 7 months ago

Yes, profiles don't currently support MCP configurations.

I'll change this to a feature request, and we can see if other Codex users upvote it.

maheshrijal contributor · 7 months ago

I use the Grafana MCP for work, but it always takes up so much context. I'd love to see this implemented.

CodyDunlap · 7 months ago

This is also true on Mac/Linux. This would be a super helpful feature.

altnp · 6 months ago

This is a key feature for proper subagent support as well. I don't want my main agent using playwrite, context7, etc I want to force it to delegate to subagents.

I love codex, but this feature (along with WIP subagents) is currently forcing me to use OpenCode instead. Which is a bummer because the codex app is so nice.

WilliamGetsAI · 26 days ago
## Summary On Windows (PowerShell), profile-scoped MCP server enablement does not appear to take effect. MCP servers only load when enabled at the top level or when forced via CLI override. ## Version / Environment Codex CLI v0.84.0 Windows (PowerShell) Config: C:\Users\Rene\.codex\config.toml ## Config (sanitized) [mcp_servers.home-assistant] command = "npx" args = ["-y", "@coolver/home-assistant-mcp@latest"] env = { "HA_AGENT_URL" = "http://homeassistant.local:8099" } env_vars = ["HA_AGENT_KEY"] enabled = false [profiles.ha.mcp_servers.github] enabled = false [profiles.ha.mcp_servers.n8n] enabled = false [profiles.ha.mcp_servers.home-assistant] enabled = true $env:HA_AGENT_KEY is present in the same shell before launching Codex. ## Steps to Reproduce 1. Run codex --profile ha 2. Run /mcp in the Codex REPL ## Actual /mcp shows No MCP tools available. ## Expected Home Assistant MCP server should be loaded because profiles.ha.mcp_servers.home-assistant.enabled = true. ## Workarounds that work Enable the MCP server at the top level ([mcp_servers.home-assistant] enabled = true), or * Force enable via CLI override: codex --profile ha -c 'mcp_servers.home-assistant.enabled=true' ## Notes This looks like profile-scoped MCP enablement is not being applied (or is being overridden) in v0.84.0 on Windows.

I operate a digital agency and manage several separate n8n accounts for different clients and internal projects.

Codex needs to support multiple named n8n MCP connections simultaneously, with a separate URL, authentication state, credentials and permissions for each connection.

Each Codex project should be able to select its authorised n8n connection without overwriting another connection or requiring repeated authentication.

Separate Codex agents and projects should also be able to work with different n8n accounts concurrently, while maintaining strict isolation between client environments.

etraut-openai contributor · 23 days ago

Profile v2 full-config files support profile-specific MCP definitions.