What
mcp serve runs Claude Code as an MCP server that another program can connect to and use for tools. --session-tunnel is the mode where it serves those tools to a remote session through a tunnel.
CLAUDE_CODE_MCP_SERVE_INTERFACE_MIN_VERSIONis a new environment variable. If its value differs from the daemon'smin_version, the launch version is ignored and a log line records it.CLAUDE_CODE_MCP_SERVE_AUTH_TOKENis now cleared once it has been read.- A new
RunManagedHooktool runs command hooks, andSetProjectMcpServerEnabledis added. - Tunnel startup now builds a launcher through
dialingLauncherFromfrom the transport and port, and stops with its refusal text. Before, it parsed a session-tunnel envelope withparseSessionTunnelEnvelopeandsessionTunnelRefusal. --session-tunnelreads arunnerwithpidandproc_start. The runner is the program that started the tunnel. The tunnel refuses to start ifCCR_AGENT_PROXY_ENABLEDis set, or if it cannot see the runner ("--session-tunnel cannot see the runner that started it"). It exits once the runner is gone.--session-tunnelnow takessession_token_expires_atand shuts down with "the session_token_expires_at it was started with has passed". Before, the only message was "the token has expired".- A permanent relay failure now reports either
stated_expiry_passedortoken_expiredinstead of a singleexpiredreason. The stated expiry is used as a fallback.
Why
This mostly matters to programs that embed mcp serve. A tunnel now ends when the program that started it is gone or when its stated token expiry passes, and its reason says which expiry ended it.