Skip to main content
Glama
AdMob MCP

AdMob MCP

AdMob MCP — Google AdMob Reporting for AI Clients

6 read-only tools for the Google AdMob API — accounts, apps, ad units, and network/mediation performance reports — for Claude Desktop, Claude Code, and any MCP client.

by Jan Ivan Simoy


Unofficial. This is an independent, community-built project — not affiliated with, endorsed by, or sponsored by Google.

What is this?

AdMob MCP is a Model Context Protocol server that gives AI assistants structured, read-only access to the Google AdMob API — publisher accounts, apps, ad units, and performance reports broken down by whatever dimensions you ask for (date, app, country, ad source, and more).

It deliberately covers only the stable, read-oriented v1 surface. The AdMob API's v1beta also supports creating apps/ad units and managing mediation groups — those touch monetization configuration and billing directly, so they stay a human action in the AdMob UI, not something this server automates.

Supported platform: any MCP client on macOS, Linux, or Windows with Python 3.12+.


Related MCP server: adsense-mcp

Tools

Category

Tools

What you can do

Accounts

2

List accounts accessible to this credential, fetch one by name

Apps & Ad Units

2

List apps and ad units under an account

Reports

2

Generate a network (own ad serving) report, or a mediation (cross ad-source) report, by any combination of dimensions and metrics

Tool

Description

list_accounts

List AdMob publisher accounts accessible to this credential

get_account

Fetch one account's details by name (accounts/pub-...)

list_apps

List apps under an account

list_ad_units

List ad units under an account

generate_network_report

Network performance report — earnings, impressions, clicks, requests, CTR, RPM, match rate, by DATE/APP/COUNTRY/PLATFORM/etc.

generate_mediation_report

Mediation performance report — same metrics broken down by AD_SOURCE / MEDIATION_GROUP as well


Requirements

Requirement

Version

Python

3.12 or later

uv

any recent version

Google Cloud project

with the AdMob API enabled

OAuth client

type "Desktop app" (see below — AdMob does not support service accounts)


Authentication

AdMob does not support service-account credentials — every call must be authorized by a real Google account via OAuth 2.0. Setup:

  1. In Google Cloud Console, create/select a project and enable the AdMob API (APIs & Services → Library).

  2. Configure the OAuth consent screen (user type "External"; "Testing" status with yourself added as a test user is enough for personal use).

  3. Create an OAuth client ID of type Desktop app (APIs & Services → Credentials). Note the client ID and secret.

  4. Run the one-time interactive authorization:

    uv run admob-mcp-authorize

    This opens a browser for Google sign-in and AdMob consent, then prints a refresh token.

  5. Put all three values in .env (see Installation).

The server only ever refreshes this token into short-lived access tokens — it never re-runs the interactive flow itself. If the refresh token is ever revoked (visible/revocable at myaccount.google.com/permissions), re-run step 4.

Scopes requested: admob.readonly (account/app/ad-unit data) and admob.report (performance reports).


Installation

git clone https://github.com/jimsimoy/admob-mcp.git
cd admob-mcp
uv sync
cp .env.example .env   # fill in ADMOB_CLIENT_ID, ADMOB_CLIENT_SECRET, ADMOB_REFRESH_TOKEN

Run directly:

uv run admob-mcp

Client Setup

{
  "mcpServers": {
    "admob": {
      "command": "uv",
      "args": ["--directory", "/path/to/admob-mcp", "run", "admob-mcp"],
      "env": {
        "ADMOB_CLIENT_ID": "...",
        "ADMOB_CLIENT_SECRET": "...",
        "ADMOB_REFRESH_TOKEN": "..."
      }
    }
  }
}

Restart your MCP client after saving. The 6 AdMob tools will appear automatically.


Usage Examples

See what accounts and apps are visible

List my AdMob accounts, then list the apps under the first one

Check last week's earnings by app

Generate a network report for accounts/pub-1234567890123456 from 2026-08-30 to
2026-09-05, dimensions DATE and APP, metrics ESTIMATED_EARNINGS and IMPRESSIONS

Compare ad source performance

Generate a mediation report for the same account and date range, broken down
by AD_SOURCE

Security

  • Credentials (ADMOB_CLIENT_ID, ADMOB_CLIENT_SECRET, ADMOB_REFRESH_TOKEN) are read from the environment only — .env, .env.* (except .env.example), and token.json are gitignored.

  • The refresh token is a long-lived credential with read access to your AdMob account and revenue data. Treat it like a password; revoke it at myaccount.google.com/permissions if it's ever exposed.

  • This is a read-only server by design — it does not expose the v1beta write endpoints (creating apps/ad units, mediation group management).


Project Structure

