Google AdSense MCP server
io.github.SirMacke/adsense-mcp·v0.2.0Read AdSense Management API v2 accounts, inventory, payments, policy, and reports through MCP.
0 stars75 downloads/wk
Reviews
Write oneNobody has reviewed Google AdSense yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Google AdSense tools (26)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
adsense_generate_reportExtract any ad-hoc AdSense report. Supply API v2 dimensions, metrics, filters, dates, sorting, and other report parameters. Account is discovered automatically when omitted.
adsense_generate_saved_reportGenerate a saved AdSense report as structured JSON.
adsense_get_accountGet one AdSense account by resource name, e.g. accounts/pub-123.
adsense_get_ad_blocking_recovery_tagGet the ad-blocking recovery tag for an AdSense account.
adsense_get_ad_clientGet one AdSense ad client by resource name.
adsense_get_ad_client_ad_codeGet the ad code for an AdSense ad client.
adsense_get_ad_unitGet one AdSense ad unit by resource name.
adsense_get_ad_unit_ad_codeGet the ad code for an AdSense ad unit.
adsense_get_custom_channelGet one AdSense custom channel by resource name.
adsense_get_policy_issueGet one AdSense policy issue by resource name.
adsense_get_saved_reportGet one saved AdSense report's metadata by resource name.
adsense_get_siteGet one AdSense site by resource name.
adsense_get_url_channelGet one AdSense URL channel by resource name.
adsense_list_accountsList AdSense accounts available to the authenticated user.
adsense_list_ad_clientsList ad clients in an AdSense account.
adsense_list_ad_unitsList ad units under an AdSense ad client.
adsense_list_alertsList account alerts, including their severity, type, and localized message.
adsense_list_child_accountsList accounts directly managed by an AdSense account.
adsense_list_custom_channelsList custom channels under an AdSense ad client.
adsense_list_linked_ad_unitsList ad units linked to an AdSense custom channel.
adsense_list_linked_custom_channelsList custom channels linked to an AdSense ad unit.
adsense_list_paymentsList paid and unpaid earnings for an AdSense account. Account is discovered automatically when omitted.
adsense_list_policy_issuesList policy issues involving an AdSense account and its AFP child accounts.
adsense_list_saved_reportsList reports saved in an AdSense account.
adsense_list_sitesList sites in an AdSense account, including readiness and Auto Ads state.
adsense_list_url_channelsList active URL channels under an AdSense ad client.
Public scan report
scanner v0.1.10 · 2026-10-29 · same rubric, same numbers if you re-run it
- Code scan3 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 37 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Google AdSense compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 78/100
- higher than 57% of 48,243 servers
- Tools
- 26
- the typical server has 7
- Tools that change things
- 0%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 75
- more than 55% of 12,306 servers with a package
What its tools let an agent do: 26 read
Release history: 2 versions in the registry since 2026-08-31, latest 2026-09-22, typically one every 22 days.
Install Google AdSense in Claude Code, Cursor or VS Code
Runs npx -y @sirmacke/adsense-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add adsense-mcp -- npx -y @sirmacke/adsense-mcp
What the publisher says
From the Google AdSense repository's README, as published. We do not edit it. Read it on GitHub
AdSense MCP
An MCP server that extracts ad-hoc data from the AdSense Management API v2. It exposes an unrestricted report interface: any supported AdSense dimensions, metrics, filters, time period, sort order, timezone, language, currency, and limit can be passed through to accounts.reports.generate.
The server uses the read-only https://www.googleapis.com/auth/adsense.readonly OAuth scope. It does not write to an AdSense account.
Install
Once published, run it from an MCP client with npx -y @sirmacke/adsense-mcp. Configure either ADSENSEACCESSTOKEN, or all three of ADSENSECLIENTID, ADSENSECLIENTSECRET, and ADSENSEREFRESHTOKEN.
Security
OAuth access tokens, refresh tokens, and client secrets are credentials. Keep them out of this repository, issue trackers, shell history, and MCP configuration that is shared with others. If one is exposed, revoke it in Google Cloud immediately; see SECURITY.md.
Setup
- In Google Cloud, enable AdSense Management API and create an OAuth Desktop client.
- Obtain a refresh token granted the https://www.googleapis.com/auth/adsense.readonly scope. Keep it secret.
- Copy .env.example to your secure environment configuration and populate either ADSENSEACCESSTOKEN or the OAuth client ID, secret, and refresh token.
- Install and build:
npm install
npm run buildOne-time OAuth authorization (without gcloud)
Download the OAuth Desktop client JSON from Google Cloud, then run:
$env:ADSENSE_OAUTH_CLIENT_FILE = "C:\secure\adsense-client.json"
$env:ADSENSE_TOKEN_FILE = "C:\secure\adsense-oauth.json"
npm run authorizeThe command opens the Google consent screen on a localhost callback and saves the client ID, client secret, and refresh token only in the private token file. Copy those values to the ADSENSECLIENTID, ADSENSECLIENTSECRET, and ADSENSEREFRESHTOKEN fields of the MCP configuration. Do not leave an External consent screen in Testing: its refresh tokens expire after seven days.
Claude Desktop
Current Claude Desktop builds use extensions. Run npm run package, then install build/adsense-mcp.mcpb from Settings → Extensions → Advanced settings → Install extension. It securely prompts for the OAuth values. On installations that support classic configuration, add this instead:
{
"mcpServers": {
"adsense": {
"command": "node",
"args": ["/absolute/path/to/adsense-mcp/dist/index.js"],
"env": {
"ADSENSE_CLIENT_ID": "...",
"ADSENSE_CLIENT_SECRET": "...",
"ADSENSE_REFRESH_TOKEN": "..."
}
}
}
}Codex
Add the equivalent server definition to your Codex MCP configuration, using the same command, arguments, and environment variables. The server uses the standard MCP stdio transport and works in both clients.
Tools
- adsenselistaccounts
- adsensegetaccount
- adsensegeneratereport
Example report request: metrics: ["ESTIMATEDEARNINGS", "PAGEVIEWS", "CLICKS"], dimensions: ["DATE", "COUNTRYNAME"], dateRange: "LAST7DAYS", orderBy: ["-ESTIMATEDEARNINGS"].
Verify
npm test
npm run buildLive verification also requires the OAuth values above and an AdSense account. The API’s report endpoint is GET /v2/{account}/reports:generate; it requires the AdSense or AdSense read-only OAuth scope.
Releasing
Releases are published to both npm and the official MCP Registry. The registry stores discovery metadata from server.json; the installable server itself is distributed through npm.
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Google AdSense: common questions
- Is Google AdSense MCP server safe?
- Mostly: it is graded B (78/100). Read the Google AdSense safety report
- How do I install Google AdSense?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Google AdSense need an API key?
- Yes. The registry entry asks for
ADSENSE_ACCESS_TOKEN,ADSENSE_CLIENT_SECRET,ADSENSE_REFRESH_TOKEN. - Is Google AdSense maintained?
- The last commit was 44 days ago (2026-09-22). The latest release is v0.2.0.
- How does Google AdSense compare with other MCP servers?
- safety score 78/100 (higher than 57% of 48,243 servers); tools 26 (the typical server has 7); tools that change things 0% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.