home / mcp / google trends mcp server

Google Trends MCP Server

Exposes Google Trends data via an MCP-compatible HTTP endpoint for easy integration

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ainightshift-google_trends_mcp": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "SEARCH_API_KEY": "YOUR_KEY_HERE"
      }
    }
  }
}

Search Trends Explorer combines a Next.js UI with an MCP server that exposes the same data as a tool you can connect to OpenAI or any MCP-compatible client. It retrieves the last 12 months of relative interest for a search term from SearchAPI.io and makes it accessible via HTTP MCP endpoints for easy integration.

How to use

You connect to the MCP server from any MCP client to fetch Google Trends data for a term. The server exposes a single tool named fetch_google_trends over streamable HTTP. When you invoke the tool, you provide a term and optional geo and category, and you receive a structured timeline of interest data you can feed into your apps or agents.

How to install

Prerequisites you need before installing the server.

  • Node.js 18.18+ (recommended to avoid engine warnings)
  • A SearchAPI.io API key accessible as SEARCH_API_KEY
# Create a local environment file with your API key
cat > .env << 'ENV'
SEARCH_API_KEY=your_key_here
ENV

Run the MCP server locally

Start the MCP server to expose the fetch_google_trends tool on the standard local port. The server honors the PORT environment variable and provides a health endpoint for checks.

npm install
npm run mcp:dev

Accessing the server

The MCP server will be available at the following endpoint on your machine. Use this URL from your MCP client.

http://localhost:3000/mcp

Connecting from an MCP client

From an MCP client, point your tool at the local MCP endpoint. For example, you can connect via an MCP inspector or an OpenAI-compatible agent that supports MCP HTTP endpoints.

Configure the fetch_google_trends tool usage

When you invoke fetch_google_trends you provide a JSON payload with the search term and optional geo and category. The server returns normalized timeline data suitable for visualization or analysis.

Available tools

fetch_google_trends

Fetch Google Trends timeline data for a given term, optional geo and category, using SearchAPI.io and return normalized timeline points.