Google Trends MCP Server
Provides access to Google Trends data, allowing retrieval of relative search interest over the last 12 months for specific terms with optional geographic and category filtering.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Trends MCP Serverfetch trends for 'AI startups' in the US over the last year"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Search Trends Explorer
This project combines a Google Trends visualizer built with Next.js and a Model Context Protocol (MCP) server that exposes the same data as a tool you can connect to OpenAI or any MCP-compatible client. Both experiences call SearchAPI.io to retrieve the last 12 months of relative interest for a search term.
Prerequisites
Node.js 18.18+ (recommended to avoid engine warnings)
A
SEARCH_API_KEYfrom SearchAPI.io
Create a .env file with:
SEARCH_API_KEY=your_key_hereRunning the Next.js UI
npm install
npm run devVisit http://localhost:3000 to use the web interface.
Running the MCP Server
The MCP server exposes a single tool named fetch_google_trends over streamable HTTP.
npm install
npm run mcp:devThe server listens on http://localhost:3000/mcp (honors the PORT env variable) and also serves GET /healthz for Render health checks.
Connecting from an MCP client
MCP Inspector:
npx @modelcontextprotocol/inspector --server http://localhost:3000/mcpOpenAI / other agents: add an HTTP MCP tool pointing to the same
/mcpendpoint.
When invoked, fetch_google_trends expects a JSON payload:
{
"term": "electric cars",
"geo": "US", // optional Google Trends geo code
"category": "0" // optional Google Trends category id
}The tool responds with structured JSON containing the normalized timeline points.
Deploying the MCP server to Render.com
Create a new Web Service from this repository.
Set the start command to:
npm run mcp:startAdd the environment variable
SEARCH_API_KEY.(Optional) Configure Render health checks to hit
/healthz.
Render will inject PORT, which the server automatically respects.
Testing & Linting
npm run lintProject Structure Highlights
app/– Next.js app router with UI and/api/trendsendpoint.lib/trends.ts– Shared SearchAPI client used by both the API route and MCP tool.mcp/server.ts– Express + MCP server exposing thefetch_google_trendstool.
This server cannot be deployed
Maintenance
Related MCP Connectors
Google Trends Scraper API: Interest and Trending Now
Google Trends: Search, Images, News, Shopping over time, growth metrics. Free key at trendsmcp.ai
Bulk Google Trends: interest over time, regions, rising queries and plain-English trend summaries.
Google Trends: interest over time, by region and city, related and rising queries, and Trending Now in any country. Compare keywords on one scale. Runs on Apify, $1 per 1,000 keyword reports.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access Google Trends data for comparing keywords, discovering trending searches, and analyzing regional interest through natural language.2MIT
- AlicenseBqualityDmaintenanceEnables Claude to query Google Trends data such as keyword interest, related queries, and regional popularity, with robust proxy rotation to bypass Google's anti-bot measures.538 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query Google Trends data, including search interest over time, regional breakdowns, trending searches, and keyword ideas.MIT
- AlicenseAqualityAmaintenanceEnables querying Google Trends data directly from conversational MCP clients, including search interest over time, related queries and topics, regional breakdowns, and trending searches, for market research without leaving the chat.111MIT