Google Search MCP Server is a powerful server that enables AI models to perform Google searches and analyze webpage content programmatically. It provides a standardized interface for searching the web, extracting content, and analyzing webpages through an MCP-compliant API.
npm install
npm run build
Set these as system environment variables or configure them in your MCP settings file:
GOOGLE_API_KEY
: Your Google API keyGOOGLE_SEARCH_ENGINE_ID
: Your Custom Search Engine IDAdd the server configuration to your MCP settings file (typically located at %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"google-search": {
"autoApprove": [
"google_search",
"extract_webpage_content",
"extract_multiple_webpages"
],
"disabled": false,
"timeout": 60,
"command": "node",
"args": [
"/path/to/google-search-mcp-server/dist/google-search.js"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"transportType": "stdio"
}
}
}
Start the MCP server:
npm run start
Search Google and return relevant results from the web:
{
"name": "google_search",
"arguments": {
"query": "your search query",
"num_results": 5, // optional, default: 5
"site": "example.com", // optional, limit results to specific website
"language": "en", // optional, filter by language (ISO 639-1 code)
"dateRestrict": "m6", // optional, filter by date (e.g., "m6" for last 6 months)
"exactTerms": "exact phrase", // optional, search for exact phrase
"resultType": "news", // optional, specify type (news, images, videos)
"page": 2, // optional, page number for pagination (starts at 1)
"resultsPerPage": 10, // optional, results per page (max: 10)
"sort": "date" // optional, sort by "date" or "relevance" (default)
}
}
The response includes:
Extract and analyze content from a webpage:
{
"name": "extract_webpage_content",
"arguments": {
"url": "https://example.com",
"format": "markdown" // optional, format options: "markdown" (default), "html", or "text"
}
}
The response includes:
Extract and analyze content from multiple webpages in a single request:
{
"name": "extract_multiple_webpages",
"arguments": {
"urls": [
"https://example1.com",
"https://example2.com"
],
"format": "html" // optional, format options: "markdown" (default), "html", or "text"
}
}
The response includes:
The server provides detailed error messages for:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google-search" '{"autoApprove":["google_search","extract_webpage_content","extract_multiple_webpages"],"disabled":false,"timeout":60,"command":"node","args":["/path/to/google-search-mcp-server/dist/google-search.js"],"env":{"GOOGLE_API_KEY":"your-google-api-key","GOOGLE_SEARCH_ENGINE_ID":"your-custom-search-engine-id"},"transportType":"stdio"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"google-search": {
"autoApprove": [
"google_search",
"extract_webpage_content",
"extract_multiple_webpages"
],
"disabled": false,
"timeout": 60,
"command": "node",
"args": [
"/path/to/google-search-mcp-server/dist/google-search.js"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"transportType": "stdio"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"google-search": {
"autoApprove": [
"google_search",
"extract_webpage_content",
"extract_multiple_webpages"
],
"disabled": false,
"timeout": 60,
"command": "node",
"args": [
"/path/to/google-search-mcp-server/dist/google-search.js"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"transportType": "stdio"
}
}
}
3. Restart Claude Desktop for the changes to take effect