Claude Code integration

Meta Ads and Google Ads in Claude Code

Claude Code reaches your ad accounts through a remote MCP server added from the command line. One command adds Adrails, /mcp signs you in with OAuth, and Claude Code reads your Meta Ads and Google Ads figures, prepares launches and prepares the changes you then apply in Adrails, from the project you are working in.

Reviewed Oct 4, 2026

01

What Claude Code can do on your ad accounts

Claude Code works where your files are, so the ad account joins the codebase. Ask for last week's performance_period at the ad level and have the figures written to a CSV, compare two periods with metric_compare before a budget review, or read campaigns_structure while you edit the tracking that feeds the account. Every result carries its exact data in structuredContent.result, the field to read in code.

Launches and changes work the same as in every client. launch_brief says what a clean launch still needs, campaigns_launch or google_ads_build prepares the campaign, and a pause, a budget change of at most 30%, an edit, a duplicate or a split test is prepared as one exact change you apply in Adrails.

  • Pull figures into files, scripts and reports in your project
  • Check campaign structure next to the code that sends conversions
  • Prepare launches and changes, applied from Adrails

02

How to connect Claude Code

Claude Code adds remote MCP servers from the command line. By default the server is added for the current project only; --scope user adds it for every project, and --scope project writes it to a .mcp.json file at the project root that your team can share through version control. Claude Code asks before it uses a project-scoped server from .mcp.json.

If the browser does not open for the sign-in, copy the address Claude Code prints and open it yourself. Allowing a tool call in Claude Code is Claude Code's own setting; an advertising change waits on its page in Adrails.

  • 1. From your project directory, run claude mcp add --transport http adrails https://adrails.ai/api/mcp
  • 2. In Claude Code, run /mcp, select adrails and authenticate
  • 3. Your browser opens Adrails: sign in, choose the workspace and the permissions, and choose Allow access
  • 4. Return to Claude Code and ask your first question

03

Which tools Claude Code gets

The server registers 63 tools: the 43 tools the Adrails agents use in the app and 20 tools for accounts, integrations, campaign drafts, automations, Knowledge and job status. Claude Code lists only the tools the connection's permissions and your role allow. Reads return data and change nothing; a tool that changes an ad account prepares the change and needs an idempotency key, so a retried call never does the work twice.

Every tool, its inputs and who can call it is in the MCP tools reference, and the server card lists each tool with the schema the server registers, marked read-only or not.

04

Security and control

The sign-in is OAuth 2.1 with dynamic client registration and PKCE: Claude Code registers itself, and no client ID, secret, API key or developer token is copied. Meta Ads and Google Ads are connected once in Adrails, which holds the platform access; tool results never contain provider credentials. The consent screen asks for one workspace and the permissions you grant, and a permission never goes beyond your role.

No tool creates, edits, pauses, switches on or rebudgets a campaign, ad set or ad by itself. A change comes back with a link to the Review advertising change page in Adrails, where an owner or admin applies it or declines it after Adrails reads the platform again. Everything a launch creates lands paused, switching it on is a second proposal that lists every budget that starts spending, and an applied change can be undone while the platform still matches what Adrails wrote. A proposal expires after 30 minutes.

Every tool call is recorded with who made it, the workspace, the client, the tool, the outcome and the duration, never the argument values. Each connection has its own history in the workspace. Revoke Claude Code at any time under Your connections on the MCP page in Adrails; removing the server with claude mcp remove does not revoke it there.

What runs where

Claude Code, Adrails and the ad platform, step by step

Claude Code, Adrails and the ad platform, step by step
StepIn Claude CodeIn Adrails
A question about resultsClaude Code picks the tool and reasons over the figuresReads the workspace's accounts and returns the table; nothing changes on the platform
A new launchlaunch_brief asks what is missing, then campaigns_launch or google_ads_build prepares itThe proposal waits on the Review advertising change page; applied, it is built paused
A pause or a budget moveOne exact change, prepared in the conversationAn owner or admin applies it after Adrails reads the platform again; undo while it still matches
The permission promptClaude Code's own setting for tool callsThe consent screen: one workspace and the permissions you grant
The recordThe conversationEvery tool call logged, every change kept with its evidence
The costYour Claude Code plan does the reasoningNo agent credit per tool call; a plan from $149 a month to prepare changes

From the Adrails MCP documentation and Claude Code's own documentation on 4 October 2026.

FAQ

Common questions

Does Claude Code need an API key or a developer token?

No. Claude Code signs in to Adrails with OAuth, in your browser. Meta Ads and Google Ads are connected once in Adrails, which holds the platform access, and tool results never contain provider credentials.

Can my team share the Adrails server through the repository?

Yes. claude mcp add with --scope project writes the server to .mcp.json at the project root, which you check into version control. Each person still signs in to Adrails with their own account, and each connection works in the one workspace its person chose.

Can Claude Code change my campaigns on its own?

No. No tool creates, edits, pauses, switches on or rebudgets a campaign, ad set or ad by itself. Claude Code prepares the exact change, and an owner or admin signed in to Adrails applies it from the Review advertising change page. Allowing the tool call in Claude Code applies nothing.

Which ad platforms can Claude Code work on?

Meta Ads and Google Ads, every account of the workspace you chose, with the same tools and the same guardrails as the Adrails agents. Google Ads opens once Google finishes verifying Adrails. Connect Meta for now.