SerpAPI Google Trends MCP Server
Provides access to Google Trends data via SerpAPI, enabling analysis of regional search interest, seasonal trends, service comparison, and related queries.
Click on "Install 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., "@SerpAPI Google Trends MCP ServerCompare HVAC services in Alabama and Missouri"
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.
SerpAPI Google Trends MCP Server
A Model Context Protocol (MCP) server that provides access to Google Trends data via SerpAPI. Perfect for analyzing regional search interest patterns to make data-driven decisions about advertising and service offerings.
Built with FastMCP.
Use Case: Regional Service Marketing
This MCP server is designed to help service-based businesses answer questions like:
Which cities in Alabama and Missouri show the most interest in our HVAC services?
Should we advertise furnace repair or heat pump services in Huntsville this winter?
When does demand for heating services peak in St. Louis?
What related services are customers searching for in our target markets?
Related MCP server: Serpapi Universal MCP Server
Features
πΊοΈ Interest by Region: See which geographic areas have highest search interest
π Interest Over Time: Understand seasonal trends and timing patterns
βοΈ Service Comparison: Compare multiple services across multiple locations
π Related Queries: Discover new keyword opportunities
π Data-Driven Insights: All data from Google Trends with 0-100 interest scale
Installation
Prerequisites
Python 3.10 or higher
SerpAPI account with API key (Sign up here)
Claude Desktop or Claude Code CLI
Setup
Create the directory structure:
cd serpapi-trends-mcpInstall dependencies:
pip install -r requirements.txtConfigure API credentials:
cp .env.example .envEdit
.envand add your SerpAPI key:SERPAPI_KEY=your-api-key-hereGet your API key from: https://serpapi.com/manage-api-key
Usage
Claude Desktop Integration
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"serpapi-trends": {
"command": "python",
"args": [
"-m",
"serpapi_trends_mcp.server"
],
"cwd": "/absolute/path/to/serpapi-trends-mcp",
"env": {
"SERPAPI_KEY": "your-api-key-here"
}
}
}
}Claude Code Integration
Add to your project's .mcp.json:
{
"mcpServers": {
"serpapi-trends": {
"command": "python",
"args": [
"-m",
"serpapi_trends_mcp.server"
],
"cwd": "/absolute/path/to/serpapi-trends-mcp",
"env": {
"SERPAPI_KEY": "your-api-key-here"
}
}
}
}Or use command line arguments:
{
"mcpServers": {
"serpapi-trends": {
"command": "python",
"args": [
"-m",
"serpapi_trends_mcp.server",
"--api-key",
"your-api-key-here"
],
"cwd": "/absolute/path/to/serpapi-trends-mcp"
}
}
}After adding the configuration, restart Claude Desktop or reconnect Claude Code.
Available Tools
get_interest_by_region
Find which geographic areas show the most interest in your services.
Parameters:
query(required): Search term(s), comma-separated for comparisondate: Time range (default: "today 3-m" for 3 months)resolution: "COUNTRY", "REGION", "CITY" (default), or "DMA"geo: Location code (e.g., "US", "US-AL", "US-MO")
Example:
Find which cities in Alabama search most for HVAC services:
get_interest_by_region(
query="hvac repair,furnace repair,ac repair,heat pump repair",
date="today 3-m",
resolution="CITY",
geo="US-AL"
)get_interest_over_time
Analyze how search interest changes over time to identify seasonal patterns.
Parameters:
query(required): Search term(s), comma-separated for comparisondate: Time range (default: "today 3-m")geo: Location code (e.g., "US-MO")
Example:
Compare heating vs cooling demand in Missouri over the past year:
get_interest_over_time(
query="furnace repair,heating repair,ac repair",
date="today 12-m",
geo="US-MO"
)compare_services_in_cities
Compare multiple services across multiple regions to find the best opportunities.
Parameters:
services(required): Comma-separated service keywordscities(required): Comma-separated region codesdate: Time range (default: "today 3-m")
Example:
Compare HVAC services in Alabama and Missouri:
compare_services_in_cities(
services="hvac repair,furnace repair,ac repair,heat pump repair",
cities="US-AL,US-MO",
date="today 3-m"
)get_related_queries
Discover related search queries to expand keyword targeting.
Parameters:
query(required): Search term to analyzedate: Time range (default: "today 3-m")geo: Location code
Example:
Find related HVAC searches in Alabama:
get_related_queries(
query="hvac repair",
date="today 3-m",
geo="US-AL"
)Available Resources
Browse reference data using MCP resources:
serpapi://us-states: List of US state codes for the geo parameterserpapi://time-ranges: Available time range options with recommendations
Workflow Example: Winter Service Planning
Scenario: You run an HVAC company and want to decide which services to advertise in Huntsville, AL and St. Louis, MO for the upcoming winter season.
Step 1: Compare Services by Region
compare_services_in_cities(
services="furnace repair,heat pump repair,heating system,boiler repair",
cities="US-AL,US-MO",
date="today 3-m"
)Result: See which cities in each state have the highest search interest.
Step 2: Analyze Seasonal Timing
get_interest_over_time(
query="furnace repair,heat pump repair",
date="today 12-m",
geo="US-AL"
)Result: Identify when demand peaks (typically early winter).
Step 3: Find Related Keywords
get_related_queries(
query="furnace repair",
date="today 3-m",
geo="US-AL"
)Result: Discover additional keywords like "emergency heating repair", "furnace maintenance", etc.
Step 4: City-Level Targeting
get_interest_by_region(
query="furnace repair",
date="today 3-m",
resolution="CITY",
geo="US-AL"
)Result: Get specific cities in Alabama ranked by search interest.
Step 5: Make Data-Driven Decisions
Based on the data:
Budget Allocation: Spend more on cities with higher interest scores
Service Focus: Prioritize services with highest regional demand
Campaign Timing: Launch ads when seasonal interest peaks
Keyword Expansion: Include related queries in your targeting
Understanding the Data
Interest Scores (0-100 Scale)
100: Peak popularity for the selected time period and location
50: Half as popular as the peak
0: Less than 1% of peak popularity
Interpreting Results
High interest (70-100): Strong demand, prime target for advertising
Medium interest (40-69): Moderate opportunity, consider if competition is low
Low interest (0-39): Limited demand, may not be cost-effective
Time Ranges Recommendations
Use Case | Recommended Range | Code |
Current market conditions | Past 3 months |
|
Full seasonal patterns | Past year |
|
Long-term planning | Past 5 years |
|
Recent spike analysis | Past week |
|
Pricing
SerpAPI pricing is based on API calls:
Free tier: 100 searches/month
Paid plans: Start at $50/month for 5,000 searches
Each tool call = 1 API search
View pricing: https://serpapi.com/pricing
Project Structure
serpapi-trends-mcp/
βββ src/
β βββ serpapi_trends_mcp/
β βββ __init__.py
β βββ server.py # FastMCP server with tools & resources
β βββ client.py # Async SerpAPI wrapper
βββ requirements.txt # Python dependencies
βββ .env.example # Credential template
βββ .env # Your credentials (gitignored)
βββ .gitignore
βββ README.mdDevelopment
Testing Locally
# Run the server directly
python -m serpapi_trends_mcp.server
# Or with command line argument
python -m serpapi_trends_mcp.server --api-key YOUR_KEY
# Test with FastMCP dev mode
fastmcp dev src/serpapi_trends_mcp/server.pyAdding New Tools
Edit src/serpapi_trends_mcp/server.py and add new @mcp.tool decorated functions.
Adding New Endpoints
Edit src/serpapi_trends_mcp/client.py to add new SerpAPI endpoint methods.
Troubleshooting
"Missing SERPAPI_KEY"
Ensure
.envfile exists withSERPAPI_KEY=your-keyOr set environment variable in your shell
Or use
--api-keycommand line argument
"401 Unauthorized"
Verify your API key is correct
Check you haven't exceeded your monthly quota
"No data returned"
Try a broader time range (e.g., "today 12-m")
Try a less specific query term
Some locations may have insufficient search volume
Server not appearing in Claude Desktop
Check the
cwdpath is absolute, not relativeVerify Python is in your PATH
Restart Claude Desktop after config changes
Check Claude Desktop logs for errors
Example Queries for HVAC Business
Research Phase
"What cities in Alabama have the highest demand for HVAC services?"
"Show me search trends for heating services in Missouri over the past year"
"What related services do people search for when looking for furnace repair?"Analysis Phase
"Compare interest in 'heat pump repair' vs 'furnace repair' in Huntsville and St. Louis"
"When does demand for heating services peak in Alabama?"
"Which cities in Missouri show the strongest interest in emergency HVAC services?"Decision Phase
"Based on Google Trends, where should we focus our winter HVAC advertising budget?"
"Create a priority list of cities for our heating service marketing campaign"Resources
License
MIT License
Support
SerpAPI Support: https://serpapi.com/contact
File issues: Create an issue in this repository
MCP Documentation: https://modelcontextprotocol.io
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/geopopos/serpapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server