Skip to main content
Glama
andrewlwn77

Google Trends MCP Server

by andrewlwn77

Google Trends MCP Server

npm version

⚠️ IMPORTANT SECURITY NOTICE: Never commit API keys to version control. This package requires an API key to be set via environment variable.

An MCP (Model Context Protocol) server that provides access to Google Trends data through the Google Trends Scraper API.

Features

  • Status: Check the API status and health

  • Questions: Get trending questions from Google Trends

  • Trending: Get currently trending topics from Google Trends

Related MCP server: bigquery-google-trends-mcp

Installation

# Set your API key first
export GOOGLE_TRENDS_API_KEY="your-api-key-here"

# Run directly with npx
npx @andrewlwn77/google-trends-mcp

Option 2: Global Installation

npm install -g @andrewlwn77/google-trends-mcp

Option 3: Local Development

git clone <repository-url>
cd google-trends-mcp
npm install
npm run build

Configuration

Optional: You can set the GOOGLE_TRENDS_API_KEY environment variable. If not set, a default API key will be used.

  1. Get an API key from RapidAPI Google Trends Scraper

  2. Set the environment variable:

    # Option 1: Export in your shell
    export GOOGLE_TRENDS_API_KEY="your-api-key-here"
    
    # Option 2: Create a .env file (for local development)
    echo "GOOGLE_TRENDS_API_KEY=your-api-key-here" > .env

⚠️ Security: Never commit your .env file or API key to version control!

Usage

Running the server

# If installed globally or using npx
google-trends-mcp

# For local development
npm start

# For development with auto-reload
npm run dev

Available Tools

1. google_trends_status

Check the status of the Google Trends API.

Parameters:

  • language (optional): Language code (default: "en")

  • country (optional): Country code (default: "US")

2. google_trends_questions

Get trending questions from Google Trends.

Parameters:

  • language (optional): Language code (default: "en")

  • country (optional): Country code (default: "US")

3. google_trends_trending

Get currently trending topics from Google Trends.

Parameters:

  • language (optional): Language code (default: "en")

  • country (optional): Country code (default: "US")

Example Usage with MCP Client

// Check API status
const status = await client.callTool('google_trends_status', {
  language: 'en',
  country: 'US'
});

// Get trending questions
const questions = await client.callTool('google_trends_questions', {
  language: 'en',
  country: 'US'
});

// Get trending topics
const trending = await client.callTool('google_trends_trending', {
  language: 'en',
  country: 'US'
});

Configuration

The server can be configured using environment variables:

  • GOOGLE_TRENDS_API_KEY: Your RapidAPI key for the Google Trends Scraper API (optional, defaults to example key)

Development

Project Structure

google-trends-mcp/
├── src/
│   ├── index.ts      # Main MCP server implementation
│   └── types.ts      # TypeScript type definitions
├── tests/
│   ├── integration/  # API integration tests
│   ├── unit/         # Unit tests
│   └── helpers/      # Test helper utilities
├── package.json
├── tsconfig.json
├── .env.example
└── README.md

Type Safety

This server is written in TypeScript and provides full type safety for:

  • API parameters

  • API responses

  • Error handling

  • Google Trends data structures

License

MIT

Available Tools

3 tools

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedgoogle_trends_questions
    • First observedgoogle_trends_status
    • First observedgoogle_trends_trending

TDQS

B3.3/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: one for trending questions, one for API status, and one for currently trending topics. There is no overlap or ambiguity.

Naming Consistency5/5

All tools follow a consistent `google_trends_<noun>` pattern, with clear, descriptive names. The verb (get) is implied, and the naming is uniform.

Tool Count4/5

Three tools is minimal but reasonable for a focused server. The count covers the core functionalities—trending topics, related questions, and status—without being excessive.

Completeness3/5

The server covers basic features like trending topics and questions but lacks tools for specific search queries (e.g., interest over time, comparisons). The surface is functional but not comprehensive.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides Google Search trend data as an MCP tool, with historical series, growth percentages, and live trending searches, no scraping or rate limits.
    1
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    MCP server that exposes Google Trends data via BigQuery, enabling LLMs to query top search terms, rising terms, and compare term interest over time for different countries.
    -
  • A
    license
    A
    quality
    D
    maintenance
    Provides free Google Trends data (interest over time, term comparison, related queries, trending now, regional breakdown) to MCP-compatible AI clients without needing an API key.
    5
    98
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server providing access to Google Trends, YouTube listings, Google Ads Transparency, and Google Play reviews via plain HTTP, with no API key required. It caches results and paces requests to work within Google's informal rate limits.
    7
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andrewlwn77/google-trends-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server