Server data from the Official MCP Registry
Read AdSense Management API v2 accounts and reports through MCP.
About
Read AdSense Management API v2 accounts and reports through MCP.
Security Report
This is a well-designed MCP server for Google AdSense with appropriate OAuth authentication and minimal security concerns. The code properly handles credential management via environment variables, implements token refresh logic correctly, and uses read-only API scopes. A minor issue exists in the authorization script where shell command construction could theoretically be vulnerable to argument injection on non-Windows platforms, but the severity is low given the controlled execution context. Supply chain analysis found 1 known vulnerability in dependencies (0 critical, 1 high severity). Package verification found 1 issue.
7 files analyzed · 4 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: ADSENSE_ACCESS_TOKEN
Environment variable: ADSENSE_CLIENT_ID
Environment variable: ADSENSE_CLIENT_SECRET
Environment variable: ADSENSE_REFRESH_TOKEN
Environment variable: ADSENSE_ACCOUNT
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-sirmacke-adsense-mcp": {
"env": {
"ADSENSE_ACCOUNT": "your-adsense-account-here",
"ADSENSE_CLIENT_ID": "your-adsense-client-id-here",
"ADSENSE_ACCESS_TOKEN": "your-adsense-access-token-here",
"ADSENSE_CLIENT_SECRET": "your-adsense-client-secret-here",
"ADSENSE_REFRESH_TOKEN": "your-adsense-refresh-token-here"
},
"args": [
"-y",
"@sirmacke/adsense-mcp"
],
"command": "npx"
}
}
}Documentation
View on GitHubFrom the project's GitHub README.
AdSense MCP
An MCP server providing read-only access to the AdSense Management API v2: accounts, payments, alerts, policy issues, sites, inventory, ad code, and saved or ad-hoc reports.
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 ADSENSE_ACCESS_TOKEN, or all three of ADSENSE_CLIENT_ID, ADSENSE_CLIENT_SECRET, and ADSENSE_REFRESH_TOKEN.
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.readonlyscope. Keep it secret. - Copy
.env.exampleto your secure environment configuration and populate eitherADSENSE_ACCESS_TOKENor the OAuth client ID, secret, and refresh token. - Install and build:
npm install
npm run build
One-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 authorize
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.
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
Accounts and account status
adsense_list_accountsadsense_get_accountadsense_list_child_accountsadsense_list_paymentsadsense_list_alertsadsense_get_ad_blocking_recovery_tagadsense_list_policy_issuesadsense_get_policy_issueadsense_list_sitesadsense_get_site
Inventory
adsense_list_ad_clientsadsense_get_ad_clientadsense_get_ad_client_ad_codeadsense_list_ad_unitsadsense_get_ad_unitadsense_get_ad_unit_ad_codeadsense_list_linked_custom_channelsadsense_list_url_channelsadsense_get_url_channeladsense_list_custom_channelsadsense_get_custom_channeladsense_list_linked_ad_units
Reports
adsense_list_saved_reportsadsense_get_saved_reportadsense_generate_saved_reportadsense_generate_report
Account-level tools discover the configured or first accessible account when account is omitted. Paginated list tools accept pageSize and pageToken; pass a returned nextPageToken to continue. Resource-specific tools accept the canonical names returned by their corresponding list tools.
adsense_list_payments returns paid and unpaid earnings, including the formatted amount and, for paid earnings, the credited date. The AdSense API does not expose bank or payment-method details.
Example report request: metrics: ["ESTIMATED_EARNINGS", "PAGE_VIEWS", "CLICKS"], dimensions: ["DATE", "COUNTRY_NAME"], dateRange: "LAST_7_DAYS", orderBy: ["-ESTIMATED_EARNINGS"].
The server returns structured JSON. The API's duplicate CSV report methods are intentionally omitted because agents can transform the structured response when CSV is needed.
Verify
npm test
npm run build
Live verification also requires the OAuth values above and an AdSense account. Every exposed endpoint accepts the 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.
- Update the version consistently in
package.json,package-lock.json,server.json(including its npm package entry),mcpb/manifest.json, and the MCP server version insrc/index.ts. - Run
npm testandnpm pack --dry-runto verify the build and published package contents. - Commit and push the release to GitHub.
- Publish the public scoped package with
npm publish --access public. - Authenticate when necessary with
mcp-publisher login github, then runmcp-publisher publishto publish the matchingserver.jsonversion.
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.
License
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Git
Freeby Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
Fetch
Freeby Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
Worldmonitor
Freeby Koala73 · Developer Tools
Live markets, conflicts, country risk, chokepoints, energy, and China decision signals. 86 tools.
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
mcp-creator-python
Freeby mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
