Repeated Xcode permission prompt on every Codex app focus when using Apple Xcode MCP server

Open 💬 1 comment Opened Feb 18, 2026 by batanus

Description

When connecting the newly introduced Apple Xcode MCP server to the Codex macOS app, Xcode prompts for tool access permission every time the Codex application regains focus.

Observed Behavior

  • On initial connection, Xcode displays the standard permission dialog:

_“Allow ‘Codex’ to access Xcode?”_

  • After granting permission, integration works correctly.
  • However, each time the Codex app:
  • is brought back to the foreground,
  • regains focus after switching to another app,
  • or becomes active again,

Xcode displays the same permission dialog again.

  • In Xcode → Agent Activity, multiple Codex entries appear (many marked as Active), indicating that new MCP server sessions are being created repeatedly instead of reusing an existing session.

Expected Behavior

  • Codex should maintain a single persistent MCP server session.
  • Xcode permission should be requested only once per installation (or once per session lifecycle), not on every focus event.

Comparison

Other tools that integrate with the Xcode MCP server (e.g., VSCode, Claude Code, Antigravity, all CLI's) do not exhibit this issue. They appear to:

  • Maintain a single active MCP session.
  • Avoid re-triggering Xcode’s permission dialog when the application regains focus.

Hypothesis

Codex may be spawning a new MCP server process or reinitializing the MCP connection on each NSApplicationDidBecomeActive event. Xcode likely treats each new process/session as a separate agent requiring authorization.

If confirmed, the issue may be resolved by:

  • Reusing an existing MCP connection,
  • Preventing session reinitialization on app activation,
  • Or ensuring a stable long-lived MCP server process.

This behavior significantly disrupts workflow, as the permission dialog interrupts normal usage whenever switching between applications.
<img width="263" height="284" alt="Image" src="https://github.com/user-attachments/assets/8cec3583-af75-41d0-a273-f20b8fbf514d" />
<img width="354" height="461" alt="Image" src="https://github.com/user-attachments/assets/32a3b0fa-0a5d-4eb6-863e-1cbe6f6d28af" />

View original on GitHub ↗

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