The practical setup for connecting Claude Code to Google Ads and Meta Ads over MCP, including the credentials nobody tells you about until you are stuck.

'
MCP is becoming the default way AI agents connect to advertising platforms.
Join the waitlist and get notified when the new AdLume is ready. It catches wasted ad spend automatically and optimises campaigns around the clock.
One email, on the day access opens. Nothing else, and you can leave the list with one click.
That matters for performance marketers because Google Ads and Meta Ads are no longer just dashboards you inspect manually. They are becoming systems an AI agent can query, summarize, and in some cases modify through a controlled connector.
The basic idea is simple:
This guide shows the practical setup pattern for Claude Code, Google Ads, and Meta Ads. It also covers the part most setup guides skip: what should not be automated yet.
MCP stands for Model Context Protocol. Anthropic describes it as an open standard for connecting AI assistants to the systems where data lives.
For marketers, the translation is:
Instead of exporting CSVs, pasting screenshots, and explaining your account structure every time, you connect a tool layer once. Then Claude can ask that system for data when it needs context.
In Claude Code, MCP servers can be added as:
For ad accounts, both patterns matter.
Meta's official connector is a hosted remote MCP server plus a CLI. Google's open Google Ads MCP implementation runs as a local server that wraps the Google Ads API.
Do not start with writes. Start with read-only diagnostics. The first useful version of an AI ads workflow should answer questions like:
It should not immediately.
The connector gives access. It does not give judgment.
No. This is the most common point of confusion when connecting Meta's official ads MCP server, so it is worth stating plainly.
The endpoint below authenticates through Meta Business OAuth. You add the server, your browser opens a Meta login prompt, and you pick which ad accounts to authorize:
https://mcp.facebook.com/ads
Meta's own documentation is explicit that the ads AI connectors need no developer credentials, API setup, or coding. There is no app to register, no app review, no access token to paste, and no client_id or oauth-client-id to provide.
If your MCP client is asking you for a client_id, one of these is usually true:
The client_id, client_secret and developer_token in this guide belong to the Google Ads configuration file. They are not used for Meta. Mixing the two is the fastest way to get stuck.
There is a fourth cause, and in 2026 it is the most common one.
If you are connecting from Claude Code or Codex rather than a desktop or web client, nothing asks you for a client_id at all. The connection dies on its own in under a second, before any browser window opens. The errors look like this:
SDK auth failed: The provided redirect_uris are not registered for this client.
Registration failed: Dynamic registration is not available for this client.
This has been reported repeatedly since late April 2026 and the reports are still open. Command line clients register themselves with the OAuth server on the fly, using a localhost address for the callback, and Meta's server does not accept that kind of registration. Nothing on your side fixes it: the hosted integration has one fixed identity and gives you no way to supply your own client id, client secret or callback port.
What to do instead.
Source: Meta for Developers: Connect AI Agents to Meta with MCP and Meta for Business: Introducing Meta Ads AI Connectors.
This is the step that gets skipped most often.
Before Claude Code can use an ads MCP server, the underlying connector still needs a valid way to access the ad account.
For Meta's official Ads AI Connector path, you do not create your own Meta Developer App, app secret, system user token, or long-lived Marketing API token.
The official remote MCP server uses Meta's OAuth flow. In practice, you need:
The setup path is.
If you are using an unofficial or self-hosted Meta Marketing API MCP server instead, the credential model changes. Then you may need a Meta Developer App, app review, system user access, a token with the right permissions, and Business Manager setup. That is a different path from Meta's official Ads AI Connector.
Google Ads is different. The local Google Ads MCP server wraps the Google Ads API, so you need API credentials before the MCP server can do anything useful.
At minimum, prepare:
Those values normally land in google-ads.yaml:
developer_token: "INSERT_DEVELOPER_TOKEN" client_id: "INSERT_OAUTH_CLIENT_ID" client_secret: "INSERT_OAUTH_CLIENT_SECRET" refresh_token: "INSERT_REFRESH_TOKEN" login_customer_id: "INSERT_MANAGER_CUSTOMER_ID_OPTIONAL"
Do not commit this file to a repo. Keep it in a local secret path and pass that path to the MCP server through GOOGLE_ADS_CREDENTIALS.
Claude Code supports remote HTTP MCP servers with this pattern:
claude mcp add --transport http <server-name> <server-url>
For any connected server, you can inspect status inside Claude Code:
Open the MCP panel and check whether the server is connected. Then ask Claude to list the available tools before using them. That last step matters. Tool names and capabilities can change, especially during beta.
The full library of AdLume skills: paid ads, landing pages, B2B leads, GTM tracking, e-commerce.
The bundle goes straight to your inbox, then one email a week. Unsubscribe in one click. We never share your address.
Meta introduced Ads AI Connectors in open beta. The package includes an ads MCP server and an ads command line interface. Meta positions the connector around four groups of work:
The remote MCP endpoint commonly referenced in setup guides is:
https://mcp.facebook.com/ads
The reliable path is your client's connector settings screen. In Claude that is Settings, then Connectors, then Add, and you paste the endpoint there. You complete the Meta login in the browser window that opens, then choose which ad accounts and Pages you are authorizing. That consent screen is the only place you decide what the agent can see at all, so read it rather than clicking through it.
The terminal equivalent looks like this, and it is worth knowing that it currently fails for a lot of people:
claude mcp add --transport http meta-ads https://mcp.facebook.com/ads
If that returns a redirect_uris or dynamic registration error, it is the known issue described earlier in this guide, not a mistake in your setup. Use the connector settings screen instead.
For Claude Code and terminal workflows, Meta also announced an ads CLI. That matters because coding agents often work better when a command returns structured JSON, TSV, or a clear exit code.
The practical split.
If you are managing client accounts, I would still start with reporting and diagnostics. Do not give a new agent write access on day one.
At launch the server exposed 29 tools. On my own connection today it exposes 97, grouped into interactive tools that create campaigns, ad sets and ads, read-only tools, and write tools that touch catalogs, creatives, audiences and pixel events. Meta expands the server tool by tool as products leave beta, so whatever number you see is a floor rather than a ceiling.
Each tool has three states: allow, ask first, or block. You can set them individually, and you can set an entire group at once from a dropdown at the group header. That group dropdown is the part worth slowing down for, because one click hands an agent standing permission to create campaigns unattended.
How I set mine.
Leaving the write groups on ask first is not the same as being safe. Approval fatigue is real, and the twentieth prompt of the day gets clicked without reading. If you catch yourself doing that, narrow the scope rather than clicking faster.
Google Marketing Solutions maintains a Google Ads MCP Server repository. The repo describes it as an MCP implementation that lets LLMs interact with the Google Ads API.
Important caveat: the repository itself notes that it is experimental and not intended as a production-supported Google product. Treat it as a powerful technical path, not a compliance shortcut.
So the full Google Ads path is not just "install MCP". It is:
One trap inside the Google Cloud step.
If your OAuth consent screen stays on the Testing publishing status while its user type is External, Google revokes your refresh token after seven days. Everything works, you come back the following week, and it has silently stopped. The fix is one click: set the publishing status to In production. You are not requesting verification and nothing about your account changes. If your account belongs to a Google Workspace organization and you chose Internal, the rule never applies to you.
Two more details stop people at this step. The API Center only exists inside a Google Ads manager account, so a regular account cannot get a developer token until it is linked to one, and the page is not hidden, it simply is not there. And enabling the Google Ads API on the Cloud project is a separate click from creating the project, which later produces an error that never mentions the API.
If you would rather not touch the API at all.
Third-party services such as Pipeboard, Pipedream and Flyweel broker the connection and hand your client a ready endpoint. I am not affiliated with any of them and I am not recommending a specific one, only noting that the category exists, because most guides present the API route as the only option. The tradeoff is real: you are giving a third party standing access to a live ad account, so read what their token can do and where it is stored before you connect anything.
The Google Ads MCP setup requires Google Ads API credentials. The server expects a Google Ads configuration file with keys like:
The basic local server configuration for Claude Code follows the stdio MCP pattern:
claude mcp add --transport stdio google-ads -- \ pipx run --spec git+https://github.com/google-marketing-solutions/google_ads_mcp.git run-mcp-server
You also need to point the server to your Google Ads credentials:
export GOOGLE_ADS_CREDENTIALS="/path/to/google-ads.yaml"
For project-level setup, the same idea can live in MCP JSON configuration, but be careful with secrets. Do not commit credentials into a repo.
The Google Ads MCP repository separates read-only tools from mutation tools. Mutation tools are disabled by default and require an explicit environment variable:
export ADS_MCP_ENABLE_MUTATIONS=true
That default is correct.
A useful rollout sequence looks like this:
Even after mutations are enabled, the agent should not act without a human approval gate.
Once both platforms are connected, do not ask the agent to "optimize the accounts."
Ask for a bounded job:
Review the last 14 days of Google Ads and Meta Ads performance. Compare spend, conversions, CPA, ROAS if available, conversion volume, and major week-over-week changes. Return: 1. the three biggest changes 2. the likely cause of each change 3. what needs human review 4. what should not be changed yet 5. what data is missing Do not make changes. Do not create campaigns. Do not edit budgets. That is a much safer first workflow than asking the agent to manage ads.
It also mirrors how good performance marketers work. They do not start by clicking buttons. They first understand what changed and why.
For Google Ads and Meta Ads, I would require human approval before:
I would allow the agent to draft:
That is the sweet spot: AI does the boring diagnostic work, but the human keeps control over money and account risk.
Connecting Claude Code to ad platforms is not the hard part anymore.
The hard part is building the operating system around the connection:
That is why MCP alone is not enough.
MCP gives the agent access to tools. A good harness turns that access into a repeatable workflow.
For performance marketing, that difference is everything.
AdLume watches your ad accounts and brings the next fix to your team's tools.
One email, on the day access opens. Nothing else, and you can leave the list with one click.
For Meta's official Ads AI Connector you do not create a developer app, app secret or tokens. You need a Meta user with access to the relevant Business Portfolio and ad account, then you authenticate through Meta's OAuth flow in the browser and approve the requested access.
Why does the Google Ads MCP server need a client_id and client_secret?The local Google Ads MCP server wraps the Google Ads API, so it needs OAuth credentials from a Google Cloud project plus a developer token and refresh token. Those values normally live in google-ads.yaml, which should stay out of any repo.
How do I add the Meta Ads MCP server to Claude Code?Run claude mcp add --transport http meta-ads https://mcp.facebook.com/ads, then authenticate through the Meta login flow when the client requests it.
Should I let the agent make changes to my ad accounts?Not at first. Start with read-only reporting, compare the output with your own diagnostics, and require human approval before budget, bidding, pausing or tracking changes even after mutation tools are enabled.