Repository navigation
Replies: 1 comment
|
PR is up and ready for review: #34124 It covers Claude and Codex (Codex has the same gap; its sign-in finishes in its own loopback listener, so no |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Claude Code's
/mcp→ Authenticate flow is interactive, and T3 Code drives Claude through the non-interactive Agent SDK. When an OAuth MCP server's login expires, or a claude.ai connector showsneeds-auth, a Claude thread cannot sign in again. The user has to open a terminal, runclaude, then/mcp, and restart the T3 Code thread. Related reports: #33755, #19471, #20298 (all closed) and the broader inspect-and-control request in #10535. The original issue for this proposal, #34117, was closed as a feature request.Proposal
Let the agent sign in for the user. The user's only step is the browser login.
t3_mcp_server, withaction:list(server names and status),authenticate(returns the sign-in link for the agent to show),callback(finishes sign-in from a pasted redirect URL, for when the user's browser cannot reach the machine running the CLI), andreconnect.mcp_status,mcp_authenticate,mcp_oauth_callback_url,mcp_reconnect. T3 Code keeps no OAuth state, tokens, or listeners. The CLI holds the pending sign-in and reconnects the server itself when it finishes.awaitBackgroundTasksandmcpAppsshape: an optional operation on the provider session runtime, reached from a service method, so providers without it report "unsupported". Claude and Codex implement it. Cursor, Grok, OpenCode and Antigravity are out of scope here.listreturns only name and status, not each server's tool list or error text, which can echo headers.Open questions for maintainers
mcpAuthenticateandmcpSubmitOAuthCallbackUrlexist at runtime in@anthropic-ai/claude-agent-sdkbut are missing from its type declarations, so the adapter sends the control requests directly, as it already does formcp_call. Is depending on that acceptable?A working implementation with tests is open as a PR (below); direction is still open for discussion.
Update: Codex has the same problem
Codex threads are affected too: T3 drives the app-server and never calls its
mcpServer/oauth/login, so a logged-out MCP server needscodex mcp loginin a terminal. The same tool covers it, withmcpServerStatus/list,mcpServer/oauth/loginandconfig/mcpServer/reload. Codex finishes sign-in in its own loopback listener, so it has nocallbackaction (it needs a browser on the environment's machine), andreconnectreloads all servers for the next turn. Thecallbackwording above is Claude-only.Implementation: #34124
All reactions