When the MCP server is configured, codex exec fails to exit properly after execution

Resolved 💬 1 comment Opened Dec 5, 2025 by lovelyjuice Closed Feb 3, 2026

What version of Codex is running?

codex-cli 0.65.0

What subscription do you have?

API

Which model were you using?

gpt-5.1-codex

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

If the MCP server is enabled, the program cannot exit normally after running codex exec and requires pressing Ctrl+C to exit.

<img width="3024" height="1122" alt="Image" src="https://github.com/user-attachments/assets/276a7dd8-a369-41be-b6ad-f6e06c86d722" />

If the MCP server is not enabled, the program can exit automatically after completion.

<img width="3724" height="1032" alt="Image" src="https://github.com/user-attachments/assets/9ed1583a-4a33-43ec-b74d-d0b245c162ac" />

What steps can reproduce the bug?

Enable any MCP server, then execute codex exec "Who are you?" --skip-git-repo-check -C . -o result.md

What is the expected behavior?

The program should exit automatically after completion, rather than requiring the user to press Ctrl+C

Additional information

_No response_

View original on GitHub ↗

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