admob-mcp-server
The AdMob MCP server enables AI assistants to query and manage your Google AdMob account. It supports:
Account & App Management: List and retrieve account details (publisher ID, currency, time zone); list registered apps with platform, store link, and approval state; list ad units with IDs and formats. Write operations (create apps/ad units) are available but may require extra scopes.
Reporting & Analytics: Generate network, mediation, and campaign reports with flexible date ranges, dimensions, filters, sorting, and currency conversion. Metrics include earnings, impressions, clicks, match rate, RPM, and more. Reports are flattened into user-friendly tables.
Mediation Management: List ad sources and adapters; manage mediation groups (list, create, update) and ad unit mappings (list, create) for third-party network integrations.
A/B Experimentation: Create and stop mediation A/B experiments with configurable traffic splits.
While the README emphasizes read-only access, the full schema includes write operations that require the admob.monetization scope.
Provides tools for managing Google AdMob accounts, apps, ad units, reports, and mediation, allowing querying of earnings, creating ad units, and comparing performance metrics.
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-server How much did my apps earn in the last 7 days?"
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 Server
English | 한국어
Ask your AI assistant about your AdMob apps and earnings — in plain language:
"How much did my apps earn in the last 7 days, broken down by country?"
"Which mediation ad source had the best eCPM this month?"
"Compare the RPM of my banner vs. rewarded ad units."
"List my apps and their ad units."

