MCP OAuth: Figma token exchange fails with "Failed to parse server response" (distinct from #4870 / #4906)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- api, authentication
Direzione di ricerca
Start at the /mcp → figma → Authenticate flow and trace the token exchange against https://api.figma.com/v1/oauth/token. Capture the response status, headers, and body at the parse failure, then compare it with the OAuth client’s expected response shape. Done means a successful Figma token response is parsed and authentication completes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
After the -32601/server/discover fatal-failure bug (#4870) was fixed in 1.0.87-0, the Figma remote MCP server (https://mcp.figma.com/mcp) now progresses much further through the OAuth flow — client registration succeeds, the browser consent screen works, and the CLI logs Completing authentication... — but the token exchange itself fails with:
OAuth authentication failed for figma: MCPOAuthError: Token exchange failed: Failed to parse server response
This happens on every attempt, with fresh, unused authorization codes, correct PKCE verifiers, and a client that was successfully registered days earlier (so this is not the client_name DCR 403 described in #4906 — registration is not the failure point here).
Environment
- GitHub Copilot CLI: 1.0.87-0
- OS: Linux (devcontainer, aarch64)
- Figma MCP server:
https://mcp.figma.com/mcp - Registered OAuth client: dynamically registered days earlier via DCR,
token_endpoint_auth_methodunknown (bothclient_secret_postandclient_secret_basicare advertised as supported per Figma's.well-known/oauth-authorization-servermetadata)
Steps to reproduce
- Configure the Figma remote MCP server:
{ "mcpServers": { "figma": { "type": "http", "url": "https://mcp.figma.com/mcp", "tools": ["*"] } } } - Trigger authentication (
/mcp→ figma → Authenticate, or reconnect after a 401). - Complete the browser consent screen; the CLI receives the redirect and logs
Completing authentication.... - Immediately after, authentication fails:
ERROR OAuth authentication failed for figma: MCPOAuthError: Token exchange failed: Failed to parse server response
Log excerpt
2026-09-21T09:08:22.351Z [ERROR] Completing authentication...
2026-09-21T09:08:22.565Z [ERROR] OAuth authentication failed for figma: MCPOAuthError: Token exchange failed: Failed to parse server response
2026-09-21T09:08:22.566Z [WARNING] HTTP 401 challenge (WWW-Authenticate: ...authorization_uri="https://api.figma.com/.well-known/oauth-authorization-server") {"server":"figma"}
Investigation so far
- Manually replaying the same authorization code directly against
POST https://api.figma.com/v1/oauth/token(per RFC 8414 discovery, the real token endpoint ishttps://api.figma.com/v1/oauth/token, not/oauth/token) after the CLI's attempt returns a clean, well-formed JSONinvalid_granterror — consistent with the code already being single-use-consumed by the CLI's own (failed) exchange attempt. This suggests the CLI's request did reach the token endpoint and did receive a response (invalid_grant errors from Figma are clean, parseable JSON), but something about a successful response body apparently trips up the CLI's parser — the error text is specifically "Failed to parse server response", not a network/timeout/auth error. - This is not the #4906 DCR
client_name403 issue — our client was registered successfully well before this session (no 403 at registration time), and the failure occurs at the token exchange step, after a successful consent screen. - Not fixed by re-authenticating, restarting the CLI, or using a completely fresh browser-based (non-relayed) OAuth attempt.
Suggested next step
Capture/log the raw HTTP response body (status + headers + body) when a token-exchange parse failure occurs, so the actual shape of Figma's response can be compared against what the CLI's OAuth client expects (e.g. extra/missing fields, unexpected token_type casing, non-standard field names, etc.).
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/copilot-cli
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
github/copilot-cli#4932 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
github/copilot-cli#4909 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
github/copilot-cli#4906 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/copilot-cli#4729 ·
Tutte le issue di github/copilot-cli
Issue simili
-
Issue-Enhancement Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
PowerShell/PowerShell#28061 · 2 reazioni ·
-
Feature Request: Add ability to load custom environment variables in linux-exec-server-installer.sh Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/vscode-remote-release#11867 ·
-
AuTest Bug Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#13714 ·
-
Update to NCCL 2.32 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
conda-forge/nccl-feedstock#166 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
vllm-project/agentic-api#358 · 1 commento ·