Skip to main content
Glama
Google Trends MCP

Google Trends MCP

by jain-eshan

Google Trends MCP

A local MCP server that lets Claude (or any MCP client) query Google Trends directly — search interest over time, related queries and topics, regional breakdowns, and real-time trending searches — so you can do market research inside a conversation instead of tab-switching to trends.google.com and pasting screenshots back in.

Built for personal/self-use market research. No API key required — Google Trends has no official public API, so this wraps pytrends, the standard unofficial Python client, in an MCP server.

工具

所有工具默认使用 geo="IN"(印度),除非另有说明 —— 传入 geo="" 表示全球范围,或任意一个 ISO 国家/地区代码(如 "US"、"GB" 等)。timeframe 接受 pytrends 的格式,例如 "today 12-m"、"today 5-y"、"now 7-d",或一个明确的区间,如 "2024-01-01 2024-06-01"。

interest_over_time(keywords, timeframe="today 12-m", geo="IN")

相对搜索兴趣(0–100)随时间的变化,最多支持 5 个关键词并排对比。第 6 个及之后的关键词会被静默丢弃。每条记录都包含 isPartial —— 最近一个数据点上的 true 表示该周期尚未完成,其值是临时值;不要把该点的下降解读为真实的趋势变化。

单关键词的热门和相关查询。返回 {"top": [...], "rising": [...]},每个字段都是 {"query": ..., "value": ...} 记录的列表。top 的值是 0–100 的相对兴趣。rising 的值是百分比增长 —— 但是,当值为 5000% 时是 Google 的 Breakout 标记,表示从近乎为零的基数上爆发的增长,而不是字面意义的百分比。

与 related_queries 相同,但返回的是主题分组(Google 自己的主题聚类),而不是原始查询字符串 —— 记录中除了 value 之外,还包含 topic_title 和 topic_type。rising 同样适用 Breakout 约定。

interest_by_region(keyword, timeframe="today 12-m", geo="IN")

在给定的 geo 范围内,按州/地区细分关键词的搜索兴趣。返回一个由 {"geoName": ..., "<keyword>": 0-100} 组成的列表,每个地区一条记录。

某个国家的今日热门搜索。请注意,这里的 geo 格式不同 —— 它是完整的小写国家名称("india"、"united_states"),不是像其他四个工具那样的 ISO 代码。这是 Google 自身端点的真实不一致,而不是 bug。

已知限制: 截至撰写本文时,trending_now 遇到 HTTP 404 而失败。Google 似乎已弃用了 pytrends 的 trending-search 方法所依赖的旧端点(hottrends/dailytrends/realtimetrends)——这一结论已通过测试 pytrends 提供的全部三种变体得到确认。这是上游问题,无法在此代码库中修复;它以干净的、可读的错误字符串失败,而不是崩溃。其他 4 个工具使用另一组仍然可用的不同端点,因此不受影响。如果 Google 恢复该端点、或 pytrends 提供补丁,这里无需任何改动即可恢复工作。

所有工具都会捕获失败情况(接口限流、网络错误、上述情况)并返回普通的错误字符串而不是崩溃 —— Google Trends 是一个被爬取的公网端点,不是稳定的 API,因此这是预期行为,不是例外情况。

Related MCP server: Google Trends MCP Server

设置

需要 Python 3.10+ 和 uv。

git clone https://github.com/jain-eshan/google-trends-mcp.git
cd google-trends-mcp
uv sync

注册到 Claude Code

claude mcp add google-trends -- uv run --directory /absolute/path/to/google-trends-mcp server.py

验证连接:

claude mcp list

你应该会看到 google-trends 被列为 ✔ Connected。在注册后新的 Claude Code 对话中开始使用 —— 已经运行的会话不会检测到新添加的服务器。

使用

注册后,只需让 Claude 使用它即可 —— 例如:

“使用 google-trends MCP 对比印度过去 12 个月中 ‘lab grown diamonds’ 与 ‘diamond jewellery’ 的装机兴趣,并展示相关查询。”

可选:/trends 技能

本仓库包含一个位于 .claude/skills/trends/SKILL.md 的 Claude Code 技能,它会将原始工具包装成一个研究、总结工作流 —— 该技能决定哪些工具与你的主题相关,并写出一份通俗易懂的总结,而不是输出原始 JSON。如果你在使用 Claude Code,该技能会自动从本仓库加载;只需运行:

/trends <your topic>

