t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Claude threads cannot sign in to an MCP server that needs authentication, and the agent has no way to start it

Open hieu-lee opened this issue 3 weeks ago • 1 comments

Area

apps/server

Steps to reproduce

  1. Configure an OAuth-protected MCP server for Claude Code (a remote HTTP/SSE server, or a claude.ai connector). Let its login expire, or never sign in to it.
  2. Start or resume a Claude thread in T3 Code. The server's status is needs-auth and its tools are missing.
  3. Ask the agent to sign in to that server.

Expected behavior

The agent can start the server's sign-in itself, hand the user the login link, and finish once the user has logged in. The user only completes the login in the browser. They do not have to leave T3 Code for a terminal.

Actual behavior

Claude Code's /mcp → Authenticate flow is interactive, and T3 Code runs Claude through the non-interactive Agent SDK, so there is no way to run it. The agent has no tool for it either. The only way to restore the server is to run claude, then /mcp, in a terminal, and then restart the T3 Code thread.

The Claude CLI already supports this headlessly. Its stdio control channel serves mcp_status, mcp_authenticate (returns the authUrl), mcp_oauth_callback_url (accepts a pasted redirect URL when the browser cannot reach the CLI's localhost callback), and mcp_reconnect. @anthropic-ai/claude-agent-sdk 0.3.276 exposes them as mcpServerStatus, mcpAuthenticate, mcpSubmitOAuthCallbackUrl and reconnectMcpServer on the query object. T3 Code never calls the authentication ones.

Impact

Any Claude thread that depends on an OAuth MCP server stops working when its token expires. Long-running threads are hit the most, and the user has to step out of T3 Code to recover. Related reports that were closed without a fix: #33755, #19471, #20298. #28568 covers the separate case where a reconnected claude.ai connector stays needs-auth.

Version or commit

main at 78e93fd9d1, Claude Code 2.1.322, @anthropic-ai/claude-agent-sdk 0.3.276.

Environment

Any surface and connection mode. The CLI runs on the T3 Code server host, so sign-in must also work when the user's browser is on another machine.

Workaround

Authenticate in a terminal with claude → /mcp, then restart the agent session from the command palette.

hieu-lee avatar Nov 11 '26 00:11 hieu-lee

Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

juliusmarminge avatar Nov 11 '26 00:11 juliusmarminge