ads-mcp-server
Provides read-only access to a local DuckDB file containing paid media marts, enabling performance reporting, pacing checks, and anomaly detection against that warehouse.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ads-mcp-serverHow did TikTok perform last week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ads-mcp-server
A read-only Model Context Protocol server that lets Claude answer questions about paid media performance and budget pacing straight from the warehouse: "How did TikTok do last week?", "Which platform is over-pacing?", "Anything weird in May?"
It sits on top of the marts built by paid-media-pipeline and runs against either BigQuery or a local DuckDB file seeded with the same synthetic data.
All data is synthetic. Campaigns, IDs, and budgets are fictional.
Tools
Tool | What it does |
| Platforms, date coverage, campaign counts, valid options. Claude calls this first so it doesn't guess date ranges. |
| Spend, impressions, clicks, conversions, CTR, CPC, CPM, CVR, CPA for a date range, grouped by platform, campaign, objective, audience, format, day, week, or month |
| Month-to-date spend vs. plan by platform, with pacing index, projected month-end spend, and over/under flags |
| Campaign-days that deviate sharply from that campaign's own recent history |
Related MCP server: meta-ads-mcp-server
Design decisions
Read-only by construction. The DuckDB connection opens read-only; on BigQuery the service account only needs
bigquery.dataViewer+jobUser. Every tool carries MCP'sread_only_hint.No SQL from the model. Claude picks from allow-listed options; values go in as bound query parameters. There's no "run this SQL" tool.
Cost guardrail. BigQuery queries set
maximum_bytes_billed, so a bad date range fails instead of scanning the warehouse.Errors the model can act on. Invalid input raises the SDK's
ToolError, so Claude sees "end_date is before start_date" and retries, rather than a generic failure.Ratios of sums. CTR/CPC/CPA are computed from summed components and returned ready to quote, so the model never averages daily ratios.
Anomaly detection that doesn't cry wolf. A robust z-score (median and MAD) per campaign, with two fixes that came from testing against realistic data:
weekdays are compared to weekdays and weekends to weekends, because B2B and search campaigns dip every weekend
MAD is floored at 5% of the median, and at Poisson noise for count metrics, so "4 conversions vs. a median of 1" isn't reported as a crisis
The synthetic data has one planted spend spike; it's the top result for spend, clicks, impressions, and conversions.
Run locally
pip install -e ".[dev]"
python scripts/seed_duckdb.py # builds data/ads.duckdb
pytest -qClaude Desktop
{
"mcpServers": {
"ads-performance": {
"command": "python",
"args": ["-m", "ads_mcp.server"],
"cwd": "/path/to/ads-mcp-server"
}
}
}Claude Code
claude mcp add ads-performance -- python -m ads_mcp.serverAgainst BigQuery
pip install -e ".[bigquery]"
export ADS_BACKEND=bigquery BQ_PROJECT=your-project BQ_DATASET=ads_reporting
python -m ads_mcp.serverOr deploy the Dockerfile to Cloud Run (streamable HTTP on port 8080) with a service account scoped to the reporting dataset, and require authentication on the service.
Tests
tests/test_tools.py seeds a fresh DuckDB file and checks that totals reconcile across groupings, ratios are ratios of sums, bad input is rejected with useful messages, pacing flags the expected platforms, the planted anomaly ranks first, weekend dips aren't flagged, and the server exposes exactly four read-only tools.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Read-only Google Analytics 4 MCP server for AI assistants.
Connect your ads, shop, analytics, social, CRM and finance platforms once, then let Claude, ChatGPT, Cursor or any MCP client read, join and explain your numbers. Public statistics from the World Bank, IMF, Eurostat, OECD, WHO and SEC filings come as context, searchable and chartable from the same tools. Read-only by design, every number carries its source.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for the LinkedIn Marketing API — query campaigns, performance, and Lead Gen Forms from Claude in plain English. 19 read-only tools covering ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, period comparisons, conversions, Lead Gen Forms, audiences, and targeting facets. Built for B2B paid social teams.194-
- AlicenseAqualityDmaintenanceMCP Server for the Meta Marketing API. Gives Claude Desktop direct access to your ad account data — campaign performance, creative analysis, audience breakdowns, and budget pacing.10115 npm1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Ads campaign reporting and management via Claude, enabling GAQL queries, performance metrics, and campaign modifications.20 npmMIT
- FlicenseBqualityCmaintenanceA platform-agnostic MCP server that connects Claude to campaign data, institutional knowledge, and historical performance for paid media teams, enabling automated analysis, reporting, and debugging.73-