设计说明

  • 只提供数据,服务器内不做总结。 每个工具只返回原始的、结构化数据 —— 如何解读(这个趋势是否真实、这里的 Breakout 标记意味着什么、什么值得标记)发生在调用它的对话中,而不是内建在服务器里。这让服务器保持简单,并让任何调用者在里面做出自己的判断。

  • 依赖只有 mcp[cli] 和 pytrends。 没有数据库、没有配置文件、没有 API 密钥。

  • 没有正式的测试套件。 它封装的是一个被爬取的第三方端点;只有测试套件大多只是测试 pytrends 和 Google 当前的响应结构,并不是测试这段代码。开发期间,每个工具都在真实的 Google Trends 数据上验证过。

许可证

MIT —— 见 LICENSE。

Available Tools

11 tools
app_store_appsA

Existing iPhone/iPad apps matching a query, from Apple's public iTunes Search API - who already serves this need, and how many people rate them (rating count is a rough proxy for user base). No setup needed.

Args: query: search terms, e.g. "meal planner" or "invoice". country: ISO country code for the store, e.g. "US" (default), "IN", "GB". limit: max apps, capped at 50.

Returns: A list in App Store relevance order, each with "name", "developer", "rating", "rating_count", "price", "genre", "released", "last_updated", "url".

Inputs: query (required), limit, country.

builder_activityA

Are people actually building and shipping in this space? Hacker News stories (launches, Show HNs, debates) plus GitHub repositories - a builder signal, as opposed to search interest or community chatter. Works with no setup; a GITHUB_TOKEN saved via /gutcheck setup raises GitHub's limit from 10 to 30 searches a minute.

For Product Hunt launches, use web search restricted to producthunt.com instead - Product Hunt's API has no search endpoint.

Args: query: search terms, e.g. a product category ("habit tracker") or problem.

Returns: {"hn": {"total": int, "stories": [...]}, "github": {"total": int, "repos": [...]}}. Each story: title, points, num_comments, url, created_at. Each repo (top 10 by stars): name, description, stars, last_push, url.

Inputs: query (required).

company_registrationA

Company registration lookup via OpenCorporates - registration facts only (incorporation date, status, company number). Does NOT cover funding, valuation, or traction data - no free API exists for that (see README for why).

Requires a free OpenCorporates API token: as of 2026 OpenCorporates requires a token on every request, even on the free tier (roughly 50 requests/day, 200/month). Register at https://opencorporates.com/api_accounts/new and save it as OPENCORPORATES_API_TOKEN via /gutcheck setup.

Args: name: company name to search for. jurisdiction: optional OpenCorporates jurisdiction code (e.g. "in", "us_de") to narrow results.

Returns: A list of up to 5 matches, each containing "company_name", "jurisdiction_code", "incorporation_date", "company_number", "current_status", "opencorporates_url". Empty list if no matches. A setup-instructions string if OPENCORPORATES_API_TOKEN is unset, or OpenCorporates' own rejection message if the token is invalid/expired.

Inputs: name (required), jurisdiction.

interest_by_regionA

Search interest for a keyword broken down by state/region within a country, or by country when geo is "" (worldwide).

Args: keyword: a single search term. timeframe: pytrends timeframe string, e.g. "today 12-m". geo: ISO country code (e.g. "US", "IN"), or "" for worldwide (default). response_format: "concise" (default) returns only the top 10 regions by interest, rounded to whole numbers. "full" returns every region, unrounded.

Returns: A list of records, one per state/region within the specified geo, each containing: - "geoName": the state/region name (e.g. "California"), or the country name when worldwide - A column with the keyword name as the key: relative search interest (0-100 scale) for that region. Higher values indicate higher relative interest in that region compared to others in the same country. This is Google Trends' standard region-relative scale.

Inputs: keyword (required), geo, timeframe, response_format.

interest_over_timeA

Relative Google search interest (0-100) over time for up to 5 keywords, compared side by side.

Args: keywords: 1-5 search terms to compare. Only the first 5 are used; additional keywords are silently dropped. timeframe: pytrends timeframe string, e.g. "today 12-m", "today 5-y", "now 7-d", or "YYYY-MM-DD YYYY-MM-DD". geo: ISO country code (e.g. "US", "IN", "GB"), or "" for worldwide (default). response_format: "concise" (default) covers the whole requested timeframe, thinned to about 26 evenly spaced points (first and last always kept) and rounded to whole numbers, so the shape of the window is intact at a low token cost. "full" returns every point unrounded - use it when you need week-by-week detail.

