AI-powered Measurement Operations for paid media (Google Ads today; Meta, LinkedIn, TikTok, CM360 on the roadmap), over the Model Context Protocol.
Project description
📈 Measure Paid Media MCP
AI-powered Measurement Operations for paid media, over the Model Context Protocol.
Audit · analyse · monitor your paid-media campaigns in natural language, from Claude, ChatGPT, Codex, Gemini or any MCP client.
A product of the Measure AI ecosystem · built on measure-sdk.
What is Measure Paid Media MCP?
An open-source MCP server that lets an AI assistant audit campaigns, validate
tracking, compare platforms and recommend optimisations across your paid-media
stack — read-only and safe by design. It is part of the Measure AI ecosystem
and depends on only measure-sdk (shared auth, config, logging and domain
models); it never depends on another MCP.
"Audit all active campaigns from the last 30 days."
"Find campaigns with spend but no conversions."
"Compare Google Ads and Meta Ads ROAS for the last 14 days."
"Check if my conversion tracking pixels are healthy."
"Generate a paid media performance report by platform."
"What optimizations should I make this week?"
Relationship to Measure SDK
This product is a thin, focused layer on top of measure-sdk:
| Provided by measure-sdk | Provided by this repo |
|---|---|
| OAuth, sessions, credential storage | Paid-media connectors (Google Ads, …) |
| Config, logging, HTTP, retry, rate limiting | Audit / tracking / reporting / recommendation engines |
MCP utilities, base CLI (measure login) |
MCP server + paid-media tools |
| Shared domain models & enums | Normalised Campaign / TrackingSignal |
Shared result types — AuditFinding, Recommendation, Report, Metric,
HealthScore, Connection, ValidationResult — all come from the SDK and are
never redefined here.
Install
pip install measure-paid-media-mcp # pulls measure-sdk automatically
measure login # Google OAuth (from the SDK)
measure doctor # what's connected
measure-paid-media # start the MCP server (stdio)
Configuration is optional and non-secret (defaults, thresholds, feature
flags). For Google Ads, set MEASURE_ADS_DEVELOPER_TOKEN and
MEASURE_ADS_CUSTOMER_ID. Credentials are never stored in .env.
Try it instantly (demo mode)
No account? Explore every tool with realistic sample data — no credentials:
MEASURE_PM_DEMO=true measure-paid-media
Demo mode serves sample Google Ads + Meta campaigns and tracking signals, so
audit_campaigns, get_cross_channel_performance,
generate_optimization_recommendations, etc. all return rich output. It is
clearly labelled as DEMO in check_platform_health and never hits a live API.
Connect to Claude Desktop
See examples/claude_desktop/config.json.
Supported platforms
| Phase | Platforms |
|---|---|
| 1 | Google Ads ✅ · Meta Ads ✅ · cross-channel reporting · campaign & tracking audit |
| 2 | LinkedIn Ads ✅ · TikTok Ads ✅ · Microsoft Ads ✅ (enable via flags) |
| 3 | CM360 ✅ · Floodlight 🟡 · advanced recommendations · alerting automation |
Adding a platform is a new connector under connectors/ implementing one
Protocol — no engine or tool changes required.
MCP tools (MVP)
| Group | Tools |
|---|---|
| Connections | list_connected_platforms, check_platform_health |
| Campaign audit | audit_campaigns, find_wasted_spend, find_campaigns_without_conversions, find_low_roas_campaigns, find_high_cpa_campaigns |
| Tracking audit | audit_tracking, check_conversion_pixels, find_missing_conversion_events |
| Reporting | get_cross_channel_performance, compare_platform_performance, generate_paid_media_report |
| Recommendations | generate_optimization_recommendations |
| Alerts | evaluate_alert, send_notification (console / Slack / Teams / Discord) |
Architecture (Clean Architecture)
src/measure_paid_media/
├── core/ # domain: Campaign/TrackingSignal models, enums, connector PORT
├── config/ # settings (extends SDK CoreSettings; optional, non-secret)
├── connectors/ # infrastructure: one vertical per platform (implements the port)
│ ├── google_ads/ meta_ads/ linkedin_ads/ tiktok_ads/ microsoft_ads/ cm360/
├── engines/ # application: pure use cases → SDK domain models
│ ├── audit/ tracking/ reporting/ recommendations/ alerts/
├── services/ # orchestration: connectors → engines (the tools call this)
├── validators/ # input validation → SDK ValidationResult
├── mcp/ # interface: server.py + tools/ (one module per group)
└── cli/ # interface: the measure-paid-media entry point
Dependencies point inward: mcp/cli → services → engines → core; connectors
implement core's port. Engines are pure and platform-agnostic, so the same
audit rules run on every platform. See
docs/architecture/overview.md.
Security & disclaimer
This MCP is read-only: it audits, analyses and recommends. It never modifies, pauses or rebudgets campaigns. Any future write capability will require preview → dry-run → explicit user confirmation → audit log, gated by the SDK's permission policy. See SECURITY.md.
Develop
git clone https://github.com/measure-mcp/measure-paid-media-mcp.git
cd measure-paid-media-mcp
python3.12 -m venv .venv && source .venv/bin/activate
pip install -e ../measure-sdk # or the published measure-sdk
pip install -e ".[dev]"
ruff check . && ruff format --check . && mypy . && pytest
Ecosystem
| measure-sdk | Shared core: domain models, enums, Health Score, infra. |
| measure-analytics-mcp | GA4, GTM, BigQuery, Consent, Server-Side, Data Quality, Alerts. |
| measure-paid-media-mcp | This product. |
See CHANGELOG.md · ROADMAP.md · SECURITY.md · CONTRIBUTING.md · CODE_OF_CONDUCT.md.
License
Apache-2.0. Contributions welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file measure_paid_media_mcp-0.3.1.tar.gz.
File metadata
- Download URL: measure_paid_media_mcp-0.3.1.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72865edad6267c1f47fd7f9bfea7c824c749ab12ec0ba2190a8e3c624239ae88
|
|
| MD5 |
b855ec178c06557eb69c52eb65024750
|
|
| BLAKE2b-256 |
db1fb4c69508d5f98342599c8df5d27f833028da79f91b773365351497852677
|
Provenance
The following attestation bundles were made for measure_paid_media_mcp-0.3.1.tar.gz:
Publisher:
release.yml on measure-mcp/measure-paid-media-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
measure_paid_media_mcp-0.3.1.tar.gz -
Subject digest:
72865edad6267c1f47fd7f9bfea7c824c749ab12ec0ba2190a8e3c624239ae88 - Sigstore transparency entry: 2123653524
- Sigstore integration time:
-
Permalink:
measure-mcp/measure-paid-media-mcp@f962d575bf77064464bd27cba7119452dc9049e4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/measure-mcp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f962d575bf77064464bd27cba7119452dc9049e4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file measure_paid_media_mcp-0.3.1-py3-none-any.whl.
File metadata
- Download URL: measure_paid_media_mcp-0.3.1-py3-none-any.whl
- Upload date:
- Size: 61.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
795d385efa12b75496e1fb64cf7b078533b32f2ad051373534a7cb4ba8ce2983
|
|
| MD5 |
baf245b6f63f3f4e9511a7f25df4d1db
|
|
| BLAKE2b-256 |
fbfe46cf3b22b2fa6ba526a4c90f152f632a5cdbde6986f3728f270cb4398534
|
Provenance
The following attestation bundles were made for measure_paid_media_mcp-0.3.1-py3-none-any.whl:
Publisher:
release.yml on measure-mcp/measure-paid-media-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
measure_paid_media_mcp-0.3.1-py3-none-any.whl -
Subject digest:
795d385efa12b75496e1fb64cf7b078533b32f2ad051373534a7cb4ba8ce2983 - Sigstore transparency entry: 2123653633
- Sigstore integration time:
-
Permalink:
measure-mcp/measure-paid-media-mcp@f962d575bf77064464bd27cba7119452dc9049e4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/measure-mcp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f962d575bf77064464bd27cba7119452dc9049e4 -
Trigger Event:
workflow_dispatch
-
Statement type: