To connect Google Ads to the Claude Agent SDK, add an http MCP server for https://mcp.paidsync.ai/mcp with your PaidSync.ai API key in the Authorization header, and list its tools in allowedTools. Your agent can then call PaidSync.ai tools for Google Ads, Meta Ads and 12 other platforms.
What the Agent SDK Needs
The Agent SDK takes MCP servers in its options. For a remote server you need:
- An mcpServers entry with type
http, the URL and a headers object. - allowedTools naming the tools, in the form
mcp__paidsync__tool_name. - A PaidSync.ai API key in an environment variable.
The SDK does not open a browser or run an interactive OAuth flow, so a header token is the route. Anthropic's docs say MCP tools need explicit permission through allowedTools.
How the Connection Works
| Setting | Value |
|---|---|
| Server type | http |
| URL | https://mcp.paidsync.ai/mcp |
| Header | Authorization: Bearer, from an environment variable |
| Tool names | mcp__paidsync__ followed by the tool name |
| Key limit | Reads and previews on Google Ads |
Applying a Google Ads change needs PaidSync.ai's OAuth sign-in. If you complete that flow in your own app, you can send the access token in the same header.
How to Connect Google Ads to the Claude Agent SDK in 5 Steps
Do these in order. The code box holds the exact setup from Claude Agent SDK MCP docs.
Connect Google Ads to PaidSync.ai
Sign up at paidsync.ai and connect Google Ads on Google's own sign-in screen.
Create an API key
Create a key in your dashboard and export it as PAIDSYNC_API_KEY.
Add the server
Pass the snippet below as your options.
Allow only what you need
List read tools such as mcp__paidsync__get_wasted_spend_report in allowedTools.
Check the init message
Look at the init message's mcp_servers list and confirm paidsync shows connected.
Claude Agent SDK with PaidSync.ai
import asyncio, os
from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
options = ClaudeAgentOptions(
mcp_servers={
"paidsync": {
"type": "http",
"url": "https://mcp.paidsync.ai/mcp",
"headers": {"Authorization": "Bearer " + os.environ["PAIDSYNC_API_KEY"]},
}
},
allowed_tools=["mcp__paidsync__get_wasted_spend_report"],
)
async def main():
async for message in query(prompt="Run get_wasted_spend_report for the last 30 days.", options=options):
if isinstance(message, ResultMessage) and message.subtype == "success":
print(message.result)
asyncio.run(main())How to Check the Connection
Read the init message first. A status of connected for paidsync means the key works.
How PaidSync.ai Protects You
- Explicit permission. Only the tools in allowedTools run without a prompt.
- Reports change nothing. The wasted spend and performance reports only read your account.
- Sign-in for changes. A key cannot apply a Google Ads change.
- A change log. Applied changes are logged, on a best-effort basis, with a before-and-after result.
Setup follows Anthropic's Agent SDK documentation, checked on 24 October 2026. Source: Claude Agent SDK MCP docs. Every Google Ads tool is on the Google Ads MCP server page, and the full list of clients is on Connect your ads.
Add to ChatGPT: open PaidSync.ai in ChatGPT's plugin directory, install it, then sign in.
Add to Claude: open PaidSync.ai in Claude's connector directory, click Connect, then sign in.
Frequently Asked Questions
Does the Claude Agent SDK support remote MCP servers?
Yes. Anthropic's docs describe http and sse servers with headers, in Python and TypeScript.
Why a key and not OAuth?
Anthropic's docs say the SDK does not run an interactive OAuth flow. Pass a token in headers.
How do I name PaidSync.ai tools in allowedTools?
Use mcp__paidsync__ followed by the tool name, or mcp__paidsync__* for all of them.
Does it work for Meta Ads?
Yes. The same server exposes Meta Ads tools. See the Meta Ads MCP server page.
How much does it cost?
PaidSync.ai is free for 100 tasks a month, worth $50, with no card. Pro starts at $99 a month. See pricing.
Related Guides
PaidSync.ai runs 630+ tools across 14 ad and analytics platforms. Connect your accounts once and use them in the AI assistant you already work in.
Get Started Free Book a Demo