Skip to main content
Glama
jain-eshan

Google Trends MCP

by jain-eshan

Google Trends MCP

Un servidor MCP local que permite a Claude (o a cualquier cliente MCP) consultar Google Trends directamente — interés de búsqueda a lo largo del tiempo, consultas y temas relacionados, desgloses por regiones y búsquedas de tendencia en tiempo real — para que puedas hacer investigación de mercado dentro de una conversación, sin cambiar de pestaña a trends.google.com y tener que pegar capturas de pantalla.

Está pensado para investigación de mercado de uso personal. No requiere clave de API — Google Trends no tiene una API pública oficial, así que esto envuelve pytrends, el cliente estándar no oficial de Python, en un servidor MCP.

Herramientas

Todas las herramientas usan geo="IN" (India) por defecto, salvo que se indique lo contrario — pasa geo="" para todo el mundo, o cualquier código de país ISO ("US", "GB", etc.). timeframe acepta el formato de pytrends, p. ej. "today 12-m", "today 5-y", "now 7-d", o un rango explícito "2024-01-01 2024-06-01".

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

Interés de búsqueda relativo (0–100) a lo largo del tiempo para hasta 5 palabras clave, comparadas una al lado de la otra. Las palabras clave que superen las 5 primeras se descartan silenciosamente. Cada registro incluye isPartial — un valor true en el punto de datos más reciente significa que ese período aún no ha terminado y su valor es provisional; no interpretes una caída en ese punto como un cambio real de tendencia.

Consultas de búsqueda relacionadas más populares y en aumento para una sola palabra clave. Devuelve {"top": [...], "rising": [...]}, cada uno una lista de registros {"query": ..., "value": ...}. Los valores de top son interés relativo de 0 a 100. Los valores de rising son el incremento porcentual — excepto un valor de 5000%, que es el marcador "Breakout" de Google para indicar crecimiento explosivo desde una base casi nula, no un porcentaje literal.

Lo mismo que related_queries, pero con agrupaciones de temas (las propias agrupaciones de Google) en lugar de cadenas de consulta en bruto — los registros incluyen topic_title y topic_type junto a value. La misma convención de Breakout se aplica a rising.

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

Interés de búsqueda de una palabra clave desglosado por estado/región dentro del geo indicado. Devuelve una lista de registros {"geoName": ..., "<keyword>": 0-100}, uno por cada región.

Las búsquedas con más tendencia de hoy para un país. Nota: el formato de geo aquí es diferente — es el nombre completo del país en minúsculas ("india", "united_states"), no un código ISO como en las otras cuatro herramientas. Es una inconsistencia real en los propios endpoints de Google, no un error.

Limitación conocida: en el momento de crear escribir esto, trending_now devuelve un HTTP 404. Google parece haber retirado el endpoint heredado (hottrends/dailytrends/realtimetrends) del que dependen los métodos de búsqueda de tendencias de pytrends, confirmado al probar las tres variantes que ofrece pytrends. Es un problema upstream que no puede solucionarse en este código; falla limpiamente con una cadena de error legible en lugar de colgarse. Las otras 4 herramientas utilizan una familia distinta de endpoints, que aún funciona y no se ve afectada. Si Google restaura el endpoint o pytrends lo soluciona con un parche, esto volverá a funcionar sin necesidad de cambios aquí.

Todas las herramientas capturan los fallos (límites de petición, errores de red, el caso anterior) y devuelven una cadena de error simple en lugar de bloquearse — pot hub años since Google Trends no es un endpoint estable, sino una API raspada; este es un comportamiento esperado, no algo excepcional.

Related MCP server: Google Trends MCP Server

Configuración

Requiere Python 3.10+ y uv.

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

Registro con Claude Code

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

Verifica que se ha conectado:

claude mcp list

Deberías ver google-trends en la lista como ✔ Connected. Inicia una conversación nueva de Claude Code después del registro: las sesiones ya abiertas no lo detectarán un servidor recién agregado.

Uso

Una vez registrado, solo pide a Claude usarlo — por ejemplo:

"Usa el de google-trends MCP para comparar el interés en 'labor grown diamonds' vs 'diamond jewellery' in India durante los últimos 12 meses, y muéstrame las consultas relacionadas."

Opcional: skill /trends

Esta repo incluye una skill de Claude Code en .claude/skills/trends/SKILL.md que envuelve las herramientas en bruto en un flujo de trabajo de investigación y síntesis — decide qué herramientas son relevantes para tu tema y escribe un resumen natural, en vez de volcar el JSON en bruto. Si usas Claude Code, la skill se detecta automáticamente desde este repo; solo ejecuta:

/trends <your topic>

Notas de diseño

  • Solo datos, sin síntesis en el servidor. Cada herramienta devuelve datos crudos y estructurados; a interpretación (si la tendencia es real, qué significa un marcador Breakout, qué se merece señalar) ocurre en la conversación que llama, no está incrustada en las piezas de escrita. Esto simplifica el servidor y deja que el que estén llamando (Claude, otro cliente MCP) aplique su buen juicio.

  • Sin dependencias específicas aparte de mcp[cli] y pytrends. No se usa base de datos, ni archivo de config, ni un clave.

  • No hay suite de pruebas formal. Esto envuelve un endpoint de terceros procesado con scripting; una suite de pruebas probaría sobre todo estilo de pytrends y la forma actual de respuesta de Google, no este código. En su lugar, cada herramienta se verificó con datos reales Google Trends durante el desarrollo.

