Google Search MCP Server
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Provides Google search capabilities to AI models through an MCP server interface, allowing for advanced search queries with filtering options for date, language, country, and safe search
Integrates with Google Cloud Platform for API credentials and Custom Search capabilities needed to power the Google search functionality
Built For use with Cline + VS Code!
Google Search MCP Server
An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
Features
- Advanced Google Search with filtering options (date, language, country, safe search)
- Detailed webpage content extraction and analysis
- Batch webpage analysis for comparing multiple sources
- Environment variable support for API credentials
- Comprehensive error handling and user feedback
- MCP-compliant interface for seamless integration with AI assistants
Prerequisites
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- Google Cloud Platform account
- Custom Search Engine ID
- Google API Key
Installation
- Clone the repository:Copy
- Install Node.js dependencies:Copy
- Install Python dependencies:Copy
- Build the TypeScript code:Copy
- Create a helper script to start the Python servers (Windows example):Copy
Configuration
API Credentials
You can provide Google API credentials in two ways:
- Environment Variables (Recommended):
- Set
GOOGLE_API_KEY
andGOOGLE_SEARCH_ENGINE_ID
in your environment - The server will automatically use these values
- Set
- Configuration File:
- Create an
api-keys.json
file in the root directory:
Copy - Create an
MCP Settings Configuration
Add the server configuration to your MCP settings file:
For Cline (VS Code Extension)
File location: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
For Claude Desktop App
File location: %APPDATA%\Claude\claude_desktop_config.json
Running the Server
Method 1: Start Python Servers Separately (Recommended)
- First, start the Python servers using the helper script:Copy
- Configure the MCP settings to run only the Node.js server:Copy
Method 2: All-in-One Script
Start both the TypeScript and Python servers with a single command:
Available Tools
1. google_search
Search Google and return relevant results from the web. This tool finds web pages, articles, and information on specific topics using Google's search engine.
2. extract_webpage_content
Extract and analyze content from a webpage, converting it to readable text. This tool fetches the main content while removing ads, navigation elements, and other clutter.
3. extract_multiple_webpages
Extract and analyze content from multiple webpages in a single request. Ideal for comparing information across different sources or gathering comprehensive information on a topic.
Example Usage
Here are some examples of how to use the Google Search MCP tools:
Basic Search
Advanced Search with Filters
Content Extraction
Multiple Content Comparison
Getting Google API Credentials
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Custom Search API
- Create API credentials (API Key)
- Go to the Custom Search Engine page
- Create a new search engine and get your Search Engine ID
- Add these credentials to your
api-keys.json
file
Error Handling
The server provides detailed error messages for:
- Missing or invalid API credentials
- Failed search requests
- Invalid webpage URLs
- Network connectivity issues
Architecture
The server consists of two main components:
- TypeScript MCP Server: Handles MCP protocol communication and provides the tool interface
- Python Flask Server: Manages Google API interactions and webpage content analysis
License
MIT
You must be authenticated.
An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.