Google Trends MCP Server โ gtrends-mcp-full
The complete MCP server for Google Trends. Ask Claude, Cursor, Windsurf, VS Code, Codex or any other MCP client what people are searching, where, when, and what is taking off right now โ and get analysis back, not a chart to squint at.
32 tools ยท Trending Now with real search volumes ยท interest over time, by region and related searches ยท seasonality, momentum and share of search ยท no API key, no browser, no sign-in.
Project page ยท Quick start ยท Tools ยท Prompts ยท Configuration ยท How it stays unblocked ยท FAQ ยท Docs
What you get
Works with: Claude Desktop ยท Claude Code ยท Cursor ยท Windsurf ยท VS Code (Copilot agent mode) ยท OpenAI Codex CLI ยท any MCP client over stdio or HTTP.
Tools
32 tools in 5 groups. You don't call them yourself โ ask in plain language and your AI picks the right one.
๐๏ธ works on the local data file, no request to Google
๐ฅ Trending now
๐ Explore a keyword
๐ง Analysis
๐๏ธ History that Google does not keep
๐งญ Lookups and utilities
The full reference with every parameter is in docs/tools.md โ generated from the code, so it is never out of date.
Prompts
Four ready-made workflows that appear in your client's prompt menu. Each chains several tools and says what the finished answer must contain.
Two reference pages are also exposed as MCP resources: gtrends://guide (how to read the numbers, time ranges, operators, topics) and gtrends://trending-categories.
Quick start
You need Python 3.10 or newer and uv (or pip).
1. Add it to your client
Nothing to download first: uvx fetches the package from PyPI and runs it.
Claude Code
claude mcp add gtrends -- uvx gtrends-mcp-full
Claude Desktop, Cursor, Windsurf, VS Code โ add this to the client's MCP configuration:
{
"mcpServers": {
"gtrends": {
"command": "uvx",
"args": ["gtrends-mcp-full"],
"env": {
"GTRENDS_GEO": "US",
"GTRENDS_TIMEZONE": "America/New_York"
}
}
}
}
Both env entries are optional. There is nothing else to configure: no key, no sign-in.
2. Check it
uvx gtrends-mcp-full doctor
doctor asks every Google Trends endpoint one question; all eight should say OK. On the very first run a chart endpoint may report that the session is still being validated โ that passes after a minute and a half and does not come back.
3. Ask
What's trending in the US right now, and which of it is about technology? Is "heat pump" growing in the UK? When does it peak? Rank these 15 car brands by search interest in Germany. What is Toyota's share of search against Honda and Ford this year?
From the command line
With the package installed (uv tool install gtrends-mcp-full or pip install gtrends-mcp-full):
gtrends-mcp-full doctor # configuration and endpoint check
gtrends-mcp-full trending US # print what is trending now
gtrends-mcp-full snapshot US,GB,DE # save Trending Now to the local history (for cron)
gtrends-mcp-full --transport streamable-http --port 8000 # serve over HTTP instead of stdio
Keep a trending history by scheduling the snapshot, for example every six hours:
0 */6 * * * gtrends-mcp-full snapshot US,GB,DE
Reading the numbers
Everything Google Trends returns is an index from 0 to 100, not a search count: the share of all searches a term had, rescaled so the highest point in that one request is 100. Three things follow, and the tools are built around them:
- Only terms in the same request are comparable.
compare_many,share_of_search,compare_periodsandcompare_locationsbuild one scale for you. - Across places it is a share of local searches. A small country can outrank a large one.
- The last point of a range is usually incomplete. It is marked, and left out of averages.
The exception is Trending Now, which carries real โ bucketed โ search volumes ("200K+").
A search term is matched literally. To count two wordings as one, join them in a single term with + (e-mail + email); for the name of a thing, find_topic gives a topic id that Google resolves across languages and spellings.
Configuration
Every setting is optional.
How it stays unblocked
Google Trends has no public API for general use, so this server speaks to the same endpoints as the Trends website. Those endpoints are rate-limited and unforgiving of scripts that behave like scripts. What the server does about it:
- One long-lived session. Google refuses the chart endpoints without its session cookie, and turns away a cookie it has only just issued for the first minute and a half. The server fetches one cookie when it starts, lets it mature in the background, stores it, and reuses it on every later run. The endpoints that work without a cookie โ Trending Now, the feed, lookups โ never wait for it.
- Pacing. Requests are spaced: 1.5 s by default, 2 s for charts, and 6 s between two related-searches requests, the touchiest endpoint. After a refusal the gap widens for five minutes.
- Back-off, then silence. A real rate limit is retried a few times with growing delays. If it persists, the server stops asking that group of endpoints for a few minutes instead of making the block worse โ the other groups keep working.
- A cache with a fallback. Every answer is stored. Ask twice, one request. When Google refuses, an older answer is served and labelled with its age.
- Fewer requests by design. One chart request can carry five terms; a second chart for the same question reuses the first one's tokens.
- A time budget. A tool call reports back within the budget with what it has, naming what is missing, rather than hanging your client.
check_endpoints (or gtrends-mcp-full doctor) tells you at any moment which endpoints answer, and whether a failure is a rate limit, a changed endpoint or the network.
FAQ
Is this the official Google Trends API?
No. Google announced an official API in 2025, but it is a closed alpha for approved testers. This server uses the endpoints behind the Trends website, which need no key. They are undocumented and can change; when one does, check_endpoints says which, and the fix is a package update.
Do I need a Google account?
No. One tool, related_topics, returns an empty list to anonymous sessions โ Google withholds it โ and says so. Supplying a signed-in cookie unlocks it; everything else works without.
Can it give me search volumes? Trending Now carries real volumes, in buckets (2K+, 200K+). Everything else is the 0โ100 index, which measures relative interest. No tool pretends otherwise.
I asked for the same thing twice and one number moved by a point. Google Trends is computed from a sample of searches, so repeated requests can differ slightly. The cache returns the same answer within its lifetime.
A tool says Google is rate-limiting.
Wait a few minutes; cached answers keep working. If it happens often, ask for several keywords in one call instead of one call each, raise GTRENDS_MIN_INTERVAL, or set GTRENDS_PROXY.
A tool says the session is still being validated. That is the first ninety seconds after the very first start. Trending tools work in the meantime, and it does not happen again: the session is stored.
Why does a small country outrank a big one? Because the index is a share of that place's own searches, not a count.
Where is my data?
In one SQLite file on your machine (~/.config/gtrends-mcp-full/trends.sqlite): cached answers, the Trending Now snapshots you saved, and your watchlist. Nothing is sent anywhere except the requests to Google Trends.
Development
uv venv && uv pip install -e ".[dev]"
uv run pytest # no network needed: the tools run against a fake Google Trends
uv run ruff check src tests
python scripts/gen_tools_doc.py # after changing a tool's signature or docstring
python scripts/record_fixtures.py # re-record the real answers the contract tests replay (about 15 requests to Google)
See CONTRIBUTING.md and CHANGELOG.md.
Related
- gsc-mcp-full โ the companion Google Search Console MCP server: 37 tools, every API endpoint, hourly data and history beyond 16 months.
License
MIT. Not affiliated with or endorsed by Google. Google Trends is a trademark of Google LLC. Use of Google Trends data is subject to Google's terms of service.