Codex config.toml becomes corrupted after adding a third-party MCP app, causing configuration parsing failures

Open 💬 0 comments Opened Jun 25, 2026 by Sunnykill

What version of the IDE extension are you using?

OpenAI ChatGPT IDE Extension 26.616.81150

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

Antigravity IDE

What platform is your computer?

(macOS output from uname -mprs)

What issue are you seeing?

After adding a third-party MCP application (Hostinger) through the Codex Apps/MCP interface, Codex starts writing an invalid ~/.codex/config.toml.

Once this happens, Codex becomes unstable and multiple unrelated features stop working.

Observed symptoms included:

  • Failed to resume chats
  • Unable to switch models
  • Sandbox creation failures
  • “Unable to send message”
  • Chats stuck on “Loading…”
  • Authentication failures after configuration corruption

Codex also reports configuration parsing errors such as:

failed to load configuration:
~/.codex/config.toml

unexpected key or value, expected newline, '#'

and

key with no value, expected '='

The generated TOML file contained invalid concatenated content similar to:

[projects."/Users/..."]
trust_level = "trusted"["--package=hostinger-api-mcp@latest","hostinger-domains-mcp"]

which is not valid TOML.

What steps can reproduce the bug?

  1. Install the ChatGPT IDE extension.
  2. Configure Codex normally.
  3. Add the Hostinger MCP application from the Apps/MCP settings.
  4. Restart the IDE or create a new Codex task.
  5. Observe that ~/.codex/config.toml becomes corrupted.
  6. Codex then starts failing to load configuration and several features stop working.

During investigation I also found that removing cached MCP configuration (mcp.extCachedServers) and restoring a clean config.toml immediately fixed the issue.

What is the expected behavior?

Adding an MCP application should never generate invalid TOML.

If an MCP configuration cannot be serialized correctly, Codex should reject that configuration rather than writing an invalid config.toml.

Additional information

While debugging, I verified that:

  • the ChatGPT extension reads ~/.codex/config.toml;
  • removing the cached MCP configuration resolved the issue;
  • after restoring a clean config.toml, Codex worked normally again;
  • reintroducing the MCP integration caused the corruption to reappear.

I’m not certain whether the bug is inside the MCP serialization layer, the IDE integration, or the interaction with the third-party MCP app, but the resulting configuration file is consistently malformed and prevents Codex from functioning correctly.

View original on GitHub ↗