Read AdSense Management API v2 accounts and reports through MCP.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
Once published, run it from an MCP client with npx -y @sirmacke/adsense-mcp. Configure either ADSENSE_ACCESS_TOKEN, or all three of ADSENSE_CLIENT_ID, ADSENSE_CLIENT_SECRET, and ADSENSE_REFRESH_TOKEN.
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.
https://www.googleapis.com/auth/adsense.readonly scope. Keep it secret..env.example to your secure environment configuration and populate either ADSENSE_ACCESS_TOKEN or the OAuth client ID, secret, and refresh token.Download the OAuth Desktop client JSON from Google Cloud, then run:
The 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 ADSENSE_CLIENT_ID, ADSENSE_CLIENT_SECRET, and ADSENSE_REFRESH_TOKEN fields of the MCP configuration. Do not leave an External consent screen in Testing: its refresh tokens expire after seven days.
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:
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.
adsense_list_accountsadsense_get_accountadsense_generate_reportExample report request: metrics: ["ESTIMATED_EARNINGS", "PAGE_VIEWS", "CLICKS"], dimensions: ["DATE", "COUNTRY_NAME"], dateRange: "LAST_7_DAYS", orderBy: ["-ESTIMATED_EARNINGS"].
Live 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.
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.
package.json, package-lock.json, server.json (including its npm package entry), mcpb/manifest.json, and the MCP server version in src/index.ts.npm test and npm pack --dry-run to verify the build and published package contents.npm publish --access public.mcp-publisher login github, then run mcp-publisher publish to publish the matching server.json version.Publish npm before the MCP Registry because registry validation requires the referenced public package version to exist. Published versions are immutable, so corrections require a new version.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/google-adsense)<a href="https://allmcps.com/mcp/google-adsense"><img src="https://allmcps.com/api/badge/google-adsense?style=directory" alt="Google AdSense on AllMCPs" /></a>