Skip to content

Enable MCP Settings Per Profile #9325

Closed

Description

@TylonHH

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.

Activity

  1. added
    bug
    CLI
    windows-os
    mcp
    on Jan 15, 2026
  2. etraut-openai commented on Jan 16, 2026

    @etraut-openai
    Contributor

    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.

  3. changed the title [-]Profiles: profile-scoped MCP enable not applied on Windows (v0.84.0)[/-] [+]Profiles: profile-scoped MCP configuration[/+] on Jan 16, 2026
  4. added
    enhancement
    and removed
    bug
    windows-os
    CLI
    on Jan 16, 2026
  5. maheshrijal commented on Jan 16, 2026

    @maheshrijal
    Contributor

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

  6. changed the title [-]Profiles: profile-scoped MCP configuration[/-] [+]Enable MCP Settings Per Profile[/+] on Jan 16, 2026
  7. changed the title [-]Enable MCP Settings Per Profile[/-] [+]👍Enable MCP Settings Per Profile[/+] on Jan 16, 2026
  8. CodyDunlap commented on Jan 17, 2026

    @CodyDunlap

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

  9. added
    windows-os
    and removed
    windows-os
    on Jan 22, 2026
  10. altnp commented on Feb 10, 2026

    @altnp

    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.

  11. changed the title [-]👍Enable MCP Settings Per Profile[/-] [+]Enable MCP Settings Per Profile[/+] on Mar 27, 2026
  12. WilliamGetsAI commented on Aug 1, 2026

    @WilliamGetsAI

    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.

  13. etraut-openai commented on Aug 5, 2026

    @etraut-openai
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions