Official Meta Ads MCP fails OAuth login with invalid_client_metadata
Open 💬 13 comments Opened May 22, 2026 by canorionen
Summary
Official Meta Ads MCP login fails in Codex before the browser/OAuth consent flow opens.
MCP server:
https://mcp.facebook.com/ads
Codex reports:
Error: Registration failed: Dynamic registration failed: Registration failed: HTTP 400 Bad Request: {"error":"invalid_client_metadata","error_description":"Dynamic registration is not available for this client."}
Environment
- Codex CLI:
0.130.0 - Also reproduced with:
npx @openai/codex@0.133.0 - Platform: Linux server over SSH / Codex desktop remote
- MCP config:
[mcp_servers.meta_ads_mcp]
enabled = true
url = "https://mcp.facebook.com/ads"
Reproduction
- Add the official Meta Ads MCP server with URL
https://mcp.facebook.com/ads. - Click Authenticate in Codex UI, or run:
``sh``
codex mcp login meta_ads_mcp
- No browser consent flow opens.
- Login fails during dynamic client registration with
invalid_client_metadata.
Expected behavior
Codex should complete OAuth login for the official Meta Ads MCP server, or support the client metadata/static client identity required by Meta's hosted MCP OAuth flow.
Notes
This appears related to #19154, but this case is for Meta's official hosted Ads MCP endpoint rather than a private/internal OAuth server.
13 Comments
openai/codex #24103: Official Meta Ads MCP Fails OAuth Login with
invalid_client_metadataExecutive Summary
The Meta Ads MCP server fails during OAuth login with an
invalid_client_metadataerror. This occurs because Codex's OAuth implementation uses Dynamic Client Registration (DCR) per RFC 7591 when no explicitclient_idis configured, and the client metadata payload sent during DCR does not satisfy Meta's OAuth authorization server requirements.The root cause is that the RMCP library's DCR implementation sends a minimal client metadata payload (primarily
client_name: "Codex"andredirect_uris) that Meta's OAuth server rejects as non-compliant. Meta requires additional metadata fields such astoken_endpoint_auth_method, specificgrant_types, and potentiallysoftware_statementfor client assertion.Impact: P1 — Users cannot authenticate with the official Meta Ads MCP server at all. The error is unrecoverable without manual configuration workarounds.
Expected quote: $2,000–$3,000
Labels: bug, auth, mcp, CLI
Competition: 0 comments, 0 PRs (zero competition)
---
1. Problem Analysis
1.1 Error Reproduction
When a user attempts to authenticate with the Meta Ads MCP server:
The OAuth flow fails with:
This error originates from Meta's OAuth authorization server rejecting the Dynamic Client Registration (DCR) request.
1.2 OAuth Flow Architecture
I can reproduce this on Codex Desktop for macOS as well.
Environment:
codex-cli 0.131.0-alpha.9https://mcp.facebook.com/adsCommands:
Result:
codex mcp listshows the server is added and enabled, but auth remainsNot logged in.So this appears to reproduce the same failure mode: the OAuth browser consent flow never opens because dynamic client registration fails first.
Same here with codex v0.135.0
Same here.
still an issue
Any clue when this is going to be fixed?
Reproduced on macOS with the Codex desktop app / local CLI.
My MCP config is:
Clicking Authenticate in Codex does not open a browser. Running:
fails immediately with:
So this is reproducible on a local Mac as well, not only on a remote/Linux setup.
+1, please address.
It still exists for more than a month now.
What happened? Will this be fixed?
Adding a user-impact note from Codex Desktop.
The Meta Ads MCP issue is not just a technical auth edge case. For small-business and marketing operators, this blocks a very natural workflow: connect Meta Ads, ask for campaign data, reason about the numbers, and then keep planning/executing in the same Codex session.
A smoother remote MCP OAuth flow would make Codex much stronger as a combined planning + execution workspace. The ideal experience is not only "chat" and not only "coding": users need an agent that can research, connect tools, pull data, reason over the business context, operate browser/UI when needed, and teach the user how to execute professionally while doing the work.
This kind of mode would help users learn to control AI tools instead of being replaced by them: fewer broken auth handoffs, clearer tool connection states, and a more fluid bridge between strategy, data, and action.
use meta cli from python, works fine. codex loves it. generate a token using the busniess manager "system user". took a bit (annyoing imo), but it works. codex is managing my ads now.
Reproduced again on 2026-07-15 with current local builds:
0.144.126.707.72221https://mcp.facebook.com/adscodex mcp get meta_adsshows the streamable HTTP server enabled. Runningcodex mcp login meta_adsstill fails before opening browser consent:User impact: this prevents handing off an existing Meta Ads analysis/creative-production workflow from Claude’s hosted Meta Ads connector to Codex. Codex can read the local handoff and downstream attribution systems, but cannot authenticate to Meta for live spend/delivery or approved ad preparation. No bearer-token workaround should be required for the official hosted MCP endpoint.