Unified Ad Intelligence MCP
Project description
Unified Ad Intelligence MCP
Core Problem
Each ad platform claims credit independently, causing duplicate conversion credit and wasted budget.
What This Server Provides
This folder contains a production-minded MCP server scaffold with typed JSON tool responses, connector health metadata, OAuth-oriented configuration, rate-limit guards, stable error envelopes, and deterministic demo data until live vendor integrations are attached.
This server has received a production pass. It now includes local attribution intelligence models for cross-platform spend, platform-reported revenue, deduplicated revenue truth, Shopify revenue truth, marginal ROAS, budget allocation, cohort ROAS, and campaign anomaly detection.
Connectors
- Google Ads API via OAuth scope
adwords.readonly; env prefixGOOGLE_ADS - Meta Marketing API via OAuth scope
ads_read; env prefixMETA_MARKETING - TikTok Ads API via OAuth scope
advertiser.read; env prefixTIKTOK_ADS - LinkedIn Campaign Manager API via OAuth scope
r_ads; env prefixLINKEDIN_ADS - Klaviyo API via OAuth scope
campaigns:read; env prefixKLAVIYO - Shopify Admin API via OAuth scope
read_orders; env prefixSHOPIFY - Pinterest Ads API via OAuth scope
ads:read; env prefixPINTEREST_ADS
MCP Tools
get_cross_platform_summary- Summarize spend, attributed revenue, true revenue, and duplication risk across platforms.get_true_roas- Compare platform-reported ROAS against deduplicated revenue truth.get_budget_recommendation- Recommend budget shifts using marginal ROAS and confidence.get_new_vs_returning_roas- Split acquisition quality by new and returning customers.detect_campaign_anomalies- Detect spend spikes, CPA jumps, conversion drops, and tracking outages.
Current Local Capabilities
- Compares platform-reported revenue against deduplicated true revenue.
- Calculates reported ROAS, true ROAS, overclaim amount, and overclaim rate.
- Recommends budget allocation by profit, acquisition, or scale goals.
- Splits ROAS by new versus returning customer revenue.
- Detects CPA jumps, spend spikes, conversion-rate drops, and tracking anomalies.
- Returns stable errors for unknown platforms, invalid goals, bad budgets, and invalid lookback windows.
Test
python -m pytest .\tests -q -p no:cacheprovider
Partial Platform Support
Customers only need to connect the ad platforms they actually use. Missing Google Ads, Meta, TikTok, LinkedIn, Klaviyo, Shopify, or Pinterest credentials do not prevent the server from starting or running local intelligence tools.
Use get_live_connector_status to see configured connectors. Use test_meta_marketing_connection and test_google_ads_connection for read-only live smoke checks when those platforms are connected.
Running Locally
powershell python -m venv .venv .\.venv\Scripts\pip install -e . .\.venv\Scripts\python -m unified_ad_intelligence_mcp.server
Claude Desktop Config
json { "mcpServers": { "unified-ad-intelligence": { "command": "python", "args": ["-m", "unified_ad_intelligence_mcp.server"], "cwd": "D:\CUSTOMS\EARNALL\MCP Servers\01-unified-ad-intelligence" } } }
Production Checklist
- Create OAuth 2.1 apps for each connector and set *_CLIENT_ID plus *_CLIENT_SECRET.
- Store refresh tokens in a secrets manager, never in repo files.
- Replace deterministic demo rows in server.py with API adapter calls.
- Persist raw snapshots and normalized warehouse tables for trend analysis.
- Add integration tests with recorded fixtures for every connector.
- Validate every tool in MCP Inspector before publishing.
- Deploy with a /health route through FastMCP streamable HTTP on Railway or Render.
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 unified_ad_intelligence_mcp-0.1.1.tar.gz.
File metadata
- Download URL: unified_ad_intelligence_mcp-0.1.1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af6d9b375afe28c8be74033a253bcdce7e06894dc43396f20ad44f7ca3e97ed5
|
|
| MD5 |
484ae4bfa5b225f88c74aa5a9e805646
|
|
| BLAKE2b-256 |
34ddeb7a53f3be1b99692ddf310ab9de5d9a615c5903de43d4a93d3de710d18e
|
File details
Details for the file unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58e16aa3754e606c244e4f72cfc13250302c313515d2d9b6a4c51056e7847208
|
|
| MD5 |
ed342432ff50a3d5f1a769691c44f3d3
|
|
| BLAKE2b-256 |
6b887151125c49471c0d90b7fd4797914c34a827f988166e3afff06fcd193100
|