Returns: A list of records, one per date, each containing: - "date": ISO date string - "isPartial": present and true only when the period is incomplete (most recent point) - omitted when false in "concise" mode, since false is the common case. - One numeric key per keyword (0-100 relative interest value)

Inputs: keywords (required), geo, timeframe, response_format.

news_coverageA

Recent news coverage from Google News - is the press writing about this, and what angle are they taking? Useful for spotting funding rounds, regulation, launches, and whether a topic is getting more or less attention. No setup needed.

Args: query: search terms. geo: ISO country code for the news edition, e.g. "US" (default), "IN", "GB". recent: how far back - "7d", "1m", "1y" (default). Uses Google News' own when: filter. limit: max headlines to return (Google returns up to ~100; "total" counts all of them).

Returns: {"total": int, "last_30_days": int, "headlines": [{"title", "source", "published", "url"}]}, newest first. "total" and "last_30_days" are counts within Google's capped result set, so treat them as a rough attention gauge, not an exact article count.

Inputs: query (required), geo, limit, recent.

reddit_signalA

What real people on Reddit are saying, asking, or complaining about - qualitative community signal, as opposed to Trends/Wikipedia's passive search/reading numbers.

Works with no setup via Reddit's public search feed (which returns post text but not scores, and rate-limits after a burst of requests). If REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET are saved via /gutcheck setup, uses the official API instead, which adds score and comment counts.

Args: query: search terms. subreddits: optional subreddit names to restrict the search to (e.g. ["startups", "SaaS"]). limit: max results, capped at 100. time_filter: "week", "month", "year" (default), or "all".

Keep the query short (2-4 words) and pass subreddits when obvious communities exist. Reddit's keyless search matches loosely on long questions, so results that share no meaningful word with the query are dropped and the rest are ranked by how many query words they match.

Returns: A list of records with "title", "subreddit", "snippet" (first ~300 chars of the post body), "url", "created". "score" and "num_comments" are included only in API mode.

Inputs: query (required), limit, subreddits, time_filter.

wikipedia_pageviewsA

Monthly Wikipedia pageview counts for an article - a free, no-auth reference/reading interest signal that complements Google Trends' search-interest signal. The two diverging (e.g. a term trending in search but flat on Wikipedia) can itself be a signal worth flagging.

Args: article: an English Wikipedia article title, e.g. "Artificial_intelligence" or "Machine learning" (spaces are handled automatically). timeframe: how far back to request, as a simple duration - "P1Y" (1 year, default), "P6M" (6 months), "P90D" (90 days). Only whole Y/M/D forms are supported. response_format: "concise" (default) returns only the most recent 12 months. "full" returns the entire requested timeframe.

Returns: A list of records, one per month, each containing: - "month": "YYYY-MM" - "views": total pageviews that month (all access methods, human traffic only - bot traffic is excluded by Wikimedia's "user" agent filter)

Inputs: article (required), timeframe, response_format.

youtube_videosA

YouTube videos matching a query, with view and comment counts - shows how much people watch content about a topic (tutorials, reviews, "I tried X" videos), which is often a stronger consumer-interest signal than search volume.

Requires a free YOUTUBE_API_KEY (Google Cloud, YouTube Data API v3), saved via /gutcheck setup. Each call uses about 101 of the free 10,000 daily quota units.

Args: query: search terms. limit: max videos, capped at 25. published_after_days: only videos from the last N days; omit for any time.

Returns: A list in YouTube relevance order, each with "title", "channel", "published", "views", "likes", "comments", "url". A setup-instructions string if no key is saved.

Inputs: query (required), limit, published_after_days. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct data source or dimension: Google Trends topics, queries, time series, regional breakdown, plus Wikipedia, OpenCorporates, Reddit, HN/GitHub, Google News, App Store, and YouTube. Even within Trends, related_topics vs related_queries are clearly separated by content type. No ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent snake_case noun phrase pattern (e.g., interest_over_time, reddit_signal, builder_activity). No mixing of conventions or verb styles, making the set predictable and easy to navigate.

    Tool Count5/5

    With 11 tools covering a wide but focused range of market research signals, the count is well-scoped. Each tool contributes a unique data source, and none feel redundant or missing for the server's stated purpose.

    Completeness4/5

    The surface covers search interest, related topics/queries, regional data, reference interest (Wikipedia), community chatter (Reddit), builder activity (HN/GitHub), news coverage, app ecosystem, and YouTube viewership. Minor gaps exist (e.g., no global 'trending now' without a keyword, no multi-keyword regional comparison), but core workflows are well supported.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers