claude-code - 💡(How to fix) Fix Meta Ads MCP at mcp.facebook.com/ads rejects Claude Code CLI OAuth — redirect_uris not registered

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…

The Meta Ads MCP server at https://mcp.facebook.com/ads cannot complete OAuth from Claude Code CLI. The flow fails server-side before the browser opens, with:

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

The same MCP authenticates fine from claude.ai web (Pro/Max) and Claude Desktop, so the gap is specifically in what Meta has whitelisted for Claude Code CLI.

Error Message

  1. The flow fails immediately with the redirect_uri error above. No browser window opens.

Root Cause

Likely root cause

Fix Action

Fix / Workaround

Workaround currently in use

Code Example

claude mcp add --transport http meta-ads https://mcp.facebook.com/ads
RAW_BUFFERClick to expand / collapse

Summary

The Meta Ads MCP server at https://mcp.facebook.com/ads cannot complete OAuth from Claude Code CLI. The flow fails server-side before the browser opens, with:

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

The same MCP authenticates fine from claude.ai web (Pro/Max) and Claude Desktop, so the gap is specifically in what Meta has whitelisted for Claude Code CLI.

Reproduction

  1. Register the MCP in Claude Code CLI:
    claude mcp add --transport http meta-ads https://mcp.facebook.com/ads
  2. In a fresh Claude Code session inside a project where the MCP is registered, trigger the OAuth flow (e.g. by calling the mcp__meta-ads__authenticate tool or asking Claude to use a Meta MCP tool).
  3. The flow fails immediately with the redirect_uri error above. No browser window opens.

Working clients

  • claude.ai web (Pro/Max) — connector OAuth completes successfully.
  • Claude Desktop — connector OAuth completes successfully.

Per the support article Meta links to (https://support.claude.com/en/articles/11175166), only those two clients are documented. Claude Code CLI is not mentioned.

Likely root cause

Claude Code CLI uses dynamic client registration (RFC 7591) with a localhost loopback redirect URI (e.g. http://localhost:<port>/callback), which is the standard pattern for HTTP MCP servers and works out of the box with most third-party MCP servers. The Meta Ads MCP appears to:

  • Only allow specific pre-registered redirect URIs (the ones used by claude.ai web and Claude Desktop), and
  • Not support DCR or the localhost loopback redirect URI pattern.

Since Claude Code CLI's redirect URI is not in Meta's allowlist and the server doesn't accept dynamic registration, OAuth is rejected before the user ever sees a browser prompt.

Requested fix

Either:

  • Enable DCR support on the Meta Ads MCP OAuth client, or
  • Whitelist Claude Code CLI's localhost loopback redirect URI pattern on Meta's side.

This appears to require action from Meta on the MCP server configuration. Filing this here in case Anthropic has a partner channel to flag it through, in addition to a parallel report on Meta's developer bug tracker.

Workaround currently in use

Falling back to the official meta-ads Python CLI with a long-lived system-user access token from Business Manager. Functional but bypasses the MCP entirely. This is not a viable substitute for users who specifically want the MCP-driven conversational workflow inside Claude Code CLI.

Environment

  • Claude Code CLI (Opus 4.7, 1M context).
  • macOS Darwin 25.3.0.
  • MCP registered locally per project: claude mcp add --transport http meta-ads https://mcp.facebook.com/ads.
  • claude mcp list reports meta-ads as "Failed to connect" because the local health probe receives 401 without OAuth — the actual failure is the redirect_uri rejection above when OAuth is triggered.

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