Skip to content

[BUG] Official Meta Ads MCP (mcp.facebook.com/ads) fails OAuth with "redirect_uris are not registered for this client" #55002

Description

@Ranex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:autharea:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:wslIssue specifically occurs on WSL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions