admob-mcp
Provides tools for reading and writing AdMob data, including accounts, apps, ad units, mediation groups, ad sources, and reports (network, mediation, campaign). Write operations require confirmation and support dry-run.
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 list my AdMob accounts"
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 Model Context Protocol (MCP) server for the Google AdMob API. It gives MCP clients such as Claude Code, Cursor, Codex, and other agents a set of typed tools for reading AdMob accounts, apps, ad units, mediation settings, and reports, plus write tools for the operations the AdMob API supports. Reads run freely; every write requires your confirmation.
This project is API first. It only exposes operations that the official AdMob API actually supports, and it clearly documents the surfaces that AdMob keeps in the UI with no API.
Status
Version 0.1.0. Local stdio server with desktop OAuth. Not yet published to npm.
Related MCP server: MCP Search Analytics Server
What it can do
Everything here is backed by the official AdMob API (admob.googleapis.com).
Read tools (safe, run without confirmation)
Tool | Purpose |
| List the signed-in AdMob publisher account. |
| Get one account (publisher id, time zone, currency). |
| List apps under an account. |
| List ad units under an account. |
| List mediation ad sources. |
| List the adapters for one ad source. |
| List ad unit mappings for one ad unit. |
| List mediation groups (supports a filter). |
| Generate an AdMob Network report. |
| Generate an AdMob Mediation report. |
| Generate an AdMob campaign report (v1beta). |
Write tools (require confirmation, support dry run)
Tool | Purpose |
| Create an app. |
| Create an ad unit. |
| Map an ad unit to a mediation adapter. |
| Create up to 100 ad unit mappings at once. |
| Create a mediation group. |
| Update a mediation group (patch with update mask). |
| Start a mediation A/B experiment. |
| Stop a mediation A/B experiment and pick a variant. |
All write tools are AdMob API v1beta methods. Google gates these behind allowlisted access, so a write may return a 403 until your AdMob account is granted access by your account manager. The server turns that 403 into a clear message.
Not supported (no AdMob API)
These AdMob surfaces have no public API, so this server does not implement them. It does not use browser automation. Use the AdMob web UI for:
app-ads.txt diagnostics, blocking controls, privacy and messaging (UMP consent messages), policy center, test devices, crawler access, change history, AdMob Labs, payments and payouts, users and roles, linked services (Firebase, Ad Manager, Analytics), app verification, and account cancellation.
Read the admob://capabilities resource for the machine-readable version of this map.
Safety model
The safety boundary is the same idea as your client asking permission before it runs a command.
Read tools are annotated
readOnlyHint, so clients can run them without a prompt.Write tools are annotated
destructiveHintand carry the Claude CoderequiresUserInteractionhint, which forces an approval prompt on every call and cannot be bypassed by auto accept modes. Other clients prompt on destructive tools as well.Every write tool accepts
dryRun: true, which returns the exact request that would be sent without executing it.Set
ADMOB_READONLY=1to disable all write tools. They are then not registered at all.
Requirements
Node.js 18 or newer.
A Google account with an AdMob account.
A Google Cloud project with the AdMob API enabled and an OAuth client.
Setup
1. Enable the AdMob API and create an OAuth client
In the Google Cloud console, enable the AdMob API for your project.
Configure the OAuth consent screen. For personal use, set the user type to External, keep the publishing status in Testing, and add your Google account as a test user. Note that in Testing mode refresh tokens expire after 7 days; publish the app for long lived tokens.
Create an OAuth client of type Desktop app. Note the client id and client secret.
The AdMob scopes are sensitive, not restricted. A published multi user app needs Google sensitive scope verification, but there is no annual security assessment for these scopes.
2. Install
Until this package is published to npm, clone and build it:
git clone https://github.com/jerry2247/admob-mcp.git
cd admob-mcp
npm install
npm run build3. Authenticate
Provide your OAuth client in the environment and run the auth command. It opens a browser using a loopback redirect with PKCE and stores a refresh token.
export GOOGLE_CLIENT_ID="your-client-id"
export GOOGLE_CLIENT_SECRET="your-client-secret"
node dist/index.js authThe refresh token is saved to ~/.config/admob-mcp/credentials.json with 0600 permissions. Run node dist/index.js logout to remove it.
4. Configure your MCP client
For Claude Code, add a project .mcp.json (see examples/mcp.json):
{
"mcpServers": {
"admob": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/admob-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "${GOOGLE_CLIENT_ID}",
"GOOGLE_CLIENT_SECRET": "${GOOGLE_CLIENT_SECRET}"
}
}
}
}The ${VAR} values are expanded by Claude Code from your shell environment, so no secret is committed. Credentials from admob-mcp auth are read from the stored file, so you do not need to pass a refresh token. To run read only, add "ADMOB_READONLY": "1" to env. To fix the default account, add "ADMOB_PUBLISHER_ID": "pub-1234567890123456".
The same server works in other clients. Cursor and VS Code use the same mcpServers shape. Codex uses TOML, for example:
[mcp_servers.admob]
command = "node"
args = ["/absolute/path/to/admob-mcp/dist/index.js"]
[mcp_servers.admob.env]
GOOGLE_CLIENT_ID = "your-client-id"
GOOGLE_CLIENT_SECRET = "your-client-secret"Resources and prompts
Resources:
admob://capabilities- what is API backed versus UI only or human only.admob://enums/reports- allowed dimensions and metrics for each report type.admob://account- the current account summary.
Prompts:
admob_revenue_review- guide a revenue review over a date range using the network and mediation reports.admob_setup_check- verify credentials and summarize available capabilities.
Reporting
Report tools take a date range (YYYY-MM-DD), a list of dimensions, and one or more metrics. The allowed values differ per report type and are listed in each tool description and in the admob://enums/reports resource. Network and mediation reports are generated as a stream and normalized into rows. The campaign report is v1beta only and limited to a 30 day range. Tool results include a row count and a capped set of rows to keep output small; raise limit to include more.
Environment variables
Variable | Purpose |
| OAuth client id. Required. |
| OAuth client secret. Optional for Desktop clients but usually set. |
| Refresh token supplied directly, skipping the stored file. |
| Default account, for example |
| Set to |
| Override the stored credentials file path. |
|
|
Security notes
Secrets are read from the environment. The
.mcp.jsonexample keeps them out of version control with${VAR}expansion.The only secret stored at rest is the OAuth refresh token, written with 0600 permissions outside the repository.
The server writes only JSON-RPC to stdout. All logs go to stderr.
The server requests least privilege scopes:
admob.readonlyonly, plusadmob.monetizationwhen writes are enabled.
Development
npm run build # compile TypeScript to dist
npm run typecheck # type check without emitting
npm test # build then run the vitest suite
npm run format # format with prettier
npm run inspector # build then open the MCP Inspector against the serverTests are fully mocked and do not call the AdMob API.
Known limitations and roadmap
v1 of the AdMob API is read only. All writes are v1beta and allowlisted, so writes may return 403 until Google grants your account access.
No hosted HTTP transport yet. v0.1 is local stdio only.
No OS keychain storage yet. The refresh token is stored in a 0600 file.
No browser or UI fallback for the surfaces that have no API.
License
MIT. See LICENSE.
Available Tools
19 toolsadmob_batch_create_ad_unit_mappingsBatch create ad unit mappingsADestructive
Create up to 100 ad unit mappings in one call (v1beta, allowlisted). Each mapping targets an ad unit under the same account.
Inputs: mappings (required), dryRun, publisherId.
admob_create_ab_experimentCreate mediation A/B experimentADestructive
Start an A/B experiment on a mediation group (v1beta, allowlisted). Control lines are inherited from the group automatically; you supply the treatment lines and the treatment traffic percentage. Only one experiment can run per group at a time; monitor it via admob_list_mediation_groups.
Inputs: displayName (required), mediationGroupId (required), treatmentMediationLines (required), treatmentTrafficPercentage (required), +2 more.
admob_create_ad_unitCreate AdMob ad unitADestructive
Create a new ad unit under an app (v1beta). This method is allowlisted by Google: a 403 means your account is not yet granted access. Use dryRun to preview the request.
Inputs: appId (required), adFormat (required), displayName (required), dryRun, +4 more.
admob_create_ad_unit_mappingCreate ad unit mappingADestructive
Create an ad unit mapping that connects one ad unit to a mediation adapter (v1beta, allowlisted). adapterId comes from admob_list_adapters; adUnitConfigurations keys are adapterConfigMetadataId values.
Inputs: adUnitId (required), adapterId (required), dryRun, displayName, +2 more.
admob_create_appCreate AdMob appADestructive
Create a new app under an AdMob account (v1beta). This method is allowlisted by Google: if you get a 403, your account is not yet granted access. Use dryRun to preview the request.
Inputs: platform (required), displayName (required), dryRun, appStoreId, +1 more.
admob_create_mediation_groupCreate mediation groupADestructive
Create a mediation group (v1beta, allowlisted). targeting and mediationGroupLines follow the AdMob MediationGroup schema; supply them as objects.
Inputs: displayName (required), state, dryRun, targeting, +2 more.
admob_get_accountGet AdMob accountARead-only
Get details for one AdMob publisher account (publisher id, reporting time zone, currency code).
Inputs: publisherId.
admob_list_accountsList AdMob accountsBRead-only
List the AdMob publisher account for the signed-in credentials. The AdMob API returns only the account that was most recently signed in to from the AdMob UI.
Inputs: pageSize, pageToken.
admob_list_adaptersList ad source adaptersARead-only
List the adapters for one ad source. An adapter is a platform-specific SDK implementation; its adapterId and adapterConfigMetadata are needed to create ad unit mappings.
Inputs: adSourceId (required), pageSize, pageToken, publisherId.
admob_list_ad_sourcesList AdMob ad sourcesBRead-only
List the mediation ad sources available to the AdMob account (each has an ad source id and title).
Inputs: pageSize, pageToken, publisherId.
admob_list_ad_unit_mappingsList ad unit mappingsCRead-only
List the ad unit mappings under one ad unit.
Inputs: adUnitId (required), all, pageSize, pageToken, +1 more.
admob_list_ad_unitsList AdMob ad unitsBRead-only
List the ad units under an AdMob account, including ad unit id, parent app id, format, and ad types.
Inputs: all, pageSize, pageToken, publisherId.
admob_list_appsList AdMob appsARead-only
List the apps under an AdMob account, including app id, platform, and approval state. Set all=true to page through every app (capped for output size).
Inputs: all, pageSize, pageToken, publisherId.
admob_list_mediation_groupsList mediation groupsARead-only
List the mediation groups under an AdMob account. Supports an optional EBNF filter expression (fields such as DISPLAY_NAME, STATE, PLATFORM, FORMAT combined with AND).
Inputs: all, filter, pageSize, pageToken, +1 more.
admob_run_campaign_reportRun AdMob campaign reportARead-only
Generate an AdMob campaign (App Campaigns) report. v1beta only. The date range is limited to 30 days and the response is a single set of rows (no streaming).
Inputs: endDate (required), metrics (required), startDate (required), limit, +3 more.
admob_run_mediation_reportRun AdMob mediation reportARead-only
Generate an AdMob Mediation report (earnings and performance across mediated ad sources). Provide a date range, dimensions to group by, and one or more metrics.
Inputs: endDate (required), metrics (required), startDate (required), limit, +6 more.
admob_run_network_reportRun AdMob network reportARead-only
Generate an AdMob Network report (first-party network earnings and performance). Provide a date range, dimensions to group by, and one or more metrics.
Inputs: endDate (required), metrics (required), startDate (required), limit, +6 more.
admob_stop_ab_experimentStop mediation A/B experimentADestructive
Stop the running A/B experiment on a mediation group and pick the winning variant (v1beta, allowlisted). VARIANT_CHOICE_A keeps the original serving lines; VARIANT_CHOICE_B adopts the newly added lines.
Inputs: variantChoice (required), mediationGroupId (required), dryRun, publisherId.
admob_update_mediation_groupUpdate mediation groupADestructiveIdempotent
Update a mediation group (v1beta patch, allowlisted). updateMask is required and selects which fields change; repeated fields are fully replaced. See the AdMob docs for supported field mask paths.
Inputs: updateMask (required), mediationGroup (required), mediationGroupId (required), dryRun, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Tools are generally distinct with clear actions targeting different entities, but the pair of create_ad_unit_mapping and batch_create_ad_unit_mappings overlap in purpose, causing minor ambiguity.
All tools follow a consistent 'admob_verb_noun' pattern in snake_case, with verbs like list, create, update, run, stop, and get, making the set highly predictable.
With 19 tools covering account, app, ad unit, mediation group, and reporting operations, the count is well-scoped for an AdMob management server, not too many or too few.
The set lacks delete operations for apps, ad units, and mediation groups, and missing updates for apps and ad units, leaving significant gaps that could hinder typical workflows.
Maintenance
Related MCP Connectors
Google Ads MCP server — manage campaigns, keywords, and metrics.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Model Context Protocol server for Studex tools, notifications, and profile integrations
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides seamless integration with Google Workspace, allowing operations with Google Drive, Docs, and Sheets through secure OAuth2 authentication.845 PyPI3MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides unified access to Google Analytics 4 and Google Search Console data through real-time analytics queries.2MIT
- AlicenseNot gradedqualityDmaintenanceExposes the Google AdMob API as MCP tools for managing AdMob accounts, generating network and mediation reports, and listing apps and ad units.99 npm3Apache 2.0
- AlicenseAqualityCmaintenanceA Model Context Protocol server for Google Analytics 4 with both read and write access, enabling natural language reporting, configuration management, audience creation, and server-side event sending via Google credentials.19MIT