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.
Metadata
Release files for unified-ad-intelligence-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unified_ad_intelligence_mcp-0.1.1.tar.gz | 18.3 kB | Without provenance | Details for unified_ad_intelligence_mcp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl |
Total release size: 36.7 kB
Release files / unified_ad_intelligence_mcp-0.1.1.tar.gz
| Download URL | unified_ad_intelligence_mcp-0.1.1.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af6d9b375afe28c8be74033a253bcdce7e06894dc43396f20ad44f7ca3e97ed5
|
|
BLAKE2b-256 checksum How to use checksums |
34ddeb7a53f3be1b99692ddf310ab9de5d9a615c5903de43d4a93d3de710d18e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl
| Download URL | unified_ad_intelligence_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58e16aa3754e606c244e4f72cfc13250302c313515d2d9b6a4c51056e7847208
|
|
BLAKE2b-256 checksum How to use checksums |
6b887151125c49471c0d90b7fd4797914c34a827f988166e3afff06fcd193100
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for unified-ad-intelligence-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.