niche-google-trends-mcp
MCP server for Google Trends keyword validation and demand analysis. No API key needed.
v0.2.0 — Replaces broken pytrends backend with real Chrome browser + RSS feed.
How it works
| Tool | Backend | Description |
|---|---|---|
trends_interest_over_time |
Chrome browser | Keyword interest over time (0-100 scale) |
trends_related_queries |
Chrome browser | Related and rising queries |
trends_compare |
Chrome browser | Compare interest across keywords |
trends_trending_searches |
RSS feed | Today's real-time trending searches |
Browser tools launch a real Chrome via CDP (port 9223), navigate to trends.google.com/trends/explore, and intercept the API responses from:
/trends/api/widgetdata/multiline→ timeline data/trends/api/widgetdata/relatedsearches→ related queries/trends/api/widgetdata/comparedgeo→ geographic data
This bypasses pytrends 429 issues entirely by routing through a real browser session.
RSS fetches from the public Google Trends RSS feed (trends.google.com/trending/rss). Always available.
Setup
# Install
pip install niche-google-trends-mcp
# or
uvx niche-google-trends-mcp
# First-time setup: open Chrome and accept Google cookies
niche-google-trends-mcp --login
MCP Config
{
"mcpServers": {
"niche-google-trends-mcp": {
"command": "uvx",
"args": ["niche-google-trends-mcp"]
}
}
}
Architecture
src/google_trends_mcp/
├── server.py # FastMCP with 4 tools + CLI
├── tools.py # Pydantic params + async routing
├── rss.py # Google Trends RSS fetcher
└── browser/
├── __init__.py
├── client.py # TrendsBrowser via Patchright/CDP
└── scraper.py # API response interception + parsing
Key differences from v0.1.0 (pytrends)
| v0.1.0 (pytrends) | v0.2.0 (Patchright + RSS) | |
|---|---|---|
| Backend | pytrends scraper | Real Chrome browser + RSS |
| 429 issues | Constant | Rare (retry logic built in) |
| API key | None | None |
| Dependencies | pytrends, pandas |
patchright (no pandas) |
| Data extraction | HTTP calls | Network response interception |
Rate limiting
Google rate-limits the widgetdata/multiline and relatedsearches endpoints. The code handles this with:
- 2 retries with 10s/20s exponential backoff
parse_jsonp()returnsNonefor non-JSON responses (HTML error pages)- RSS
trending_searchesis never rate-limited
Testing
# Unit tests (no Chrome needed)
uv run pytest tests/ -v
# Integration test (requires Chrome on port 9223)
uv run python scripts/integration_test.py
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file niche_google_trends_mcp-0.2.1.tar.gz.
File metadata
- Download URL: niche_google_trends_mcp-0.2.1.tar.gz
- Upload date:
- Size: 57.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6959ec36c7ddff198c5f27feb2542dd5647e5ab8fe47c62bb359292cca62d67e
|
|
| MD5 |
c4c818c2358f4866a89032e4fc64884f
|
|
| BLAKE2b-256 |
0da88ecbc39b3ba7909fcb5848dfe2b93105957672a1103e05dfaf07cd76eb15
|
File details
Details for the file niche_google_trends_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: niche_google_trends_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1216a41faebc0d47f94ac7a920f7ca7f80fcfcfacdecf3525ba66e53d5ec6f92
|
|
| MD5 |
5d12b1b033bba523308fdf12ba674d0d
|
|
| BLAKE2b-256 |
150028c736fb968ee48ae65e2b73c8f7c05d45d24a574a5cf475770940311639
|