admob-mcp
Provides read-only access to Google AdMob reporting data, including accounts, apps, ad units, ad sources, network/mediation/campaign reports, earnings summaries, period comparisons, and anomaly detection.
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., "@admob-mcp why did my AdMob revenue drop yesterday?"
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.
admob-mcp
A read-only Model Context Protocol server for Google AdMob. It lets Claude Code, Claude Desktop, Cursor, VS Code or any MCP client pull your AdMob data and analyze it with you:
revenue, eCPM, fill and CTR, broken down by app, ad unit, country, format, platform or version;
mediation performance per ad network;
period-over-period drivers;
anomaly detection.
"Why did revenue drop yesterday?" →
compare_periodsanddetect_anomaliesshow that Puzzle Quest lost 48% of earnings, almost all of it volume (impressions −47%), not price (eCPM flat).
Why this server
Read-only by design. It requests only the
admob.readonlyandadmob.reportscopes, and every tool is annotatedreadOnlyHint.Your credentials, your machine. It uses your own OAuth client. The token is stored locally with
0600permissions. There is no telemetry, and the only network calls go to Google.Small and auditable. Runtime dependencies are the official MCP SDK,
zodand Google'sgoogle-auth-library. AdMob REST calls are a ~150-linefetchclient.Built for agents:
human units (no micros);
date presets in the account time zone;
request validation with precise errors before calling the API;
correct totals for ratio metrics;
compact tables plus typed
structuredContent;CSV export for big reports.
Analytics, not just endpoints: one-call earnings summary, period comparison ranked by contribution, and transparent anomaly detection.
Related MCP server: ga-gsc-analytics
Quick start
Set up with an AI agent
Copy this prompt and paste it into any AI coding agent (Claude Code, Cursor, Antigravity, VS Code Copilot, Codex, etc.) to have it guide you through installation, Google Cloud OAuth setup, verification, and client configuration:
Help me set up and connect the `admob-mcp` read-only Google AdMob MCP server on my machine.
Repo: https://github.com/oleksandrtry/admob-mcp
Docs: docs/setup-google-cloud.md and docs/troubleshooting.md
Follow these steps and check my environment before asking me to do anything manual:
1. Check Node.js (`node -v`, requires >= 20). Install `admob-mcp` from GitHub if not already installed:
- If we are inside a local clone of `admob-mcp`, run `npm install && npm run build` (optionally `npm link`) and use `node <ABS_PATH>/dist/index.js`.
- Otherwise, install globally from GitHub (`npm install -g github:oleksandrtry/admob-mcp`) so `admob-mcp` is available on PATH, or clone the repo into a folder and build it.
2. Run `<cmd> doctor` first to see if valid AdMob credentials already exist.
3. If not authenticated yet, never ask me to paste secrets or JSON files into chat. Instead:
- On macOS/Linux/WSL with a local clone, offer to run `./scripts/setup-google-cloud.sh`, OR walk me step-by-step through `docs/setup-google-cloud.md`:
a) Create/select a Google Cloud project and enable `admob.googleapis.com`.
b) Configure OAuth consent screen (External), add read-only scopes `https://www.googleapis.com/auth/admob.readonly` and `https://www.googleapis.com/auth/admob.report`, and click **Publish app** ("In production") so the refresh token does not expire after 7 days.
c) Create a **Desktop app** OAuth client and download the JSON (for example to `~/.config/admob-mcp/client_secret.json`).
- Then run `<cmd> auth --client-secret <path-to-client_secret.json>` and tell me when to complete sign-in in the browser (note: for an unverified personal app, click Advanced -> Go to app (unsafe) and tick both AdMob scopes).
4. Run `<cmd> doctor` to confirm credentials, access token, and AdMob account ID(s).
5. Configure the MCP server in the MCP client I am currently using (or ask which client I want if unclear), using `admob-mcp` (if installed globally) or `node <ABS_PATH>/dist/index.js` (if built from a clone), and setting `ADMOB_ACCOUNT_ID` if `doctor` lists multiple accounts.
6. Tell me when to reload/restart the client and offer to test the connection with `list_accounts` or `get_earnings_summary`.Manual setup
1. Install from GitHub. Needs Node.js ≥ 20.
Either install globally from GitHub:
npm install -g github:oleksandrtry/admob-mcpOr clone the repo and build locally (this also gives you the interactive setup wizard):
git clone https://github.com/oleksandrtry/admob-mcp.git
cd admob-mcp
npm install && npm run build
# Optional: make `admob-mcp` available globally
npm link2. Create a Google OAuth client and sign in (once, ~10 min).
Guided script (macOS / Linux / WSL): run
./scripts/setup-google-cloud.shfrom a cloned repo — it walks you through Google Cloud, runsauthanddoctor, and can register the server in Claude Code.Or manually: follow docs/setup-google-cloud.md (create a project, enable the AdMob API, publish the consent screen, download a Desktop app OAuth JSON), then run:
admob-mcp auth --client-secret ./client_secret.json
admob-mcp doctor(Without global install/npm link, use node dist/index.js instead of admob-mcp.)
3. Connect your client.
The examples below assume
admob-mcpis installed globally (npm install -g github:oleksandrtry/admob-mcpornpm link). If you built from a clone without linking, use"command": "node", "args": ["/absolute/path/to/admob-mcp/dist/index.js"](ornode /absolute/path/to/admob-mcp/dist/index.jsinclaude mcp add). Withnvm, prefer the absolute path toadmob-mcpornode.
claude mcp add admob --scope user -- admob-mcpWith several AdMob accounts, set a default:
claude mcp add admob --scope user --env ADMOB_ACCOUNT_ID=pub-1234567890123456 -- admob-mcpAdd this to claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"admob": {
"command": "admob-mcp"
}
}
}Add this to ~/.cursor/mcp.json:
{
"mcpServers": {
"admob": { "command": "admob-mcp" }
}
}Add this to .vscode/mcp.json, or run MCP: Add Server:
{
"servers": {
"admob": { "type": "stdio", "command": "admob-mcp" }
}
}Any stdio MCP client works. Run admob-mcp (or node /absolute/path/to/admob-mcp/dist/index.js), with optional environment variables from the configuration table.
Then ask things like:
"How did my apps do last week?"
"Compare this month with the same period last year by country."
"Did anything break in the last 3 days?"
"Which mediation network has the best eCPM for interstitials?"
"Export daily earnings per ad unit for September to september.csv."
Tools
Tool | Purpose |
| Publisher accounts, currency, time zone |
| Apps with IDs, platform, store ID, approval state |
| Ad units with IDs, app, format |
| Mediation ad sources (networks) |
| Flexible AdMob Network report: any dimensions, metrics, filters, sort, CSV export |
| Mediation report by ad source, instance, mediation group… |
| House-ad / cross-promo campaign report (≤ 30 days) |
| KPIs, daily trend and top contributors in one call |
| Period vs baseline, groups ranked by contribution to the change, volume vs price |
| Recent days vs baseline median, flags drops and spikes per app, country… |
Prompts (slash commands in Claude Code: /mcp__admob__…): weekly_revenue_review, investigate_revenue_drop, mediation_performance_audit, country_breakdown.
See docs/tools.md for parameters, units and the exact anomaly method.
Configuration
Variable | Purpose |
| Default publisher ID ( |
| Default report currency (ISO 4217), e.g. |
| Use these instead of the saved credentials file (CI, containers) |
| Directory holding |
Credentials are looked up in this order:
The environment variables above.
credentials.json.Google Application Default Credentials.
CLI
admob-mcp Start the MCP server on stdio
admob-mcp auth Sign in with Google (--client-secret <file>, --no-browser)
admob-mcp doctor Check credentials and API access
admob-mcp logout Delete saved credentialsSecurity and privacy
Scopes:
admob.readonlyandadmob.reportonly. The server cannot change apps, ad units or mediation, and it never touches payments.Local token storage: the refresh token lives in
credentials.json(mode0600, directory0700) in Google'sauthorized_userformat.No telemetry: the server makes no network calls other than
oauth2.googleapis.comandadmob.googleapis.com.File writes: the server writes files only when you ask a report tool for
save_csv_path.Revoking access: run
admob-mcp logout, then remove the app at https://myaccount.google.com/permissions.
Troubleshooting
See docs/troubleshooting.md. Most issues are an expired Testing-mode token (publish the consent screen) or the AdMob API not being enabled in the client's project.
Development
The project needs Node.js ≥ 20.
npm install
npm run build # compile to dist/
npm test # unit tests (vitest)
npm run typecheck
npm run lintRun your local build in Claude Code:
claude mcp add admob-dev --scope user -- node /absolute/path/to/admob-mcp/dist/index.jsYou can also inspect it with the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.jsLicense
Not affiliated with Google. AdMob is a trademark of Google LLC.
Available Tools
10 toolscompare_periodsCompare two periodsARead-onlyIdempotent
Compares AdMob Network KPIs between a period and a baseline (previous period, same period last year, or custom), overall and per app / ad unit / country / format / platform / version. Rows are ranked by their absolute contribution to the change, and show whether it came from volume (impressions) or price (eCPM). Use for 'why did revenue change?'.
Inputs: top_n, rank_by, baseline, dimension, +4 more. Returns: groups, current, baseline, currency, +3 more
detect_anomaliesDetect anomaliesARead-onlyIdempotent
Finds apps / ad units / countries / formats / platforms whose recent daily performance deviates sharply from their own baseline. Method: mean of the last recent_days days vs the MEDIAN daily value of the preceding baseline_days days; flagged when the change is at least threshold_pct. Low-volume groups are skipped. Today is excluded by default because its data is incomplete.
Inputs: metric, dimension, direction, account_id, +5 more. Returns: total, metric, recent, baseline, +6 more
get_earnings_summaryEarnings summaryARead-onlyIdempotent
One-call overview of AdMob Network performance for a period: KPI totals (earnings, impressions, eCPM, requests, match rate, show rate, CTR), a daily (or weekly, for ranges over 35 days) trend, and the top contributors by app, ad unit, country, format or platform. Best starting point for 'how are we doing?' questions.
Inputs: top_n, group_by, account_id, date_range. Returns: top, trend, others, totals, +5 more
list_accountsList AdMob accountsARead-onlyIdempotent
Lists the AdMob publisher accounts the signed-in Google user can access, with their currency and reporting time zone. Call this first if you are unsure which account_id to use.
Inputs: no named parameters. Returns: accounts
list_ad_sourcesList mediation ad sourcesARead-onlyIdempotent
Lists the mediation ad sources (ad networks) available to the account, e.g. AdMob Network, Meta Audience Network. IDs match the AD_SOURCE dimension of mediation reports.
Inputs: account_id. Returns: account_id, ad_sources
list_ad_unitsList ad unitsARead-onlyIdempotent
Lists ad units (ca-app-pub-…/…) with their app and format. Ad unit IDs can be used as AD_UNIT filter values in reports.
Inputs: app_id, format, account_id. Returns: ad_units, account_id
list_appsList appsARead-onlyIdempotent
Lists apps in an AdMob account with their app IDs (ca-app-pub-…~…), platform, store ID and approval state. App IDs can be used as APP filter values in reports.
Inputs: search, platform, account_id. Returns: apps, account_id
run_campaign_reportAdMob Campaign reportARead-onlyIdempotent
Runs an AdMob Campaign report for house-ad / cross-promotion campaigns (impressions, clicks, installs, cost). Date range is limited to 30 days. Filtering and sorting are applied after fetching.
Inputs: sort, filters, metrics, max_rows, +5 more. Returns: rows, report, totals, csv_path, +8 more
run_mediation_reportAdMob Mediation reportARead-onlyIdempotent
Runs an AdMob Mediation report: performance per ad source (network), ad source instance and mediation group, alongside app / ad unit / country breakdowns. Use to compare networks in your waterfall/bidding setup. OBSERVED_ECPM is the third-party network's estimated eCPM.
Inputs: sort, filters, metrics, currency, +6 more. Returns: rows, report, totals, csv_path, +8 more
run_network_reportAdMob Network reportARead-onlyIdempotent
Runs an AdMob Network report: earnings and performance of ads served by the AdMob Network, broken down by any dimensions (date, app, ad unit, country, format, platform, versions…). Use for most revenue questions. Money is in currency units (not micros); eCPM = IMPRESSION_RPM.
Inputs: sort, filters, metrics, currency, +6 more. Returns: rows, report, totals, csv_path, +8 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
The four list_* tools target clearly separate resources, and the three run_*_report tools map to distinct report types (network, mediation, campaign). The only real overlap is get_earnings_summary versus run_network_report, which both cover AdMob Network performance, though the descriptions differentiate them as a quick overview versus a customizable breakdown.
All ten tools follow a consistent snake_case verb_noun pattern (list_accounts, run_network_report, get_earnings_summary, compare_periods, detect_anomalies). The verbs are meaningful and predictably paired with the resource or operation they act on.
Ten tools is well within the ideal range and each one earns its place: four discovery/list tools, three report runners, and three analysis helpers. Nothing appears redundant or padding.
The reporting surface is thorough, covering network, mediation, and campaign reports plus summary, comparison, and anomaly detection. Minor gaps exist: there is no listing of mediation groups or ad source instances, and no per-app or per-ad-unit detail lookup beyond the bulk list tools.
Related MCP Connectors
Read-only MCP access to your DEXUN AdWhiz account: ad accounts, AI recommendations, savings.
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
Read-only Search Console analytics, URL inspection, indexing diagnostics, and sitemaps.
Read-only website traffic, conversions, revenue, funnels and performance analytics.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides read-only access to Google Ads account data including campaigns, ad groups, keywords, and performance reports. Enables querying via GAQL through an MCP interface.MIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only access to Google Analytics 4 and Google Search Console data, allowing users to run reports, query search analytics, and generate combined snapshots for reporting.-
- AlicenseNot gradedqualityBmaintenanceEnables read-only inspection of Google Ads accounts through MCP, including account inventory, reporting, metadata, change history, and safe GAQL queries.Apache 2.0
- AlicenseAqualityCmaintenanceEnables read-only access to Google Ads data through GAQL queries, resource exploration, recommendations, keyword planning and forecasts, and change history across manager and customer accounts.1128 PyPIMIT