Skip to content

MCP OAuth compatibility question: Grok Bot stops after successful DCR and never opens authorization #31926

Closed

Description

@killtw

Question

I'm trying to connect Grok Bot to T3 Code's remote MCP endpoint using OAuth over Tailscale HTTPS. Discovery and dynamic client registration succeed, but the OAuth client stops before requesting the authorization endpoint. Is there a known interoperability requirement or a supported configuration we should check?

I'm not claiming this is a T3 Code server bug: the available evidence does not explain why the client stops after registration.

Setup

  • MCP endpoint: https://<machine>.<tailnet>.ts.net/mcp (private hostname redacted).
  • Tailscale Serve forwards HTTPS to T3 Code at http://127.0.0.1:3773.
  • Tailscale TCP reachability to port 443 was verified, and the OAuth requests below reached T3 Code.
  • Client user-agent recorded by the server: Cursor/1.0.0 (Grok Bot).
  • A separate static-bearer connector can successfully read a T3 project. It is not the OAuth connector being tested.
  • Exact installed T3 Code version/build: not captured in this investigation. The source references below were inspected at commit 202d5b5616e3edf65706371e2b8a9c4f486d0a96; this is not a claim that the running server matches that commit.

Reproduction

  1. Add a new remote MCP connector pointing at https://<machine>.<tailnet>.ts.net/mcp, with no Authorization header, no supplied client ID/client secret, and no manually configured scopes.
  2. Start normal OAuth authentication for that connector.
  3. Grok Bot reports authentication failed. No T3 /connect-agent approval page opens.

For clarity, the Grok Bot connector setup arguments were equivalent to:

{
  "name": "t3code-oauth",
  "url": "https://<machine>.<tailnet>.ts.net/mcp"
}

The separate authentication request selected that connector and its default account, without forcing reauthentication. These are connector-management arguments, not the actual OAuth HTTP payloads. We have not captured the DCR request/response bodies or the client's internal error.

Sanitized server trace

On 2026-11-06, Asia/Taipei (UTC+8), the first attempt showed:

18:00:34 POST /mcp                                          401
18:00:34 POST /mcp                                          401
18:00:35 GET  /.well-known/oauth-protected-resource/mcp      200
18:00:35 GET  /.well-known/oauth-authorization-server        200
18:00:35 GET  /.well-known/oauth-protected-resource/mcp      200
18:00:35 POST /oauth/mcp/register                            201
18:00:35 GET  /.well-known/oauth-authorization-server        200
18:00:35 POST /oauth/mcp/register                            201

A second authentication attempt showed:

18:02:18 POST /mcp                                          401
18:02:18 GET  /.well-known/oauth-protected-resource/mcp      200
18:02:19 GET  /.well-known/oauth-authorization-server        200
18:02:19 POST /oauth/mcp/register                            201

The corresponding McpOAuth.register spans were successful. In the inspected window there were no requests to:

  • /oauth/mcp/authorize
  • /connect-agent
  • the approval/decision endpoints
  • /oauth/mcp/token

The initial unauthenticated /mcp 401s appear to be expected discovery probes, rather than proof of the failure.

Grok Bot also displays: “Grok Bot reaches this server through your connected tailnet from your chats. It can't be checked from here.” We do not know whether this generic UI message is relevant; the server trace confirms that discovery and registration reached the server.

Relevant source findings

At the inspected commit:

  • OAuth metadata advertises public-client authorization-code OAuth with PKCE S256, without a refresh-token grant.
  • Token response schema has no refresh token. We have no evidence that this causes the client failure.
  • Outside-agent documentation describes OAuth approval and recommends T3 Connect for hosted bots. This test uses a Tailscale HTTPS endpoint; we have not tested T3 Connect as a comparison.
  • MCP session access handling explains why the static bearer fallback is not equivalent to OAuth Full access: an operate session without a runtime ceiling defaults to approval-required. We want to use the normal OAuth consent flow, not bypass that ceiling.

Hermes was able to complete OAuth against T3 Code according to the user, but its exact configuration and a comparable trace have not been independently collected.

Expected result

The client should proceed from discovery/DCR to /oauth/mcp/authorize, open /connect-agent, allow the user to choose the intended access level, and exchange the code normally.

Questions

  1. Are there known Grok Bot/Cursor OAuth interoperability issues where registration returns 201 but authorization never starts?
  2. Is OAuth over a reachable Tailscale Serve HTTPS endpoint supported for this client, or is T3 Connect required for reasons beyond network reachability?
  3. Are there specific metadata/DCR response fields or client settings to check for this symptom?
  4. Which additional non-secret server diagnostics would help distinguish a T3 compatibility issue from a client-side failure?

No credentials, authorization codes, PKCE values, cookies, private hostname, or raw request/response bodies are included here.

