Google Trends MCP
Integrates with Google Trends to let AI agents retrieve current trending searches by country, fetch news articles behind a specific trend, and analyze keyword demand metrics such as momentum, seasonality, related queries, and opportunity score.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Google Trends MCP
An MCP server (FastMCP, stdio) that turns Google Trends into an editorial research tool for AI agents: find out what a country started searching for in the last few hours, check whether a keyword has real and sustained demand, and collect the source articles behind a trend, all before writing a single word.
Built for a daily blogging workflow (pick a topic → validate demand → gather sources → hand them to a writing/publishing tool), but the tools are generic.
Google has no official Trends API. This server uses two public paths:
Tool | Source | Returns |
| "Trending now" RSS feed | The ~10 trends that most recently took off in a country, with approximate search volume |
| Same feed | The articles from the "In the news" panel of a trend, with direct publisher URLs |
|
| Derived per-keyword metrics: momentum, seasonality, opportunity score |
Why only the RSS feed? Until November 2026 the first two tools used the internal API behind trends.google.com/trending (
batchexecute), which exposed the full 4 h / 24 h / 48 h / 7 d windows (hundreds of trends), growth percentages and the trend breakdown. Google then put that endpoint behind a reCAPTCHA Enterprise token: without it, every request returnsPERMISSION_DENIED. Getting around a CAPTCHA is not something this project does, so it now relies only on the public feed, which still carries volumes and direct article links.
Installation
Requires Python 3.11+ (developed on 3.12).
git clone https://github.com/John-OF/google-trends-mcp.git
cd google-trends-mcp
python -m venv .venvInstall the dependencies with the virtual environment's Python:
# Windows
.venv\Scripts\python.exe -m pip install -r requirements.txt# macOS / Linux
.venv/bin/python -m pip install -r requirements.txtCheck that it starts (it waits on stdio; press Ctrl+C to exit):
.venv/bin/python server.py # Windows: .venv\Scripts\python.exe server.pyRelated MCP server: youtube-trends-mcp
Registering the server in your MCP client
Always point to the virtual environment's Python, not the system one. In the
examples below, replace <path-to-repo> with the absolute path where you cloned
the repository (on macOS/Linux, use .venv/bin/python instead of
.venv/Scripts/python.exe).
Claude Code, user scope (available in every project):
claude mcp add g-trends --scope user -- "<path-to-repo>/.venv/Scripts/python.exe" "<path-to-repo>/server.py"Claude Code, project scope: copy .mcp.json.example to .mcp.json and fill
in the paths. It is loaded automatically when Claude Code opens the folder.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"g-trends": {
"command": "<path-to-repo>/.venv/Scripts/python.exe",
"args": ["<path-to-repo>/server.py"]
}
}
}Tools
1. get_daily_trends(geo, limit, sort, include_news)
The trends that most recently took off in a country, newest first.
Parameter | Type | Default | Description |
| str |
| ISO alpha-2 code: |
| int (1-25) |
| Number of trends returned after sorting (the feed holds ~10) |
|
|
|
|
| bool |
| Attach each trend's articles inline (no extra requests) |
{
"ok": true,
"geo": "US",
"sort": "volume",
"source": "rss",
"fetched_at": "2026-11-20T05:02:11+00:00",
"total_available": 10,
"count": 3,
"trends": [
{
"rank": 7,
"title": "toyota recalls",
"volume": 20000,
"volume_label": "20000+",
"started": "2026-11-20T04:30:00+00:00",
"explore_url": "https://trends.google.com/trends/explore?q=toyota+recalls&geo=US&date=now%207-d",
"picture": "https://encrypted-tbn0.gstatic.com/images?q=...",
"picture_source": "Fox Business",
"news_available": true
}
]
}volume is Google's absolute approximation (20000+ → 20000), not the
relative 0-100 index returned by get_search_metrics. rank is the position in
the feed, which is ordered by start time.
2. get_trend_articles(trend, geo, limit)
The articles behind one specific trend: the "In the news" panel the website shows when you click a trend. These are the URLs you hand to a writing tool as source material.
Parameter | Type | Default | Description |
| str | — | Trend title; partial, case-insensitive matches work |
| str |
| The same country you found it in |
| int (1-10) |
| Maximum number of articles (the feed carries about 3 per trend) |
{
"ok": true,
"geo": "US",
"trend": "toyota recalls",
"matched_by": "exact",
"volume_label": "20000+",
"article_count": 3,
"articles": [
{
"title": "Over 314K older Toyota, Lexus vehicles recalled ...",
"source": "Fox Business",
"url": "https://www.foxbusiness.com/lifestyle/over-314k-older-toyota-lexus-vehicles-recalled-potentially-dangerous-airbag-issue",
"snippet": null,
"image": "https://encrypted-tbn0.gstatic.com/images?q=..."
}
],
"urls": ["https://www.foxbusiness.com/lifestyle/over-314k-older-toyota-lexus-vehicles-recalled-potentially-dangerous-airbag-issue", "..."]
}urls is a flat list of links, ready to pass as-is to another tool. They are
direct publisher URLs (foxbusiness.com, usatoday.com, billboard.com),
not Google redirects, so they can be opened and read.
If the trend has already rotated out of the feed, the tool returns ok: false
along with available_trends (the current titles).
3. get_search_metrics(keywords, geo, timeframe, include_related)
Demand metrics for up to 5 keywords, compared against each other.
Parameter | Type | Default | Description |
| list[str] (1-5) | — | Google's hard limit: 5 per request |
| str |
| ISO alpha-2, or |
| str |
|
|
| bool |
| Adds |
Metrics computed per keyword:
Field | Meaning |
| Relative 0-100 index |
| Date of the peak |
| Last 4 points vs. the previous 4 (with weekly data ≈ month over month) |
| Least-squares slope, normalised to the average |
| Coefficient of variation (one-off spikes vs. steady demand) |
|
|
| At its highs (≥90) and rising sharply (≥50 %) |
| Average per month, best/worst month and the current month's |
|
|
Plus a ranking already sorted by opportunity_score, and the resolution
(hourly/daily/weekly/monthly) of the series Google returned.
The 0-100 values are relative to the keywords in that same call. To compare candidates, send them together in a single call; never compare numbers across separate calls.
Suggested workflow
get_daily_trends(geo="US")→ the topics that just started trending. The feed rotates every few minutes, so checking a few times a day (or across several countries) widens the pool.Filter the ones that fit your niche.
get_search_metrics(keywords=[3-5 candidates], geo="US", timeframe="today 12-m")→ keep the highestopportunity_score; checkseason_fit_pctso you don't write about a topic in its worst month.get_trend_articles(trend="<the chosen one>")→ takeurlsand pass them to your writing/publishing tool (e.g. a WordPress MCP) as sources.Use
related_queries.risingfor subheadings and long-tail keywords.
Example prompt:
Get the current trends in the US, keep the travel-related ones, measure the top 5 with
get_search_metricsover 12 months, and for the one with the highestopportunity_scorefetch its articles withget_trend_articles. Then write the post using those URLs as sources and the rising queries as H2s.
Limits and caveats
Rate limiting (429):
get_search_metricshits unofficial endpoints. The server retries with exponential backoff (3 attempts) and, if it still fails, returns{"ok": false, "rate_limited": true}instead of crashing. Space your calls out: a few per session, not dozens in a row.pytrendsis no longer maintained.get_search_metricsdepends on it, so if Google changes the endpoints it relies on, that tool will stop working and no upstream fix will come. The other two tools do not usepytrends.The feed is small and has no filters. It holds only the ~10 most recent trends per country, with no time window, category filter, growth percentage or trend breakdown; those now live behind the website's reCAPTCHA (see above). Filter the topics yourself.
Trends rotate. Call
get_trend_articlessoon afterget_daily_trends, or the topic may have left the feed.Google News deliberately left out:
news.google.com/rss/searchreturns ~100 articles per term, but its links arenews.google.com/rss/articles/CBM...redirects that do not resolve server-side (the hop happens in JavaScript). They would be useless to a writing tool. The "In the news" panel links do go straight to the publisher.Encoding: the XML is parsed from bytes, not from
response.text; otherwise typographic quotes in headlines arrive corrupted and leak into the final article.Partial points: the last, still-incomplete period is dropped before computing metrics (otherwise it artificially drags
momentum_pctdown). It is reported inpartial_points_dropped.pytrends + urllib3 2.x: pytrends 4.9.2's built-in retry is broken (
method_whitelistwas removed in urllib3 2.0). That is why retrying is implemented inserver.py(_retry) and noretries/backoff_factoris passed toTrendReq.FastMCP: pinned to
<3.0, following the project's own recommendation.
Development
python -m pip install -r requirements-dev.txt
python -m pytest # offline: every network call is mocked
python -m ruff check .The tests never hit Google: HTTP is replaced with httpx.MockTransport and the
fetchers are monkeypatched, so the suite runs in about a second. CI runs lint
and tests on Python 3.11, 3.12 and 3.13.
Disclaimer
This project is not affiliated with, endorsed by or sponsored by Google. It relies on undocumented endpoints that may change or stop working at any time. Use it responsibly and within Google's terms of service.
License
MIT © 2026 John Orellana
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Live keyword, SERP, backlink, and AI-visibility research for AI agents. Prepaid pay-per-use.
Trending searches in 100+ countries, Google News search, and Google/YouTube/Amazon keyword ideas.
Live SEO intelligence, rank tracking, site audits, and backlink analysis for AI agents.
Live SEO data for AI agents: SERP competition, keywords, backlinks, site audits, AI visibility.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query YouTube search trends, including rising topics, growth metrics, and historical search demand, using natural language.1MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query YouTube search trend data, including rising topics, video keyword growth, and historical demand, using plain language.31MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query Google Trends data, including search interest over time, regional breakdowns, trending searches, and keyword ideas.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to query live trend data and historical search volume across 30+ platforms like Google, TikTok, YouTube, Amazon, and Reddit, including growth comparisons and top-ranking trends.317MIT