claude-code - 💡(How to fix) Fix Remote MCP (Figma): post-OAuth reconnect hangs 30s and fails, requires full restart [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55943Fetched 2026-05-05 06:02:18
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

After completing the OAuth flow for a remote HTTP MCP server (https://mcp.figma.com/mcp), Claude Code stores the token successfully but the in-process post-auth reconnect hangs for the full 30 s connection timeout and fails with:

Got new credentials, but reconnecting to figma failed. Restart Claude Code to retry.

The same endpoint is reachable in <1 s from curl on the same machine at the same moment, so this is not a network or server issue — the MCP client's reconnect-after-auth path is broken.

Error Message

08:49:51.131 MCP server "figma": Connection timeout triggered after 30018ms (limit: 30000ms) 08:49:51.133 MCP server "figma": HTTP Connection failed after 30020ms: MCP server "figma" connection timed out after 30000ms (code: none, errno: none) 08:49:51.133 [ERROR] MCP server "figma" TelemetrySafeError: MCP server "figma" connection timed out after 30000ms 08:49:51.134 MCP server "figma": Connection failed after 30020ms 08:49:51.134 [ERROR] MCP server "figma" Connection failed: MCP server "figma" connection timed out after 30000ms 08:49:51.135 MCP server "figma": Reconnection failed after authentication

Root Cause

Related secondary issue (probably same root cause)

Fix Action

Fix / Workaround

Workaround for other users

Code Example

$ time curl -v --max-time 10 https://mcp.figma.com/mcp
< HTTP/2 405
< content-type: application/json; charset=utf-8
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed."},"id":null}
curl -v --max-time 10 https://mcp.figma.com/mcp  0.01s user 0.01s system 2% cpu 0.933 total

---

08:49:00.583 MCP server "figma": Fetched OAuth metadata with scope: mcp:connect
08:49:00.583 MCP server "figma": Generated new OAuth state
08:49:02.265 MCP server "figma": Authorization URL: https://www.figma.com/oauth/mcp?...
08:49:02.266 MCP server "figma": Opening authorization URL: ...
08:49:18.794 MCP server "figma": MCP OAuth server cleaned up
08:49:21.088 MCP server "figma": Token expires in: 7776000
08:49:21.112 MCP server "figma": Token expires_in: 7775999.977

---

08:49:51.131 MCP server "figma": Connection timeout triggered after 30018ms (limit: 30000ms)
08:49:51.133 MCP server "figma": HTTP Connection failed after 30020ms: MCP server "figma" connection timed out after 30000ms (code: none, errno: none)
08:49:51.133 [ERROR] MCP server "figma" TelemetrySafeError: MCP server "figma" connection timed out after 30000ms
08:49:51.134 MCP server "figma": Connection failed after 30020ms
08:49:51.134 [ERROR] MCP server "figma" Connection failed: MCP server "figma" connection timed out after 30000ms
08:49:51.135 MCP server "figma": Reconnection failed after authentication
RAW_BUFFERClick to expand / collapse

Summary

After completing the OAuth flow for a remote HTTP MCP server (https://mcp.figma.com/mcp), Claude Code stores the token successfully but the in-process post-auth reconnect hangs for the full 30 s connection timeout and fails with:

Got new credentials, but reconnecting to figma failed. Restart Claude Code to retry.

The same endpoint is reachable in <1 s from curl on the same machine at the same moment, so this is not a network or server issue — the MCP client's reconnect-after-auth path is broken.

Environment

  • Claude Code: 2.1.126 (also reproduced on 2.1.123)
  • OS: macOS 26.4 (build 25E246), Apple Silicon
  • Shell: zsh, Apple_Terminal (also reproduces in VS Code integrated terminal)
  • MCP server: figma — remote HTTP transport, https://mcp.figma.com/mcp
  • Network: tested on home Wi-Fi and on phone hotspot — same result
  • No HTTP_PROXY / HTTPS_PROXY set

Reproduction

  1. claude mcp add --transport http figma https://mcp.figma.com/mcp
  2. claude --debug
  3. /mcp → select figmaAuthenticate
  4. Browser opens, user approves in Figma, browser shows success.
  5. Terminal eventually shows: Got new credentials, but reconnecting to figma failed. Restart Claude Code to retry.
  6. /mcp shows figma as Failed/Disconnected.
  7. Quit Claude Code (/quit) and restart — the persisted token is picked up cleanly and figma connects on first try with no further auth.

So the token is valid; only the in-process reconnect is broken.

Expected behavior

After OAuth completes, the MCP client should re-establish the HTTP transport using the new token and transition the server to Connected — without requiring the user to quit and relaunch Claude Code.

Actual behavior

The reconnect attempt opens an HTTPS request that never completes the MCP handshake within the 30 s timeout. The same TLS endpoint responds correctly in <1 s to a plain curl.

Evidence

Network is healthy

$ time curl -v --max-time 10 https://mcp.figma.com/mcp
< HTTP/2 405
< content-type: application/json; charset=utf-8
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed."},"id":null}
curl -v --max-time 10 https://mcp.figma.com/mcp  0.01s user 0.01s system 2% cpu 0.933 total

(HTTP/2 405 is the correct response for GET on this endpoint.)

Debug log — full sequence from ~/.claude/debug/<id>.txt

OAuth flow succeeds and token is obtained:

08:49:00.583 MCP server "figma": Fetched OAuth metadata with scope: mcp:connect
08:49:00.583 MCP server "figma": Generated new OAuth state
08:49:02.265 MCP server "figma": Authorization URL: https://www.figma.com/oauth/mcp?...
08:49:02.266 MCP server "figma": Opening authorization URL: ...
08:49:18.794 MCP server "figma": MCP OAuth server cleaned up
08:49:21.088 MCP server "figma": Token expires in: 7776000
08:49:21.112 MCP server "figma": Token expires_in: 7775999.977

Immediately after, post-auth reconnect hangs and times out:

08:49:51.131 MCP server "figma": Connection timeout triggered after 30018ms (limit: 30000ms)
08:49:51.133 MCP server "figma": HTTP Connection failed after 30020ms: MCP server "figma" connection timed out after 30000ms (code: none, errno: none)
08:49:51.133 [ERROR] MCP server "figma" TelemetrySafeError: MCP server "figma" connection timed out after 30000ms
08:49:51.134 MCP server "figma": Connection failed after 30020ms
08:49:51.134 [ERROR] MCP server "figma" Connection failed: MCP server "figma" connection timed out after 30000ms
08:49:51.135 MCP server "figma": Reconnection failed after authentication

After quitting and relaunching, Figma connects without re-auth → confirms the stored token is valid and only the in-process reconnect path is broken.

Related secondary issue (probably same root cause)

The initial connection on session start sometimes also hits the same 30 s timeout — even with a valid stored token — and only recovers after the user manually re-auths or restarts. Same Connection timeout triggered after 30000ms signature. Suggests the HTTP transport's first request after a state transition (cold start, post-OAuth) doesn't complete the MCP handshake reliably, while subsequent requests in the same process work fine.

Suggested fix direction

  • Tear down and re-create the HTTP transport object after OAuth completes, instead of attempting to reuse the connection that failed pre-auth with a 401. The current "reconnect with new token" path appears to be reusing stale transport state.
  • Surface the underlying handshake failure in the user-facing message instead of the generic "Restart Claude Code to retry" — at minimum, log the response status / first bytes from the failing request so users can self-diagnose.

Workaround for other users

Until fixed, treat re-auth as a two-process flow:

  1. When prompted to authenticate, complete the browser flow.
  2. When you see "Got new credentials, but reconnecting failed" — immediately quit Claude Code.
  3. Relaunch — token is picked up cleanly on cold start.

extent analysis

TL;DR

The most likely fix is to tear down and re-create the HTTP transport object after OAuth completes, instead of reusing the connection that failed pre-auth with a 401.

Guidance

  • Investigate the HTTP transport object's state after OAuth completes and determine why it's not being properly updated with the new token.
  • Consider adding logging to surface the underlying handshake failure, including the response status and first bytes from the failing request.
  • Verify that the stored token is valid by checking the token's expiration time and scope.
  • Test the workaround of quitting and relaunching Claude Code after authentication to confirm that the token is being picked up cleanly on cold start.

Example

No code snippet is provided as the issue does not include specific code references.

Notes

The issue seems to be related to the reuse of stale transport state after OAuth completes. The suggested fix direction of tearing down and re-creating the HTTP transport object may resolve the issue. However, further investigation is needed to confirm the root cause.

Recommendation

Apply the workaround of quitting and relaunching Claude Code after authentication until the issue is fixed, as it allows the token to be picked up cleanly on cold start.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After OAuth completes, the MCP client should re-establish the HTTP transport using the new token and transition the server to Connected — without requiring the user to quit and relaunch Claude Code.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Remote MCP (Figma): post-OAuth reconnect hangs 30s and fails, requires full restart [1 comments, 2 participants]