Licencia

MIT — consulta LICENSE.

Available Tools

5 tools
interest_by_regionA

Search interest for a keyword broken down by state/region within the given geo.

Args: keyword: a single search term. timeframe: pytrends timeframe string, e.g. "today 12-m". geo: ISO country code (e.g. "IN"), or "" for worldwide.

Returns: A list of records, one per state/region within the specified geo, each containing: - "geoName": the name of the state or region (e.g. "Maharashtra", "Delhi", "Karnataka" for India) - 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
geoNoIN
keywordYes
timeframeNotoday 12-m

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden. It discloses the return shape (list of records with geoName and keyword column), explains the 0-100 relative scale, and notes that values are region-relative. This gives an agent a concrete expectation of the output's meaning. It does not mention side effects, but as a 'search' operation it is implicitly non-mutating. This level of disclosure is solid for a read-only retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a well-organized docstring with a purpose line, Args section, and Returns section. It avoids fluff, and the key scoping constraint is front-loaded. It is slightly longer than strictly necessary (e.g., repeating the 0-100 scale), but every sentence adds useful information, so it earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, no output schema, and no annotations, this description is quite complete. It covers parameter formats, return structure, and the meaning of the interest scale. One minor gap is that for a worldwide geo, it is not explicitly clarified that records will be per country rather than per state/region, but this is a minor ambiguity given the phrase 'state/region within the specified geo.'

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description fully compensates. It defines 'keyword' as a single search term, 'timeframe' with an example format, and 'geo' with ISO code and 'worldwide' option, plus a default. All three parameters are explained beyond the schema, which only lists names and types. This is exemplary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence clearly states the action ('Search interest for a keyword') and the resource/scope ('broken down by state/region within the given geo'). This distinguishes it from siblings like interest_over_time (time series) and related_queries/topics (associations). The purpose is unambiguous and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies a use case (regional breakdown of interest) and provides parameter constraints, but it does not explicitly mention when not to use this tool or name alternative tools. It says 'within the given geo' which hints at context, but there is no direct comparison to siblings. Thus, usage guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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. "IN", "US"), or "" for worldwide.

Returns: A list of records, one per date, each containing: - "date": ISO date string - "isPartial": boolean indicating if the time period is incomplete (True for the most recent period) - One numeric key per keyword (0-100 relative interest value)

ParametersJSON Schema
NameRequiredDescriptionDefault
geoNoIN
keywordsYes
timeframeNotoday 12-m

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses important behaviors: it notes that only the first 5 keywords are used and additional ones are silently dropped, and it explains the 'isPartial' field indicating incomplete time periods. Since no annotations are provided, the description carries the full burden and adequately covers these behavioral nuances. It does not address rate limits or authentication, but for a read-only tool this is acceptable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear Args and Returns sections, front-loads the core purpose, and uses concise bullet points. Every sentence adds information, such as the maximum keyword count and return fields, without unnecessary filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema and no annotations, the description compensates by fully specifying the return format (date, isPartial, numeric per-keyword values) and parameter constraints. It provides everything an agent needs to call the tool correctly, including examples and edge cases, making it contextually complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has minimal descriptions (0% coverage), but the description adds extensive semantic detail: keyword limit and silent drop behavior, example timeframe formats, and the meaning of an empty geo string. This far exceeds the bare schema, making parameter semantics highly clear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns relative Google search interest (0-100) over time for up to 5 keywords compared side by side. This is distinct from siblings like related_queries or interest_by_region, which focus on different dimensions. The specific verb and resource make the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description presents a clear context (temporal interest comparison) but does not explicitly state when to use it over sibling tools. It provides parameter details but no guidance on selecting this tool versus related_queries or interest_by_region. The intended use is implied by the description, not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedinterest_by_region
    • First observedinterest_over_time
    • First observedrelated_queries
    • First observedrelated_topics
    • First observedtrending_now

TDQS

A4.2/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct aspect of Google Trends data: time series, related queries, related topics, regional breakdown, and trending now. Even the two 'related' tools are clearly separated by query strings vs topic clusters, so there's no ambiguity in selecting the right tool.

Naming Consistency4/5

All tool names use snake_case and are descriptive, but they don't follow a unified verb-noun pattern. 'interest_over_time' and 'interest_by_region' are noun phrases, 'related_queries' and 'related_topics' are adjective-noun, and 'trending_now' is verb-adverb. Despite this slight mix, the naming is intuitive and predictable.

Tool Count5/5

Five tools is well-scoped for a Google Trends server, covering the core data endpoints without redundancy. Each tool serves a clear purpose, and the count is within the ideal range for a focused integration.

Completeness4/5

The toolkit covers the essential Google Trends operations: time series, related queries/topics, regional interest, and trending searches. Minor gaps exist, such as no multi-keyword comparison for related data or a dedicated city-level breakdown, but the core workflows are fully supported.

Maintenance

ActivityMaintained
ResponsivenessResponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers