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
Metadata
Release files for niche-google-trends-mcp 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| niche_google_trends_mcp-0.3.0.tar.gz | 57.0 kB | Without provenance | Details for niche_google_trends_mcp-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| niche_google_trends_mcp-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for niche_google_trends_mcp-0.3.0-py3-none-any.whl |
Total release size: 70.2 kB
Release files / niche_google_trends_mcp-0.3.0.tar.gz
| Download URL | niche_google_trends_mcp-0.3.0.tar.gz |
|---|---|
| Size | 57.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d9934d17de95a846ccb42e3b319aa04633b818f320abc8fd6c1b555b72b16cb
|
|
BLAKE2b-256 checksum How to use checksums |
383f574587c3f4c2972f88be41368802f34b32aaef627641a722abf5c2745a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / niche_google_trends_mcp-0.3.0-py3-none-any.whl
| Download URL | niche_google_trends_mcp-0.3.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a78754821a88d27ad4808c34594610f3b1a8043c63659205d06fff5fd006747d
|
|
BLAKE2b-256 checksum How to use checksums |
5f6cebb8076475390e8fc06ce33360cda50e4233338224d511636b1f50addef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for niche-google-trends-mcp 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.