flin-google-keyword-planner-mcp
This MCP server provides read-only Google Ads Keyword Planner tools for keyword discovery, historical search-volume/bid data, and local OAuth/connection checks.
Generate keyword ideas from keyword lists, URLs, keyword+URL combinations, or a full site/domain.
Discover keyword ideas constrained to a historical year-month range.
Fetch historical search volumes, bids/CPC, and advertiser-competition metrics for up to 10,000 existing keywords without expanding into new ideas.
Target results with customer ID, language, locations, network, adult-keyword inclusion, manager login customer ID, pagination, keyword annotations, and device aggregation.
Use defaults of German, Switzerland, and Google Search with partners; override for other markets.
Manage Google Ads OAuth locally via authorization URL, code exchange, local OAuth callback flow, and OAuth status tools.
Check local connection configuration and running server version without making a Google API request.
Read data only; it does not change campaigns or perform destructive actions.
Provides tools for generating keyword ideas using Google Ads Keyword Planner, supporting seed strategies from keywords, URLs, sites, and historical metrics.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@flin-google-keyword-planner-mcp generate keyword ideas for 'organic coffee beans'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
flin Google Keyword Planner MCP
Keyword-Ideen und historische Suchvolumen aus Google Ads für Claude Desktop. Die Keyword-Tools lesen Daten und verändern keine Kampagnen.
Start auf einem Mac mit Apple Silicon (M1 oder neuer)
Desktop-Paket herunterladen. Versionierte Downloads und Prüfsummen bleiben verfügbar.
In aktuellem Claude Desktop: Settings → Desktop app → Extensions → Manage → Advanced settings → Install Extension… und die
.mcpbauswählen.Die Pflichtfelder aus dem Passwortmanager eintragen. Die Werte erhältst du vom zuständigen Administrator; keine Zugangsdaten in den Chat kopieren.
Claude bitten: «Starte
google_ads_start_local_oauth_flow.» Den Google-Link öffnen, das berechtigte Konto wählen und den Zugriff genehmigen.«Rufe
connection_statusauf.» Das prüft die lokale Einrichtung ohne Google-Abfrage. Für einen echten Zugriffstest anschliessend ausdrücklich: «Prüfe mitkeyword_historical_metricsdas Keyword Wandern, Sprache Deutsch (1001), Schweiz (2756), NetzwerkGOOGLE_SEARCH.» Dieser Test verwendet Google-Ads-API-Kontingent; Fehler erscheinen als Tool-Ergebnis.
Feld in Claude | Erforderlich? | Bedeutung |
OAuth client ID | Ja | Google-Cloud-OAuth-Client, empfohlen: Desktop app |
OAuth client secret | Ja | Zum OAuth-Client gehörendes Secret |
Google Ads customer ID | Ja im Desktop-Paket | Zielkonto, zehn Ziffern; Bindestriche sind erlaubt |
Manager account ID / | Nur bei Zugriff über ein MCC | ID des zugriffsberechtigten Managerkontos, nicht automatisch die Zielkonto-ID |
connection_status zeigt die tatsächlich laufende server_version.
configuration_status=configured bedeutet nur, dass die lokalen Angaben vorliegen.
Ein vorhandenes Token ergibt auth_status=unknown, nicht eine bestätigte Anmeldung;
live_access=not_checked bleibt beim lokalen Statusaufruf unverändert.
Related MCP server: google-ads-write-mcp
Umstellung auf 0.4.0: einmal neu verbinden
Das Google-Cloud-Projekt der OAuth-Client-ID benötigt Basic oder passenden Standardzugriff. Explorer unterstützt die Keyword-Planung nicht. Entwicklertokens werden weder eingelesen noch an Google gesendet.
Nach Installation von 0.4.0 ist eine neue Google-Anmeldung erforderlich:
google_ads_start_local_oauth_flow aufrufen und den Link im Browser bestätigen.
Alte Token-Dateien und GOOGLE_ADS_REFRESH_TOKEN werden nicht mehr akzeptiert.
Erst eine erfolgreiche Anmeldung ersetzt die alte Datei mit dem neuen Format;
danach bleibt die Verbindung über Neustarts erhalten. Bestehende Google-Freigaben
werden dadurch nicht widerrufen. Die OAuth-Client-ID und das Secret können bleiben.
Desktop-Nutzer müssen das neue 0.4-Paket einmal importieren: Der bisherige 0.3-Starter lädt absichtlich keine 0.4-Versionen. Das Desktop-Paket setzt voraus, dass die 0.4.0-Version auf PyPI veröffentlicht ist; vor der Veröffentlichung kann der lokale Checkout verwendet werden (Option B unten).
Updates und Hilfe
Die Erweiterungsversion bezeichnet den importierten Starter. Ab Starter 0.4.0
lädt jeder Serverneustart automatisch die neueste stabile PyPI-Version im geprüften
Bereich >=0.4.0,<0.5.0 für Python 3.13. Die Serverversion kann daher neuer
sein. Laufende Sitzungen bleiben bestehen, Einstellungen und Token werden nicht
umgeschrieben. Vorabversionen und die nächste Minor-Version sind ausgeschlossen.
Für die neue Kompatibilitätsgrenze den Starter einmal neu importieren; normale Serverupdates benötigen danach keinen neuen Import. Starter-/UI-Änderungen können einen weiteren Import erfordern. Internet ist beim Start erforderlich. Es gibt keinen automatischen Rückfall auf einen alten Cache; der bewusst manuelle Ausweg bei einer PyPI-Störung steht in SUPPORT.md.
Ab Server 0.3.4 sind die Standardwerte Deutsch, Schweiz, Google Search mit Partnern.
Für andere Märkte Sprache und Region ausdrücklich angeben. Advertising Competition ist
Anzeigenwettbewerb, keine organische SEO-Schwierigkeit. Fehlende Kennzahlen sind
null, nicht 0. Volumen sind Näherungswerte; Google fasst ähnliche Varianten zusammen.
Ausführliche Mac-Anleitung · Datenschutz · Sicherheit · Hilfe
Das Python-Paket unterstützt weiterhin Python 3.10+ auf anderen geeigneten Systemen; Intel-Macs werden durch das plattformneutrale Paket nicht ausgeschlossen. Die Apple-Silicon-Prüfung ist unten von Linux-Tests und echten Kontotests getrennt. Entwicklerinstallation und manuelle JSON-Konfiguration folgen weiter unten.
Exposed MCP tools
connection_status— local setup and running version; no browser or API requestkeyword_ideas_from_keywordskeyword_ideas_from_urlkeyword_ideas_from_keyword_and_urlkeyword_ideas_from_sitekeyword_ideas_historicalkeyword_historical_metrics
Tool overview
1) keyword_ideas_from_keywords
Generate ideas from a keyword list (KeywordSeed).
Required:
keywords
2) keyword_ideas_from_url
Generate ideas from a page URL (UrlSeed).
Required:
url
3) keyword_ideas_from_keyword_and_url
Generate ideas from keyword list + URL (KeywordAndUrlSeed).
Required:
keywordsurl
4) keyword_ideas_from_site
Generate ideas from a full site/domain (SiteSeed).
Required:
site_url
5) keyword_ideas_historical
Generate ideas from keywords and constrain historical metrics to a year-month range.
Required:
keywordsstart_yearstart_monthend_yearend_month
Historical option:
include_average_cpc(defaultfalse)
Common optional parameters (keyword idea tools)
customer_idlanguage_id(default1001= German)location_ids(default2756= Switzerland;[]= all locations; max 10 unique IDs)network(GOOGLE_SEARCHorGOOGLE_SEARCH_AND_PARTNERS; default includes partners)include_adult_keywords(defaultfalse)limit(page size: default50, max1000; Google may return fewer rows)include_average_cpc(defaultfalse; also available on all four seed tools)page_tokenkeyword_annotation(currently:KEYWORD_CONCEPT)aggregate_metric_types(currently:DEVICE)login_customer_id
6) keyword_historical_metrics
Fetch historical search volumes and bids for an existing list of up to 10,000
keywords using Google's GenerateKeywordHistoricalMetrics endpoint. It does not
expand the list into new ideas. keyword_ideas_historical keeps its original
behavior: discovering ideas with a historical date range.
Required: keywords. Optional: customer, language, locations, network, adult
keywords, manager ID, and include_average_cpc. Omit dates for Google's default
past 12 months, or supply all four year/month fields. Google controls historical
data availability and may omit unavailable months.
Results include close variants and unmatched_keywords. Google can combine similar
keywords, so the result count need not match the input count; an unmatched term is
not evidence of zero search volume. Pagination and idea annotations do not apply.
Data interpretation and targeting
Since server 0.3.4, defaults are German / Switzerland / Search and Partners. This intentionally changes requests with omitted targeting from English/US. To keep English/US targeting, pass
language_id="1000",location_ids=["2840"]. Usenetwork="GOOGLE_SEARCH"for Google Search alone.Responses echo their targeting. Bid amounts and CPC use the Google Ads customer account's currency; do not assume USD or CHF from the target location.
Missing optional metrics are
null; genuine reported zeroes remain0.Competition and competition index measure advertiser competition, not SEO difficulty.
Search volumes are approximate and may group close variants.
Idea seeds accept at most 20 unique keywords. URL seeds require absolute HTTP(S) URLs.
Each ideas call returns one API page. Continue with
next_page_tokenand identical request parameters. A short or empty page does not imply the end if a token exists.Requests use a 30-second RPC timeout and a 45-second retry window for transient transport errors. The last in-flight RPC may extend beyond that window. Quota and authentication errors are not automatically retried.
Requirements
Python 3.10+ for manual/developer installation; Claude Desktop manages Python 3.13
Google Ads API credentials:
GOOGLE_ADS_CLIENT_IDGOOGLE_ADS_CLIENT_SECRET
Optional:
GOOGLE_ADS_LOGIN_CUSTOMER_IDGOOGLE_ADS_CUSTOMER_ID(default customer if nocustomer_idargument is passed)GOOGLE_ADS_USE_PROTO_PLUS(trueby default)
Quickstart (local)
uv sync --locked --extra dev
cp .env.example .env
# Fill .env with real credentials
uv run --env-file .env flin-google-keyword-planner-mcpClaude integration
Option A: Published package (uvx)
{
"mcpServers": {
"flin-google-keyword-planner-mcp": {
"command": "uvx",
"args": ["--refresh", "--prerelease", "disallow", "--from", "flin-google-keyword-planner-mcp>=0.4.0,<0.5.0", "flin-google-keyword-planner-mcp"],
"env": {
"GOOGLE_ADS_CLIENT_ID": "REPLACE_ME",
"GOOGLE_ADS_CLIENT_SECRET": "REPLACE_ME",
"GOOGLE_ADS_CUSTOMER_ID": "1234567890",
"GOOGLE_ADS_LOGIN_CUSTOMER_ID": "",
"GOOGLE_ADS_USE_PROTO_PLUS": "true"
}
}
}
}Option B: Local development checkout
{
"mcpServers": {
"flin-google-keyword-planner-mcp-local": {
"command": "uv",
"args": [
"run",
"--directory",
"/ABSOLUTE/PATH/TO/flin-google-keyword-planner-mcp",
"flin-google-keyword-planner-mcp"
],
"env": {
"GOOGLE_ADS_CLIENT_ID": "REPLACE_ME",
"GOOGLE_ADS_CLIENT_SECRET": "REPLACE_ME",
"GOOGLE_ADS_CUSTOMER_ID": "1234567890",
"GOOGLE_ADS_LOGIN_CUSTOMER_ID": "",
"GOOGLE_ADS_USE_PROTO_PLUS": "true"
}
}
}
}Leave GOOGLE_ADS_LOGIN_CUSTOMER_ID blank unless access goes through an MCC; then use the manager account ID. The manual server also accepts customer_id per query if no default is set.
Restart Claude Desktop after config changes.
Generate the refresh token in Claude
After Claude has loaded the MCP, ask it to run:
google_ads_start_local_oauth_flowOpen the returned
authorization_urlin your browser and approve Google Ads access.After the browser shows the local completion page, run
google_ads_oauth_status.Run the keyword tools once
token_availableistrue.
The default redirect URI is http://localhost:8080/. If your Google OAuth client uses a different loopback redirect URI, pass it to google_ads_start_local_oauth_flow.
If you cannot use the local callback flow, use the manual fallback:
Run
google_ads_authorization_url.Open the returned URL and approve access.
Copy either the full redirected URL or the
codequery parameter.Run
google_ads_exchange_authorization_codewith that value.
The exchanged refresh token is stored outside Claude config in ~/.config/flin-google-keyword-planner-mcp/oauth-token.json and reused after MCP restarts. Override the storage path with FLIN_GOOGLE_ADS_TOKEN_FILE if needed.
If the browser reports Authentication failed, run google_ads_oauth_status for
the failure reason. It distinguishes rejected codes/clients, connectivity problems,
missing refresh tokens and token-file write failures without returning secrets or
Google's raw error descriptions. Start a new flow after correcting the cause;
authorization codes cannot be reused. token_available=true alone can refer to an
older saved token and does not confirm the latest login succeeded.
Authorization requests only the Google Ads scope and does not opt into combining
previously granted scopes. Code exchange uses Python's HTTP client directly, not
oauthlib's scope validation, so OAUTHLIB_RELAX_TOKEN_SCOPE does not affect this flow.
Since 0.3.6, OAuth failures include a stable diagnostic code and stage. Errors
returned directly by a tool contain error.code and error.stage; callback errors
appear in google_ads_oauth_status as error_code and error_stage, and on the
browser completion page. The token directory is checked for create/write/flush/
replace/delete access before starting local login and before exchanging a code.
The probe does not read or replace an existing token. A successful probe cannot
guarantee a later save (for example, if disk space or permissions change).
See diagnostic codes and test instructions.
Security
Never commit real credentials to git.
.envand.env.*are gitignored; only.env.exampleis tracked.Keep secrets in environment variables or secret managers.
Rotate credentials immediately if accidentally exposed.
CI and release workflows run secret scanning with OSS
gitleaks(noGITLEAKS_LICENSEsecret required).
Testing
uv sync --locked --extra dev
uv run --locked python -m pytest
uv run --locked python -m compileall src
uv buildRelease automation (GitHub + PyPI)
CI workflow:
.github/workflows/ci.ymlRelease workflow:
.github/workflows/release.ymlTag push (
v*) triggers:
tests + compile + build +
twine checkpublish to PyPI via Trusted Publishing (OIDC)
GitHub Release creation with built artifacts
PyPI Trusted Publishing (one-time)
In the PyPI project flin-google-keyword-planner-mcp, add a Trusted Publisher:
Owner:
flin-agencyRepository:
flin-google-keyword-planner-mcpWorkflow:
release.ymlEnvironment:
pypi
Release steps
# 1) bump version in pyproject.toml + src/flin_google_ads_mcp/__init__.py
# 2) run checks
uv run --locked python -m pytest
uv run --locked python -m compileall src
uv build
# 3) release
git add -A
git commit -m "release: vX.Y.Z"
git tag vX.Y.Z
git push origin main --tagsVersion 0.3.0 upgrade notes
Validated with Google Ads Python SDK 35.0.0 (API v26) and MCP SDK 1.30.0.
The MCP SDK remains on the compatible 1.x line; this is not a migration to MCP 2.x.
uv.lock is now tracked so local installs and CI use the same dependency versions.
OAuth exchange returns success and persistence status, never the refresh token. Local OAuth uses PKCE, state validation, a ten-minute expiry, and releases its callback port after completion. Token files are written atomically with private permissions. The manual code-copy fallback remains available.
Clients upgrading from 0.2.x must accept nullable metrics, the additional response
metadata, and the removal of refresh_token from the OAuth exchange response.
Existing five idea tool names are retained. Since 0.3.4, omitted targeting defaults
to German/Switzerland; explicit targeting continues to override these defaults.
Reference: Google historical metrics, Google keyword ideas, API releases.
Available Tools
11 toolsconnection_statusARead-onlyIdempotent
Report local setup and the running server version, without network or login.
A local refresh token does not prove valid Google authorization. This tool never starts OAuth, refreshes a token, or consumes Google Ads API quota.
Inputs: no named parameters. Returns: object
google_ads_authorization_urlC
Create the Google OAuth consent URL for generating a Google Ads refresh token.
Inputs: state, redirect_uri. Returns: object
google_ads_exchange_authorization_codeB
Exchange and securely persist an OAuth code without exposing tokens in chat.
Inputs: code (required), redirect_uri. Returns: object
google_ads_oauth_statusA
Return local OAuth callback status and whether a runtime token is available.
Inputs: no named parameters. Returns: object
google_ads_start_local_oauth_flowC
Start a local OAuth callback server and return the Google consent URL.
Inputs: redirect_uri. Returns: object
keyword_historical_metricsARead-only
Get historical volumes and bids for up to 10,000 supplied keywords, without new ideas.
Google may combine close variants. Omit dates for the default past 12 months; otherwise supply all four date fields. Unmatched keywords are not assumed zero. Defaults: German, Switzerland, Search and Partners. Use location_ids=[] for all locations.
Inputs: keywords (required), network, end_year, end_month, +8 more. Returns: object
keyword_ideas_from_keyword_and_urlDRead-only
Generate keyword ideas using KeywordAndUrlSeed.
Inputs: url (required), keywords (required), limit, network, +9 more. Returns: object
keyword_ideas_from_keywordsCRead-only
Generate keyword ideas using KeywordSeed.
Inputs: keywords (required), limit, network, page_token, +8 more. Returns: object
keyword_ideas_from_siteDRead-only
Generate keyword ideas using SiteSeed.
Inputs: site_url (required), limit, network, page_token, +8 more. Returns: object
keyword_ideas_from_urlCRead-only
Generate keyword ideas using UrlSeed.
Inputs: url (required), limit, network, page_token, +8 more. Returns: object
keyword_ideas_historicalCRead-only
Generate keyword ideas with historical metrics options (year-month range).
Inputs: end_year (required), keywords (required), end_month (required), start_year (required), +12 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
The four keyword_ideas_from_* tools are cleanly separated by seed type, but keyword_ideas_historical vs keyword_historical_metrics will be easy to mix up (both involve ideas/metrics plus dates). The auth group also overlaps: google_ads_authorization_url and google_ads_start_local_oauth_flow both produce a consent URL, differing mainly in whether a local callback server is spun up.
Two predictable families with domain prefixes (google_ads_* for auth plumbing, keyword_* for planner operations) and consistent snake_case throughout. The only outlier is the bare connection_status, which lacks the google_ads_ prefix used by its sibling setup tools.
11 tools is inside the healthy range, and each keyword tool maps to a distinct Google Ads seed type. However, 5 of the 11 tools are setup/auth/status plumbing, which is heavy overhead against only 6 substantive planner operations.
Ideation is fully covered across all four KeywordPlanIdeaService seed types, plus historical metrics for supplied keywords. The noticeable gap is forecasting/bid-budget simulation (KeywordPlan forecast) and location/language reference lookups, which an agent would need for full planner workflows.
Maintenance
Related MCP Connectors
Google Ads MCP server — manage campaigns, keywords, and metrics.
Read-only Google Search Console MCP server for AI assistants.
Remote MCP server that gives Claude, ChatGPT, Cursor or any MCP client Google search volume, CPC, competition and similar keywords for 50+ countries. Works with no signup at 20 lookups a day; sign in with OAuth or an API key for higher limits, or $4.99 a month for unlimited.
Google Ads MCP server: run Search, Display, Demand Gen and PMax campaigns from AI.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server that exposes Google Ads keyword search volumes to AI agents via the KeywordPlanIdeaService, offering a free alternative to paid keyword-volume APIs.1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that exposes write operations on Google Ads, enabling management of campaigns, ad groups, keywords, RSA ads, sitelinks, images, Customer Match audiences, and recommendations.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for managing Google Ads campaigns through the official Google Ads API, covering accounts, campaigns, budgets, keywords, search terms, and keyword ideas. It provides tools for both reading and mutating live ads data, such as pausing campaigns, updating budgets, and adding keywords.MIT
- AlicenseNot gradedqualityFmaintenanceMCP server for Google Ads API that enables LLMs to search and query Google Ads accounts, retrieve resource metadata, and generate keyword ideas.Apache 2.0