This is a Model Context Protocol (MCP) server for the Google AdMob API.
It works with Claude Code, Claude Desktop, Cursor, Gemini CLI, and any other MCP-capable AI client.
Architecture
flowchart LR
C["MCP client<br/>Claude Code · Claude Desktop · Cursor · Gemini CLI"]
subgraph S["admob-mcp-server — runs on your machine"]
direction TB
T["9 read-only tools in 5 toolsets<br/>accounts · apps · adunits · reports · mediation<br/>(filtered by --toolsets)"]
A["Credential resolver<br/>env vars → token.json → gcloud ADC"]
R["Report flattener<br/>chunk stream → rows · micros → currency"]
end
G["Google AdMob API<br/>v1beta"]
C <-->|"MCP over stdio"| T
T --> A
A <-->|"OAuth 2.0 / HTTPS"| G
G -.->|"report chunks"| R
R -.-> TCredentials and revenue data travel only between your machine and Google — there is no third-party server in between.
Related MCP server: Google Analytics 4 MCP Server
Features
Everything the AdMob API opens to normal accounts — 9 tools across accounts, apps, ad units, reports, and mediation (why there are no write tools)
Reports made readable — streaming report responses are flattened into simple row tables, and monetary values (micros) are converted to real currency units
Read-only by design — the sign-in requests read scopes only, so the server cannot change anything in your AdMob account
Toolsets — enable only the tool groups you need, e.g.
--toolsets reports,accountsThree authentication options — one-command browser sign-in (
npx admob-mcp-server auth), environment-variable refresh token, or gcloud Application Default CredentialsBuilt-in analysis prompts and report-spec reference resources
Setup at a glance
One-time setup, roughly 10 minutes:
Step | What you do | Where |
Register a personal "app" so Google lets you access your own data | browser | |
Run one command and log in with Google | terminal | |
Add one config entry and restart the client | terminal |
Requirements
Node.js 18 or newer — check with
node --version; if missing, install from nodejs.orgAn AdMob account and the Google account that owns it
Setup
Part 1 — Google Cloud setup
Why is this needed?
The AdMob API has no simple API keys — Google requires every program that accesses your data to be registered as an "OAuth app".
Here you register a personal one that only you will use.
It's free and needs no billing setup.
Create (or select) a Google Cloud project: console.cloud.google.com/projectcreate — any name works; reusing an existing project is fine too.
Enable the AdMob API: console.cloud.google.com/apis/library/admob.googleapis.com → check that your project is selected in the top bar → Enable.
Configure the OAuth consent screen: console.cloud.google.com/auth/overview — the first visit opens a short wizard:
App name: anything (e.g.
admob-mcp), and your email as the support/contact emailAudience: External
Finish the wizard — you do not need to submit the app for Google's verification
Then go to Audience → Test users → Add users and add the Google account that owns your AdMob account
Create an OAuth client: console.cloud.google.com/apis/credentials → Create credentials → OAuth client ID
Application type: Desktop app
After creating it, click Download JSON — you'll use this file in Part 2
While the consent screen is inTesting mode, Google expires sign-ins after 7 days, so you'll need to re-run the sign-in weekly.
To stop that, publish the app (Audience → Publish app).
Publishing for your own use doesn't require Google's verification — you'll just see an "unverified app" warning during sign-in, which is expected.
Part 2 — Sign in
Move the JSON file you downloaded to where the server looks for it, then run the sign-in command:
mkdir -p ~/.admob-mcp
mv ~/Downloads/client_secret_*.json ~/.admob-mcp/oauth_client.json
npx admob-mcp-server auth(On Windows, move the file to C:\Users\<you>\.admob-mcp\oauth_client.json in Explorer, then run the npx command.)
Your browser opens.
Pick the Google account that owns your AdMob account and allow access.
If you see a "Google hasn't verified this app" warning, that's your own app from Part 1 — click "Continue".
When the terminal prints Setup complete, your sign-in is saved to ~/.admob-mcp/token.json and reused from then on.
The sign-in requests the admob.readonly and admob.report scopes — read access only.
What the auth command does:
sequenceDiagram
autonumber
participant T as Terminal
participant S as admob-mcp-server
participant B as Browser
participant G as Google
T->>S: npx admob-mcp-server auth
S->>S: read ~/.admob-mcp/oauth_client.json
S->>B: open consent URL (loopback redirect, random port)
B->>G: sign in & allow scopes
G-->>S: authorization code → refresh token
S->>S: save ~/.admob-mcp/token.json (reused for every later call)If you already have a refresh token, no files are needed:
export GOOGLE_CLIENT_ID="....apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="..."
export GOOGLE_REFRESH_TOKEN="..."The same pattern Google's official Analytics/Ads MCP servers use:
gcloud auth application-default login \
--scopes=https://www.googleapis.com/auth/admob.readonly,https://www.googleapis.com/auth/admob.report,https://www.googleapis.com/auth/cloud-platform \
--client-id-file=path/to/oauth_client.jsonCredential resolution order: environment variables → token.json (from auth) → ADC.
Part 3 — Connect your AI client
Pick your client below.
MCP servers are loaded when the client starts, so restart the client after adding the config.
Claude Code
claude mcp add admob -- npx -y admob-mcp-serverVerify with claude mcp list — you should see admob: ... - ✔ Connected.
Claude Desktop — open Settings → Developer → Edit Config, which opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\), and add:
{
"mcpServers": {
"admob": {
"command": "npx",
"args": ["-y", "admob-mcp-server"]
}
}
}Restart the app; the admob tools appear in the tools menu of the chat input.
Cursor — add the same mcpServers block to ~/.cursor/mcp.json, then check Settings → MCP shows admob as enabled.
Gemini CLI — add the same mcpServers block to ~/.gemini/settings.json, then check with /mcp inside the CLI.
If you used the environment-variable sign-in, pass the variables through your client'senv block (Claude Code: repeat --env KEY=value before --; JSON configs: add an "env": { ... } object next to "args").
Try it
You don't call tools yourself — just ask in plain language and the assistant picks the right tools.
Some starters:
"What did my apps earn last week?"
"Break down this month's revenue by country and app."
"Which ad format had the highest RPM in the last 30 days?"
"How is my mediation doing? Compare ad sources by observed eCPM."
"List my apps and their ad units."
Most clients ask for your permission before each tool call, so nothing runs without your approval.
Configuration
All configuration is optional — the defaults work for a single AdMob account.
Environment variables
Variable | Description | Default |
| Publisher ID ( | auto-discovered |
| Comma-separated toolsets to enable | all |
| Directory for |
|
| Path to the OAuth client JSON used by |
|
| OAuth client ID (env sign-in; also used by | — |
| OAuth client secret (env sign-in) | — |
| OAuth refresh token (env sign-in) | — |
CLI flags
Flag | Description |
| Same as |
| Same as |
| Same as |
CLI flags take precedence over environment variables.
Flags go after the command in your client config, e.g. npx -y admob-mcp-server --toolsets reports.
Tools
A "tool" is a function the AI assistant can call on your behalf.
Tools are grouped into five toolsets; all are enabled by default:
Toolset | Tools |
|
|
|
|
|
|
|
|
|
|
All tools are read-only and require the admob.readonly / admob.report scopes.
Why there are no write tools
The AdMob API does expose write methods (adUnits.create, apps.create, the whole mediationGroups resource), but Google marks each of them limited access:
This method has limited access. If you see a 403 permission denied error, please reach out to your account manager for access.
A normal publisher account gets PERMISSION_DENIED from all of them even with a valid admob.monetization token — and the same wall blocks mediationGroups.list and adUnitMappings.list, which are reads. Since these tools cannot work without an allowlisted account, they are not shipped: an assistant that sees them will try them and fail. Create ad units and mediation groups in the AdMob console instead.
accounts
Tool | Description |
| List accessible publisher accounts — use to find your |
| Get account details: publisher ID, reporting currency, reporting time zone |
apps
Tool | Description |
| List registered apps with app ID, platform, store link, and approval state |
adunits
Tool | Description |
| List ad units with their IDs, formats, and owning apps |
reports
All report tools take startDate / endDate (YYYY-MM-DD), metrics, and optional dimensions, dimensionFilters, sortConditions, maxReportRows (default 1000), currencyCode.
Responses are flat tables; monetary metrics are converted from micros to currency units.
Tool | Description |
| AdMob Network performance: earnings, impressions, clicks, match rate, RPM, ... |
| Mediation performance across ad sources: earnings, observed eCPM per |
| Cross-promotion campaign stats (last 30 days only): impressions, clicks, installs, cost |
Valid dimensions/metrics per report are exposed as MCP resources (reference documents the assistant can read): admob://reference/network-report-spec, mediation-report-spec, campaign-report-spec.
mediation
Tool | Description |
| List available mediation ad sources (ad networks) and their IDs |
| List adapters of an ad source, incl. required configuration keys |
Mediation groups and ad unit mappings are not covered — see Why there are no write tools.
Prompts
Prompts are ready-made analysis requests.
Your client surfaces them as slash commands or a prompt picker (e.g. /top_performing_apps in Claude Code).
All take an optional days argument:
Prompt | What it does |
| Ranks your apps by revenue with RPM and match-rate context |
| Daily revenue trend with anomaly call-outs |
| Compares earnings and efficiency across ad formats |
Security & privacy
The server runs entirely on your computer.
Your data flows only between your machine and Google's API — never through any third-party server.Two files are stored locally, both readable only by your user account:
~/.admob-mcp/oauth_client.json(your OAuth app) and~/.admob-mcp/token.json(your sign-in).To sign out: delete
~/.admob-mcp/token.json, and optionally revoke the app's access at myaccount.google.com/permissions.Nothing can be modified: the sign-in requests read scopes only, and every tool is a read.
Troubleshooting
Install & connection
command not found: npx / spawn npx ENOENT
Cause: Node.js is not installed, or your client can't find it.
Fix: install Node 18+ from nodejs.org, then restart the client.
The server doesn't appear in the client
Cause: MCP servers load at client startup, or the server fails to start.
Fix: restart the client first.
Then check its MCP status (Claude Code:claude mcp list, Gemini CLI:/mcp), and make surenpx -y admob-mcp-serverruns in a terminal without errors.
Sign-in & auth
"No usable Google credentials found"
Cause: sign-in hasn't been set up yet.
Fix: follow Part 2 — Sign in.
invalid_grant / "token has been expired or revoked"
Cause: your sign-in expired.
With a consent screen in Testing mode this happens every 7 days.Fix: re-run
npx admob-mcp-server auth.
To stop it recurring, publish the app (Audience → Publish app).
access_denied during browser sign-in
Cause: the Google account you picked is not a test user of the consent screen.
Fix: add it under Audience → Test users, or publish the app.
"The publisher could not be authenticated"
Cause: the Google account you signed in with has no active AdMob account.
Fix: re-run
npx admob-mcp-server authand pick the account that owns your AdMob account in the account chooser.
API errors
403 PERMISSION_DENIED
Cause: the AdMob API isn't enabled, the wrong Google account is signed in, or the token predates a scope change.
Fix: check the following:
The AdMob API is enabled in the same project as your OAuth client
You signed in with the account that owns the AdMob account
Your token covers
admob.readonlyandadmob.report— re-runnpx admob-mcp-server authto refresh it
429 RESOURCE_EXHAUSTED
Cause: AdMob API quota hit (usage limits).
Fix: retry later, or reduce the request — narrower date range, fewer dimensions.
"Multiple AdMob accounts found"
Cause: your Google login can access several publisher accounts.
Fix: set
ADMOB_ACCOUNT=pub-...(find IDs withlist_accounts).
Development
git clone https://github.com/ParkSangGwon/admob-mcp-server.git
cd admob-mcp-server
npm install
npm test
npm run build
# debug with the MCP Inspector
npm run inspectTo run a local build in a client, point it at the built entry instead of npx: node /path/to/admob-mcp-server/dist/index.js.
Releases: pushing a v* tag runs CI and publishes to npm with provenance (see .github/workflows/release.yml).
Contributing
Issues and pull requests are welcome.
For larger changes, please open an issue first to discuss the direction.
Make sure npm run lint, npm run format:check, and npm test pass.
License
Available Tools
18 toolscreate_ad_unitCreate AdMob ad unitA
Creates an ad unit under an app in the AdMob account. Requires the admob.monetization scope.
Inputs: appId (required), adFormat (required), displayName (required), adTypes, +1 more.
create_ad_unit_mappingCreate ad unit mappingA
Creates an ad unit mapping that links an AdMob ad unit to a third-party network placement via an adapter. Get the adapter ID and required configuration keys from list_adapters. Requires the admob.monetization scope.
Inputs: adUnitId (required), adapterId (required), adUnitConfigurations (required), displayName.
create_appCreate AdMob appA
Creates an app in the AdMob account. Provide appStoreId to link a published store listing, or displayName to register an unpublished app manually. Requires the admob.monetization scope.
Inputs: platform (required), appStoreId, displayName.
create_mediation_ab_experimentCreate mediation A/B experimentA
Creates an A/B experiment on a mediation group: the treatment variant serves the given mediation lines against the existing setup. Requires the admob.monetization scope.
Inputs: displayName (required), mediationGroupId (required), treatmentMediationLines (required), treatmentTrafficPercentage.
create_mediation_groupCreate mediation groupA
Creates a mediation group targeting a format/platform and a set of ad units, with optional mediation lines for third-party ad sources. Requires the admob.monetization scope.
Inputs: format (required), platform (required), adUnitIds (required), displayName (required), +4 more.
generate_campaign_reportGenerate AdMob campaign reportARead-only
Generates a report for AdMob cross-promotion campaigns: impressions, clicks, installs, estimated cost. Date range must be within the last 30 days. Monetary metrics are converted from micros to whole currency units (see currencyCode).
Inputs: endDate (required), metrics (required), startDate (required), dimensions, +1 more.
generate_mediation_reportGenerate AdMob mediation reportARead-only
Generates an AdMob Mediation report across ad sources (waterfall/bidding): impressions, estimated earnings, observed eCPM per AD_SOURCE, MEDIATION_GROUP, and more. Monetary metrics are converted from micros to whole currency units (see currencyCode).
Inputs: endDate (required), metrics (required), startDate (required), dimensions, +4 more.
generate_network_reportGenerate AdMob network reportARead-only
Generates an AdMob Network earnings/performance report (requests, impressions, clicks, estimated earnings, match rate, RPM...). Monetary metrics are converted from micros to whole currency units (see currencyCode).
Inputs: endDate (required), metrics (required), startDate (required), dimensions, +4 more.
get_accountGet AdMob accountARead-only
Gets an AdMob publisher account: publisher ID, reporting currency, and reporting time zone. Defaults to the configured or auto-discovered account.
Inputs: accountId.
list_accountsList AdMob accountsARead-only
Lists the AdMob publisher accounts accessible with the current credentials. Use this to find your publisher ID (pub-XXXXXXXXXXXXXXXX).
Inputs: pageSize, pageToken.
list_adaptersList ad source adaptersARead-only
Lists the adapters of a mediation ad source, including the adapter ID and required ad unit configuration keys (needed for create_ad_unit_mapping).
Inputs: adSourceId (required), pageSize, pageToken.
list_ad_sourcesList ad sourcesARead-only
Lists the mediation ad sources (ad networks) available to the AdMob account, with their ad source IDs.
Inputs: pageSize, pageToken.
list_ad_unit_mappingsList ad unit mappingsARead-only
Lists the ad unit mappings (third-party network placements) attached to an AdMob ad unit.
Inputs: adUnitId (required), pageSize, pageToken.
list_ad_unitsList AdMob ad unitsARead-only
Lists the ad units in the AdMob account, including ad unit ID (ca-app-pub-.../...), format, and the app they belong to.
Inputs: pageSize, pageToken.
list_appsList AdMob appsARead-only
Lists the apps registered in the AdMob account, including app ID (ca-app-pub-...~...), platform, store link state, and approval state.
Inputs: pageSize, pageToken.
list_mediation_groupsList mediation groupsARead-only
Lists the mediation groups in the AdMob account, including targeting (format, platform, ad units) and mediation lines.
Inputs: filter, pageSize, pageToken.
stop_mediation_ab_experimentStop mediation A/B experimentA
Stops the running A/B experiment on a mediation group by choosing the winning variant. Requires the admob.monetization scope.
Inputs: variantChoice (required), mediationGroupId (required).
update_mediation_groupUpdate mediation groupA
Patches a mediation group. Pass the fields to change in mediationGroup and list their paths in updateMask (e.g. "display_name,targeting.ad_unit_ids"). Requires the admob.monetization scope.
Inputs: updateMask (required), mediationGroup (required), mediationGroupId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool targets a distinct resource and action, with clear scope across accounts, apps, ad units, reports, and mediation. The three report generators are clearly differentiated by report type, and the mediation-related listing tools are distinguished by entity (ad sources vs adapters vs mediation groups vs mappings).
All tools follow a consistent snake_case verb_noun pattern (e.g., list_accounts, create_app, generate_network_report, update_mediation_group, stop_mediation_ab_experiment). No mixed conventions or vague verbs exist.
At 18 tools, the set is slightly above the typical well-scoped range of 3-15 but remains coherent for a domain as broad as AdMob, covering account, app, ad unit, reporting, and mediation configuration. Each tool is relevant and none feels redundant.
The surface covers core account/app/ad unit listing and creation, three report types, and mediation configuration. However, there are no update or delete operations for apps, ad units, or ad unit mappings, and no delete for mediation groups, leaving notable lifecycle gaps.
Maintenance
Related MCP Connectors
Interact with your Google Bigtable resources using natural language commands.
Manage Google Ads from ChatGPT, Claude or any MCP client. Sign in with OAuth or use an API key.
Google Ads analysis and operations — read performance, manage keywords, bids, and campaigns.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects Claude to the Google AdMob API to provide a conversational interface for managing and analyzing ad revenue data. It enables users to generate custom network reports, track performance trends, and diagnose revenue fluctuations using natural language.6MIT
- AlicenseBqualityDmaintenanceEnables managing Google Analytics 4 properties, data streams, conversions, and running reports using natural language through the Admin and Data APIs.23MIT
- AlicenseAqualityFmaintenanceEnables managing Google Ads campaigns through an AI assistant with read-only reporting, recommendations, and gated write operations for bids, budgets, and statuses, all backed by preview and audit logging.311MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying Google Analytics data and configuration through natural language using the Data and Admin APIs.Apache 2.0