claude-code - 💡(How to fix) Fix [BUG] Official Meta Ads MCP (mcp.facebook.com/ads) fails OAuth with "redirect_uris are not registered for this client" [2 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#55002Fetched 2026-05-01 05:48:49
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2cross-referenced ×2closed ×1

Authenticating to the official hosted Meta Ads MCP server at https://mcp.facebook.com/ads fails before the browser opens, with Meta's OAuth server rejecting Claude Code's dynamic client registration:

SDK auth failed: The provided redirect_uris are not registered for this client.

Because this is the official hosted integration, there's no way for the user to override client_id, client_secret, or --callback-port — the OAuth client identity is fixed by Claude Code, so this can only be fixed on the Anthropic ↔ Meta side.

Error Message

13:12:35.817 [DEBUG] MCP server "meta-ads": Initializing HTTP transport to https://mcp.facebook.com/ads 13:12:35.820 [DEBUG] MCP server "meta-ads": HTTP transport options: {"url":"https://mcp.facebook.com/ads","headers":{"User-Agent":"claude-code/2.1.123 (cli)","Accept-Encoding":"identity"},"hasAuthProvider":true,"timeoutMs":60000} 13:12:36.573 [DEBUG] MCP server "meta-ads": HTTP Connection failed after 756ms: The provided redirect_uris are not registered for this client. 13:12:41.065 [DEBUG] MCP server "meta-ads": SDK auth error: jo: The provided redirect_uris are not registered for this client. 13:12:41.066 [DEBUG] MCP server "meta-ads": Error during auth completion: Error: SDK auth failed: The provided redirect_uris are not registered for this client.

Root Cause

Because this is the official hosted integration, there's no way for the user to override client_id, client_secret, or --callback-port — the OAuth client identity is fixed by Claude Code, so this can only be fixed on the Anthropic ↔ Meta side.

Fix Action

Fix / Workaround

Because this is the official hosted integration, there's no way for the user to override client_id, client_secret, or --callback-port — the OAuth client identity is fixed by Claude Code, so this can only be fixed on the Anthropic ↔ Meta side.

Code Example

SDK auth failed: The provided redirect_uris are not registered for this client.

---

13:12:35.817 [DEBUG] MCP server "meta-ads": Initializing HTTP transport to https://mcp.facebook.com/ads
13:12:35.820 [DEBUG] MCP server "meta-ads": HTTP transport options: {"url":"https://mcp.facebook.com/ads","headers":{"User-Agent":"claude-code/2.1.123 (cli)","Accept-Encoding":"identity"},"hasAuthProvider":true,"timeoutMs":60000}
13:12:36.573 [DEBUG] MCP server "meta-ads": HTTP Connection failed after 756ms: The provided redirect_uris are not registered for this client.
13:12:41.065 [DEBUG] MCP server "meta-ads": SDK auth error: jo: The provided redirect_uris are not registered for this client.
13:12:41.066 [DEBUG] MCP server "meta-ads": Error during auth completion: Error: SDK auth failed: The provided redirect_uris are not registered for this client.
RAW_BUFFERClick to expand / collapse

Summary

Authenticating to the official hosted Meta Ads MCP server at https://mcp.facebook.com/ads fails before the browser opens, with Meta's OAuth server rejecting Claude Code's dynamic client registration:

SDK auth failed: The provided redirect_uris are not registered for this client.

Because this is the official hosted integration, there's no way for the user to override client_id, client_secret, or --callback-port — the OAuth client identity is fixed by Claude Code, so this can only be fixed on the Anthropic ↔ Meta side.

Environment

  • Claude Code: 2.1.123 (per User-Agent in debug log)
  • Platform: Linux / WSL2 (Ubuntu under WSL2 on Windows)
  • MCP server: https://mcp.facebook.com/ads (HTTP transport, official Meta Ads MCP)

Reproduction

  1. Add the official Meta Ads MCP via /mcp (project-scoped HTTP server, URL https://mcp.facebook.com/ads).
  2. Run /mcp → select Meta-ads MCP ServerAuthenticate.
  3. Browser does not open. Dialog shows: SDK auth failed: The provided redirect_uris are not registered for this client.

Debug log (claude --debug-file ... --debug mcp)

13:12:35.817 [DEBUG] MCP server "meta-ads": Initializing HTTP transport to https://mcp.facebook.com/ads
13:12:35.820 [DEBUG] MCP server "meta-ads": HTTP transport options: {"url":"https://mcp.facebook.com/ads","headers":{"User-Agent":"claude-code/2.1.123 (cli)","Accept-Encoding":"identity"},"hasAuthProvider":true,"timeoutMs":60000}
13:12:36.573 [DEBUG] MCP server "meta-ads": HTTP Connection failed after 756ms: The provided redirect_uris are not registered for this client.
13:12:41.065 [DEBUG] MCP server "meta-ads": SDK auth error: jo: The provided redirect_uris are not registered for this client.
13:12:41.066 [DEBUG] MCP server "meta-ads": Error during auth completion: Error: SDK auth failed: The provided redirect_uris are not registered for this client.

The failure is a server-to-server response from Meta's auth endpoint within ~750ms of the handshake starting — no browser launch is attempted, so this is not a WSL browser-handoff issue.

Suggested fix

Either:

  • Anthropic's OAuth client config for the hosted Meta Ads MCP is missing the redirect_uri Claude Code is registering, or
  • Meta's allowlist for that client needs to include Claude Code's localhost callback pattern.

It would also help if Claude Code logged the exact redirect_uri value it tried to register — currently the rejection is logged but not the request body.

extent analysis

TL;DR

The most likely fix is to update Anthropic's OAuth client configuration to include the redirect URI registered by Claude Code.

Guidance

  • Verify the redirect_uri value being registered by Claude Code and check if it matches the allowed redirect URIs in Meta's OAuth client configuration.
  • Check Meta's allowlist for the client to ensure it includes Claude Code's localhost callback pattern.
  • Consider adding logging in Claude Code to capture the exact redirect_uri value being registered to aid in debugging.
  • Review the OAuth client configuration for the hosted Meta Ads MCP to ensure it is correctly set up.

Example

No code snippet is provided as the issue is related to configuration and not code.

Notes

The exact solution may depend on the specifics of the OAuth client configuration and the allowlist setup, which are not provided in the issue.

Recommendation

Apply workaround: Update Anthropic's OAuth client configuration to include the redirect URI registered by Claude Code, as this is the most likely cause of the issue and is within the control of the Anthropic team.

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…

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 [BUG] Official Meta Ads MCP (mcp.facebook.com/ads) fails OAuth with "redirect_uris are not registered for this client" [2 comments, 2 participants]