npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@andrewlwn77/google-trends-mcp

v1.0.0

Published

MCP server for Google Trends API integration - Access trending topics, questions, and search data

Downloads

11

Readme

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

Installation

Option 1: Using npx (Recommended)

# 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