[BUG] ENABLE_EXPERIMENTAL_MCP_CLI=true mode results in intermittent use of stale session ID
Resolved 💬 7 comments Opened Dec 15, 2025 by TyceHerrman Closed Mar 2, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running ENABLE_EXPERIMENTAL_MCP_CLI=true env var and using mcp-cli, exiting a session and resuming the session later causes mcp-cli to use a stale session ID, causing the mcp tool calls to fail.
What Should Happen?
mcp-cli should work after closing a session and re-launching it through /resume.
Error Messages/Logs
Error: Exit code 1
Warning: MCP endpoint file not found at /tmp/claude/claude-code-mcp-cli/1544c6ea-e68d-4cc2-b7b4-285e9d3d8123.endpoint (session:
1544c6ea-e68d-4cc2-b7b4-285e9d3d8123). Falling back to state file.
Error: MCP state file not found at /tmp/claude/claude-code-mcp-cli/1544c6ea-e68d-4cc2-b7b4-285e9d3d8123.json (session:
1544c6ea-e68d-4cc2-b7b4-285e9d3d8123). Is Claude Code running?
Steps to Reproduce
- Start a session with ENABLE_EXPERIMENTAL_MCP_CLI=true env var
- Do some work that invokes mcp-cli in bash tool
- End the session with ctrl+c twice
- reopen CC with same ENABLE_EXPERIMENTAL_MCP_CLI=true env var
- Use /resume and reopen session
- try and do more work that invokes mcp-cli
- mcp-cli will fail
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.69
Platform
Other
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