Google Search MCP Server
Provides Google Search functionality with automatic API key rotation, intelligent quota management, multi-language support, geolocation capabilities, and advanced search filters (date, file type, site-specific).
Integrates with Google Cloud's Custom Search API, managing API keys across Google Cloud projects to maximize free search quotas while providing persistent quota tracking and automatic daily reset.
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., "@Google Search MCP Serverfind recent research papers on quantum computing from the past month"
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.
Google Search MCP Server
A Model Context Protocol (MCP) server that provides Google Search functionality with automatic API key rotation and intelligent quota management.
Features
Official Google Custom Search API integration
Automatic API key rotation for increased daily limits
Persistent quota tracking across sessions and directories
Multi-language and geolocation support
Advanced search filters (date, file type, site-specific)
SafeSearch content filtering
Global configuration - works from anywhere
Compatible with Claude Desktop and other MCP clients
Related MCP server: Google Search Console API MCP Server
Installation
Quick Setup (Recommended)
# Install the package globally
npm install -g @kyaniiii/google-search-mcp
# Run interactive setup
google-search-setupThis will:
✅ Configure your Google API keys interactively
✅ Set up global configuration file
✅ Automatically integrate with Claude Code
✅ Enable 100+ free searches per day per API key
Advanced Installation
git clone https://github.com/Fabien-desablens/google-search-mcp.git
cd google-search-mcp
npm install
npm run build
npm run setupUninstallation
Complete Removal
# Remove the package
npm uninstall -g @kyaniiii/google-search-mcp
# Remove from Claude Code
claude mcp remove google-search
# Remove configuration file (if desired)
npm run cleanNote: Configuration file (~/.google-search-mcp.json) is always preserved during updates and uninstallation to protect your API keys. Use npm run clean only if you want to completely remove your configuration.
Configuration
The setup tool creates a global configuration file at:
Windows:
%USERPROFILE%\.google-search-mcp.jsonLinux/macOS:
~/.google-search-mcp.json
This file contains:
✅ Your API keys and search engine IDs
✅ Persistent quota tracking (survives restarts)
✅ Automatic daily reset at midnight UTC
✅ Cross-directory usage (works from anywhere)
Example Configuration
{
"keys": [
{
"id": "key_1",
"apiKey": "AIzaSy...",
"searchEngineId": "abc123...",
"dailyUsage": 45,
"dailyLimit": 100,
"lastReset": "2024-07-30",
"isActive": true
}
],
"lastUpdated": "2024-07-30T15:30:00Z",
"version": "1.0.0"
}⚠️ Important: If you manually edit the configuration file (~/.google-search-mcp.json), you must restart Claude Desktop for the changes to take effect.
Getting Google API Credentials
1. Create a Google Cloud Project
Go to Google Cloud Console
Create a new project or select existing
Enable the "Custom Search API"
2. Generate API Key
Navigate to "APIs & Services" > "Credentials"
Click "Create Credentials" > "API Key"
Copy the generated key
3. Create Custom Search Engine
Click "Get started" or "Add"
For "Sites to search", enter
*to search the entire webCopy the Search Engine ID
4. Scale with Multiple Keys
Each Google Cloud project provides 100 free searches/day
Create multiple projects for more quota (e.g., 3 projects = 300 searches/day)
The server automatically rotates between available keys
Usage with Claude Code
After running the setup, the server is automatically configured in Claude Code. You can immediately use it:
User: "Search for latest AI news from this week"
Claude: I'll search for the latest AI news using Google Search...The server exposes a google_search tool with these parameters:
Required Parameters
query(string): Search query
Optional Parameters
num(number): Number of results (1-10, default: 5)start(number): Starting index for resultssafe(string): SafeSearch level ('off', 'active')lr(string): Language restriction (e.g., 'lang_en', 'lang_fr')gl(string): Geolocation (country code: 'us', 'fr', 'uk')dateRestrict(string): Time period ('d1', 'w1', 'm1', 'y1')fileType(string): File type filter ('pdf', 'doc', 'ppt')siteSearch(string): Search specific sitesiteSearchFilter(string): Include ('i') or exclude ('e') sitecr(string): Country restriction ('countryUS', 'countryFR')exactTerms(string): Exact phrase to includeexcludeTerms(string): Terms to excludeorTerms(string): Alternative terms (OR search)sort(string): Sort by date ('date')searchType(string): Search type ('image' for image search)
Examples
Basic Search
{
"query": "artificial intelligence news"
}Advanced Search
{
"query": "machine learning",
"num": 10,
"lr": "lang_en",
"gl": "us",
"dateRestrict": "m1",
"fileType": "pdf"
}Site-Specific Search
{
"query": "typescript tutorial",
"siteSearch": "stackoverflow.com",
"siteSearchFilter": "i"
}Quota Management
The server provides real-time quota information in each response:
{
"results": [...],
"metadata": {
"quotaStatus": {
"totalUsed": 15,
"totalLimit": 300,
"keysStatus": [
{
"id": "key_1",
"used": 15,
"limit": 100,
"remaining": 85,
"active": true
}
]
}
}
}Quota Features
Automatic daily reset at midnight UTC
Intelligent key rotation when limits are reached
Disabled keys automatically reactivate after reset
Persistent tracking across server restarts
No charges - stops at free tier limits
Error Handling
The server gracefully handles various error scenarios:
Quota Exceeded: Automatically rotates to next available key
All Keys Exhausted: Returns clear error message with quota status
Invalid API Key: Disables the key and continues with others
Network Errors: Returns detailed error information
Development
Prerequisites
Node.js 18+
TypeScript
Google Cloud account
Scripts
# Development mode with auto-reload
npm run dev
# Build for production
npm run build
# Start server
npm start
# Setup configuration
npm run setupProject Structure
google-search-mcp/
├── src/
│ ├── index.ts # Entry point
│ ├── server.ts # MCP server setup
│ ├── config.ts # Configuration wrapper
│ ├── global-config.ts # Global config manager
│ └── tools/
│ └── search.ts # Search implementation
├── build/ # Compiled JavaScript
├── setup.js # Interactive setup tool
└── package.jsonContributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues, questions, or contributions, please visit: https://github.com/Fabien-desablens/google-search-mcp
Available Tools
1 toolgoogle_searchA
Performs Google searches using the official API with automatic API key rotation.
Features:
Official Google Web Search
Automatic API key rotation
Intelligent quota management
Multi-language and geolocation support
Parameters:
query: Search query (required)
num: Number of results (1-10, default: 5)
start: Starting index (default: 1)
safe: SafeSearch (off/active, default: off)
lr: Language (ex: lang_fr, lang_en)
gl: Country (ex: fr, us, uk)
Returns a JSON list of results with title, link, description and domain.
| Name | Required | Description | Default |
|---|---|---|---|
| cr | No | Country restriction (ex: countryFR, countryUS) | |
| dateRestrict | No | Time filter (ex: d1=24h, w1=week, m1=month, y1=year) | |
| exactTerms | No | Exact phrase required | |
| excludeTerms | No | Words to exclude from search | |
| fileType | No | File type (ex: pdf, doc, ppt) | |
| gl | No | Geolocation (country code: fr, us, uk, etc.) | |
| lr | No | Results language (ex: lang_fr, lang_en) | |
| num | No | Number of results to return (1-10) | |
| orTerms | No | Alternative terms (OR) | |
| query | Yes | Google search query | |
| rights | No | License filters (ex: cc_publicdomain) | |
| safe | No | SafeSearch level | |
| searchType | No | Search type (value: image) | |
| siteSearch | No | Search specific site (ex: reddit.com) | |
| siteSearchFilter | No | Include (i) or exclude (e) the site | |
| sort | No | Sort by date (value: date) | |
| start | No | Starting index of results |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations provide openWorldHint=true, indicating broad applicability. The description adds valuable behavioral context beyond annotations: it discloses API key rotation, intelligent quota management, and specifies the return format (JSON list with title, link, description, domain). This compensates well for the lack of other annotations like rate limits or authentication needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (Features, Parameters, Returns) and front-loaded key information. It's appropriately sized but includes some redundancy (e.g., listing parameters that are fully covered in the schema). Every sentence adds value, though it could be slightly more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (17 parameters) and lack of output schema, the description does well by explaining the return format and key behavioral traits. It covers purpose, features, and basic usage, though it could benefit from more detailed guidelines or error handling info. With good annotations and schema coverage, it's mostly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 17 parameters. The description lists only 6 parameters (query, num, start, safe, lr, gl) with minimal details like defaults and examples, adding little beyond the schema. Baseline 3 is appropriate as the schema handles most parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs Google searches using the official API with automatic key rotation. It specifies the exact action ('performs Google searches') and resource ('official API'), and distinguishes itself by highlighting unique features like API key rotation and quota management. With no sibling tools, this level of specificity is excellent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage through the listed features (e.g., 'Multi-language and geolocation support') but doesn't explicitly state when to use this tool versus alternatives. With no sibling tools, there's no need to differentiate, but it lacks explicit guidance on prerequisites or ideal use cases beyond the feature list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is clearly defined as performing Google searches, leaving no ambiguity for an agent to misselect among alternatives.
The single tool name 'google_search' follows a clear and consistent verb_noun pattern. Since there are no other tools to compare against, the naming is inherently consistent and predictable within this server's scope.
A single tool is too few for a server named 'Google Search MCP Server', as it suggests a broader scope that might include related operations like image search, news search, or search history management. The tool count feels thin and limited for the apparent domain.
The server is severely incomplete for a Google Search domain, as it only provides basic web search functionality. Obvious gaps include missing tools for image search, news search, video search, search suggestions, or advanced filtering, which are typical in such APIs and would be needed for comprehensive agent workflows.
Maintenance
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
MCP server for Google search results via SERP API
SEO MCP server for keyword research, SERP analysis, audits, and Search Console workflows.
All HasData scraping tools in one MCP server: Google, TikTok, Instagram, maps, e-commerce and more.
Related MCP Servers
- AlicenseBqualityFmaintenanceA powerful MCP server that enables parallel Google searching with multiple keywords simultaneously, providing structured results while handling CAPTCHAs and simulating user browsing patterns.198272MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP Server that provides access to Google's Search Console API, allowing users to interact with website search performance data and manage search presence through natural language.
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Google Custom Search API through natural language, allowing users to perform searches programmatically via the Multi-Agent Conversation Protocol.
- AlicenseAqualityDmaintenanceA powerful Model Context Protocol (MCP) server that provides enhanced Google search capabilities with advanced anonymization and anti-detection features.14MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/Fabien-desablens/google-search-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server