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: Google Trends MCP Server

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

Install Server
A
license - permissive license
B
quality
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • F
    license
    -
    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
    B
    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
    53
    MIT

View all related MCP servers

Related MCP Connectors

  • Trend data from Google, TikTok, Amazon, Reddit, YouTube, Steam, npm and more as JSON

  • Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.

  • MCP server for Google search results via SERP API

View all MCP Connectors

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