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.
Clone the repository:
git clone https://github.com/your-username/google-search-mcp.git
cd google-search-mcp
Install Node.js dependencies:
npm install
Install Python dependencies:
pip install flask google-api-python-client flask-cors beautifulsoup4 trafilatura markdownify
Build the TypeScript code:
npm run build
Create a helper script to start the Python servers (Windows example):
# Create start-python-servers.cmd
@echo off
echo Starting Python servers for Google Search MCP...
REM Start Python search server
start "Google Search API" cmd /k "python google_search.py"
REM Start Python link viewer
start "Link Viewer" cmd /k "python link_view.py"
echo Python servers started. You can close this window.
You can provide Google API credentials in two ways:
Environment Variables (Recommended):
GOOGLE_API_KEY
and GOOGLE_SEARCH_ENGINE_ID
in your environmentConfiguration File:
api-keys.json
file in the root directory:{
"api_key": "your-google-api-key",
"search_engine_id": "your-custom-search-engine-id"
}
Add the server configuration to your MCP settings file:
File location: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{
"mcpServers": {
"google-search": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"],
"cwd": "C:\\path\\to\\google-search-mcp",
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"disabled": false,
"autoApprove": []
}
}
}
File location: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google-search": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"],
"cwd": "C:\\path\\to\\google-search-mcp",
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"disabled": false,
"autoApprove": []
}
}
}
First, start the Python servers using the helper script:
start-python-servers.cmd
Configure the MCP settings to run only the Node.js server:
{
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"]
}
Start both the TypeScript and Python servers with a single command:
npm run start:all
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.
{
"name": "google_search",
"arguments": {
"query": "your search query",
"num_results": 5, // optional, default: 5, max: 10
"date_restrict": "w1", // optional, restrict to past day (d1), week (w1), month (m1), year (y1)
"language": "en", // optional, ISO 639-1 language code (en, es, fr, de, ja, etc.)
"country": "us", // optional, ISO 3166-1 alpha-2 country code (us, uk, ca, au, etc.)
"safe_search": "medium" // optional, safe search level: "off", "medium", "high"
}
}
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.
{
"name": "extract_webpage_content",
"arguments": {
"url": "https://example.com"
}
}
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.
{
"name": "extract_multiple_webpages",
"arguments": {
"urls": [
"https://example1.com",
"https://example2.com"
]
}
}
Here are some examples of how to use the Google Search MCP tools:
Search for information about artificial intelligence
Search for recent news about climate change from the past week in Spanish
Extract the content from https://example.com/article
Compare information from these websites:
- https://site1.com/topic
- https://site2.com/topic
- https://site3.com/topic
api-keys.json
fileThe server provides detailed error messages for:
The server consists of two main components:
MIT
Seamless access to top MCP servers powering the future of AI integration.