src/admob_mcp/
  server.py     # MCP server entry point and tool definitions
  client.py     # AdMob API client (pagination, report-stream parsing)
  auth.py       # OAuth access-token refresh
  authorize.py  # One-time interactive OAuth consent flow (admob-mcp-authorize)

The server communicates over stdio using JSON-RPC 2.0, the standard MCP transport.


A note on testing

This was built directly from Google's official AdMob API v1 reference (endpoints, OAuth scopes, and the exact dimension/metric enums for both report types), with token refresh/caching, pagination, and report-response parsing covered by tests against a mocked API. It has also been verified end-to-end against a live AdMob account: the OAuth loopback flow, list_accounts, list_apps, list_ad_units, generate_network_report (both an empty-result case and a populated one, confirming row and footer parsing), and generate_mediation_report all returned correct real data.


License

MIT — free to use, modify, and distribute.


Report a Bug · Request a Feature

Available Tools

6 tools
generate_mediation_reportA

Generate an AdMob mediation performance report (earnings across ad sources).

account_name looks like 'accounts/pub-1234567890123456'. start_date/end_date
are 'YYYY-MM-DD', inclusive.

dimensions default to ["DATE", "AD_SOURCE"]; valid values: DATE, MONTH,
WEEK, AD_SOURCE, AD_SOURCE_INSTANCE, AD_UNIT, APP, MEDIATION_GROUP,
COUNTRY, FORMAT, PLATFORM, MOBILE_OS_VERSION, GMA_SDK_VERSION,
APP_VERSION_NAME, SERVING_RESTRICTION.

metrics default to ["ESTIMATED_EARNINGS", "IMPRESSIONS", "CLICKS"]; valid
values: AD_REQUESTS, CLICKS, ESTIMATED_EARNINGS, IMPRESSIONS,
IMPRESSION_CTR, MATCHED_REQUESTS, MATCH_RATE, OBSERVED_ECPM.

Inputs: end_date (required), start_date (required), account_name (required), metrics, +2 more. Returns: object

generate_network_reportA

Generate an AdMob network (own ad serving) performance report.

account_name looks like 'accounts/pub-1234567890123456'. start_date/end_date
are 'YYYY-MM-DD', inclusive.

dimensions default to ["DATE", "APP"]; valid values: DATE, MONTH, WEEK,
AD_UNIT, APP, AD_TYPE, COUNTRY, FORMAT, PLATFORM, MOBILE_OS_VERSION,
GMA_SDK_VERSION, APP_VERSION_NAME, SERVING_RESTRICTION.

metrics default to ["ESTIMATED_EARNINGS", "IMPRESSIONS", "CLICKS",
"AD_REQUESTS"]; valid values: AD_REQUESTS, CLICKS, ESTIMATED_EARNINGS,
IMPRESSIONS, IMPRESSION_CTR, IMPRESSION_RPM, MATCHED_REQUESTS, MATCH_RATE,
SHOW_RATE.

Inputs: end_date (required), start_date (required), account_name (required), metrics, +2 more. Returns: object

get_accountA

Fetch one account's details. account_name looks like 'accounts/pub-1234567890123456'.

Inputs: account_name (required). Returns: object

list_accountsA

List AdMob publisher accounts accessible to this credential.

Inputs: no named parameters. Returns: result

list_ad_unitsB

List ad units under an account. account_name looks like 'accounts/pub-1234567890123456'.

Inputs: account_name (required). Returns: result

list_appsA

List apps under an account. account_name looks like 'accounts/pub-1234567890123456'.

Inputs: account_name (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool maps to a distinct resource or action: accounts, apps, ad units, and two clearly differentiated report types (network vs. mediation). No meaningful overlap exists between tool purposes.

    Naming Consistency5/5

    Tool names follow a consistent verb_noun pattern: list_accounts, get_account, list_apps, list_ad_units, generate_network_report, generate_mediation_report. The pattern is predictable and uniform.

    Tool Count5/5

    Six tools is well-scoped for an AdMob read/reporting surface. Each tool earns its place without redundancy or bloat.

    Completeness4/5

    The surface covers account discovery, app/ad unit listing, and comprehensive network/mediation reporting. Minor gaps exist for detailed per-app or per-ad-unit lookups and mutation operations, but core reporting workflows are well covered.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that gives Claude Desktop direct access to your Google AdSense account. Ask plain English questions about your revenue — no dashboard required.
      10
      10 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Google AdSense management. Create ad units, generate framework-specific ad code, manage earnings reports, and automate ads.txt — all from your AI assistant.
      12
      10 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A read-only MCP server for querying Google Ads data using GAQL, enabling AI assistants to safely read campaign performance, ad groups, and keywords.
      12
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A read-only MCP server for the Google Ads API, exposing reporting tools for account summaries, campaigns, performance, search terms, and conversion actions. Enables natural-language queries to Google Ads data without write access.
      -