Codex MCP OAuth sessions expire and require application restart

Open 💬 1 comment Opened Jul 12, 2026 by khari998

What version of the Codex App are you using (From “About Codex” dialog)?

26.707.51957

What subscription do you have?

Pro

What platform is your computer?

MaDarwin 25.5.0 arm64 arm

What issue are you seeing?

I use the Notion MCP server extensively for work. Recently, its OAuth/MCP session appears to expire or become invalid after approximately one hour, whereas it previously remained usable significantly longer.

The first failure observed was:

Transport send error: ... StreamableHttpClientWorker ... Auth required

After running:

codex mcp login notion

OAuth completed successfully:

Successfully logged in to MCP server 'notion'.

However, the running Codex desktop session still could not use the connector. The MCP tools disappeared from the available tool registry, and attempts to call them produced behavior equivalent to:

tools.mcp__notion__notion_fetch is not a function

The CLI reported the server as healthy:

notion
enabled: true
transport: streamable_http
Auth: OAuth

Only quitting and relaunching Codex caused the MCP tools to reappear and work again.

What steps can reproduce the bug?

  1. Configure and authenticate the Notion MCP server in Codex.
  2. Use the Notion MCP normally for page fetches, searches, and updates.
  3. Continue using Codex for approximately an hour or more.
  4. Attempt another Notion MCP operation.
  5. The operation fails with Auth required, or the MCP tools disappear from the active tool registry.
  6. Run codex mcp login notion; OAuth succeeds.
  7. The CLI reports the MCP server as enabled and authenticated, but the already-running Codex desktop session still cannot call the tools.
  8. Quit and relaunch Codex.
  9. After relaunch, the MCP tools are sometimes restored immediately. In other cases, OAuth login must be repeated, followed by another Codex restart.

The issue is intermittent and may depend on MCP session lifetime or transport state. I do not have a deterministic code snippet because this involves Codex desktop MCP session lifecycle rather than application code.

Diagnostics observed:

codex mcp get notion

reported:

enabled: true
transport: streamable_http
Auth: OAuth

Session ID, token usage, and context-window usage were not available in the error output.

What is the expected behavior?

When the MCP OAuth access token or streamable HTTP session expires, Codex should refresh or reauthenticate the connector automatically and update the active MCP tool registry.

The user should not need to quit and relaunch the entire Codex application, repeat OAuth login multiple times, or restart Codex after successful authentication.

After codex mcp login notion succeeds, the running Codex desktop session should be able to use the refreshed MCP connection immediately.

Additional information

This appears to involve two related failures:

  1. The MCP transport reports Auth required, suggesting the OAuth/session credential is no longer accepted.
  2. After successful CLI reauthentication, the running Codex desktop session retains stale MCP state and does not rehydrate the connector tools until a full application restart.

The Notion page operations themselves are valid. Before the failure, the same connector successfully fetched and updated Notion pages. After restarting Codex, the same operations succeeded again.

Potential areas to investigate:

  • OAuth refresh-token/session lifetime for streamable HTTP MCP servers;
  • Codex desktop MCP transport reconnection;
  • synchronization between CLI MCP authentication state and desktop tool registration;
  • automatic tool-registry refresh after MCP authentication or transport recovery.

Environment:

  • Codex desktop
  • macOS
  • MCP server: notion
  • Transport: streamable_http
  • Authentication: OAuth

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