Activity

  1. added
    needs more info
    on Nov 6, 2026
  2. juliusmarminge commented on Nov 6, 2026

    @juliusmarminge
    Member

    Thanks for the careful trace. I couldn't reproduce a server-side stop on current main (202d5b5616, the commit you inspected).

    What I ran, against a fresh server:

    • The MCP TypeScript SDK's OAuth client (auth() from @modelcontextprotocol/sdk 1.29.0), once against the server directly and once through an HTTPS proxy that forwards like Tailscale Serve (it keeps Host and sets X-Forwarded-Proto: https, with a hosted-style https:// redirect URI). Both runs made the same requests as your trace:
      GET  /.well-known/oauth-protected-resource/mcp   200
      GET  /.well-known/oauth-authorization-server     200
      POST /oauth/mcp/register                         201
      
      The client then built the authorization URL, and GET /oauth/mcp/authorize returned 302 to /connect-agent. Every advertised URL used the https://<host> origin, including issuer, authorization_endpoint and resource.
    • grok CLI 1.0.70, whose MCP OAuth client is rmcp, got the 401 and read WWW-Authenticate: Bearer resource_metadata=…. It then reported "Server supports OAuth but has no stored tokens", which is the expected state before sign-in.

    Answers to your questions:

    1. We don't know of a client that stops after a 201 from /oauth/mcp/register. The server isn't involved again until the client opens /oauth/mcp/authorize. So when no authorize request arrives, the client gave up on its own side after reading the registration response.
    2. Tailscale Serve HTTPS is supported for OAuth. The server builds its OAuth URLs from X-Forwarded-Proto for this case. The docs suggest T3 Connect for hosted agents only because of reachability: the hosted service has to reach the address, and so does the browser where you approve.
    3. One field in the registration response differs from what clients usually ask for. The response always has "grant_types": ["authorization_code"] because T3 Code issues no refresh tokens (tracked in https://git.cafe/pingdotgg/t3code/issues/26748), even when the client requests refresh_token. A client that requires refresh tokens could stop here. Apart from that field, the reference client accepts the metadata and the registration response as-is.
    4. Helpful non-secret data:
      • the DCR request body, keeping grant_types, response_types, token_endpoint_auth_method and scope, and only the host of each redirect_uris entry
      • the grant_types in the 201 response
      • the exact error text Grok Bot shows, or any log line it gives after registration
      • your T3 Code version (Settings → About, or t3 --version)

    With the client's error text and the DCR request shape, we can tell whether the cause is the refresh_token grant or something else.

  3. killtw commented on Nov 6, 2026

    @killtw
    Author

    Thanks for testing both the SDK client and the HTTPS proxy case. Your clarification means we should not treat T3 Connect as a requirement when both the hosted client and approval browser can reach the Tailscale endpoint.

    The exact visible Grok Bot error is only t3code-oauth 授權失敗 (“t3code-oauth authentication failed”). The connector status exposes needsAuth / authentication_required, with no underlying OAuth exception. The tailnet sentence quoted in the issue is separate UI text, not a more specific OAuth error.

    Our connector was configured without an Authorization header, explicit client ID/secret, or manually specified scopes. These configuration facts do not tell us what the OAuth client actually put in the DCR body: we have not captured its grant_types, response_types, token_endpoint_auth_method, scope, or redirect hosts. The sanitized trace we collected contains request paths and status codes, not the registration payloads. The installed T3 version also remains unverified; the source commit in the issue should not be read as the running build version.

    So the remaining evidence gap is precisely the client's DCR payload and post-registration error (plus the running server version). We cannot yet confirm or rule out the refresh-token compatibility hypothesis. No server-side authentication settings have been changed as a workaround, and we have not bypassed the runtime ceiling.

    Is there a supported server-side logging option that captures just the non-secret DCR fields you listed, without recording credentials, authorization codes, or full redirect URLs? That would help obtain the missing request shape safely on a subsequent explicitly approved attempt.

  4. removed
    needs more info
    on Nov 6, 2026
  5. juliusmarminge commented on Nov 6, 2026

    @juliusmarminge
    Member

    The Cursor/1.0.0 user agent in your trace is the MCP OAuth client inside Cursor's agent SDK (@cursor/sdk 1.2.0). I ran that client against a fresh T3 Code server on current main (c8267db9ac), with a connector set up like yours: one HTTP MCP URL, no Authorization header, no client ID or secret, no scopes. It made the same requests as your trace and then stopped:

    POST /mcp                                     401
    GET  /.well-known/oauth-protected-resource/mcp 200
    GET  /.well-known/oauth-authorization-server   200
    POST /oauth/mcp/register                       201
    

    This is the request shape it registered with (logo URL dropped):

    {
      "redirect_uris": ["https://www.cursor.com/agents/mcp/oauth/callback", "http://localhost:8787/callback"],
      "token_endpoint_auth_method": "none",
      "grant_types": ["authorization_code", "refresh_token"],
      "response_types": ["code"],
      "client_name": "Cursor",
      "scope": "orchestration:read orchestration:operate"
    }

    T3 Code answered 201 with "grant_types": ["authorization_code"]. The client saved that registration as returned. It didn't reject it.

    The refresh_token hypothesis is ruled out. I ran the same client a second time through a proxy that added refresh_token to the grant_types in the response, and the request sequence was identical: the client still stops after register.

    Stopping after register is the client's normal pre-sign-in state. After registration, Cursor's client builds the authorization URL and puts the connector in requires_authentication, which it reports as needsAuth. That matches the status you see. The URL is stored in that state, and the app hosting the client has to open it or show it to you. T3 Code isn't contacted again until someone opens that URL. That's why no /oauth/mcp/authorize request shows up in your trace.

    I also built the authorization request the client would send, with its registered client_id, PKCE S256, its scope and the resource parameter. For both registered redirect URIs, GET /oauth/mcp/authorize returned 302 to /connect-agent, so T3 Code accepts it.

    So nothing on the T3 Code side is stopping the flow. The missing step is in Grok Bot: it has the sign-in URL but shows "authentication failed" instead of letting you open it. Check whether Grok Bot shows a sign-in or connect link for the connector, and open it in a browser that can reach your tailnet. After you approve, the browser returns to https://www.cursor.com/agents/mcp/oauth/callback. If Grok Bot never shows that link, the Grok Bot or Cursor developers can tell you how to get it.

    About logging: T3 Code has no option that logs DCR request fields, and the McpOAuth.register span records only whether registration succeeded. You shouldn't need it, because the request shape above is what this client sends.

    Closing this since the server side works as designed. If Grok Bot does open the sign-in page and something fails after that, reply here with the step that fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions