
Admob Mcp Server
io.github.ParkSangGwon由 GitHub 帳號 ParkSangGwon 發布v0.2.0更新於 Oct 24, 2026
MCP server for the Google AdMob API — apps, ad units, mediation, and revenue reports
概覽
一個本機 MCP 伺服器,讓 AI 助理用自然語言讀取你的 Google AdMob 帳戶、應用程式、廣告單元、中介來源與收益報表。
- 可以做什麼
- 列出發布商帳戶與帳戶詳情(例如幣別與時區),列出已註冊應用程式及其平台、商店連結與審核狀態,以及廣告單元的 ID、格式與所屬應用程式。依指定日期、指標、維度、篩選與排序產生 AdMob 聯播網、中介與推廣活動報表,結果以平整表格回傳,金額由 micros 換算為貨幣單位。列出中介廣告來源及其轉接器,包含所需的設定鍵。讀取內建的報表規格參考資源,並執行現成的分析提示,例如表現最佳應用程式、收益摘要與廣告格式比較。
- 適用情境
- 適合想用對話方式了解 AdMob 收益、RPM、eCPM 或中介表現,而不想手寫報表查詢時使用,也適合查詢應用程式與廣告單元 ID。適用於登入的 Google 帳戶所擁有的單一發布商帳戶。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 18 或更新版本。需要一個 AdMob 帳戶及擁有它的 Google 帳戶,並在 Google Cloud 建立個人 OAuth 桌面用戶端並啟用 AdMob API;可用 auth 指令一次性登入,或透過 GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET 與 GOOGLE_REFRESH_TOKEN,或 gcloud 應用程式預設憑證。選用設定包括 ADMOB_ACCOUNT 與 ADMOB_TOOLSETS。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Admob Mcp Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
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."
[Asking Claude Code for the last 7 days of per-app AdMob revenue]
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
Credentials and revenue data travel only between your machine and Google — there is no third-party server in between.
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,accounts - Three authentication options — one-command browser sign-in (
npx admob-mcp-server auth), environment-variable refresh token, or gcloud Application Default Credentials - Built-in analysis prompts and report-spec reference resources
Setup at a glance
One-time setup, roughly 10 minutes:
Requirements
- Node.js 18 or newer — check with
node --version; if missing, install from nodejs.org - An 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 email - Audience: 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
- App name: anything (e.g.
- 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
[!WARNING] While the consent screen is in Testing 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:
(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:
Advanced: environment variables (headless / CI)
If you already have a refresh token, no files are needed:
Advanced: gcloud Application Default Credentials
The same pattern Google's official Analytics/Ads MCP servers use:
Credential 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
Verify 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:
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.
[!TIP] If you used the environment-variable sign-in, pass the variables through your client's
envblock (Claude Code: repeat--env KEY=valuebefore--; 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
CLI flags
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:
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
apps
adunits
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.
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
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:
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
To 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
來源:README.md,提交 f613490
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分