Sponsored by Deepsite.site

google-search-mcp-server

Created By
eggplantiny8 months ago
google search model context server with fetch api (unofficial)
Content

google-search-mcp-server

A ModelContextProtocol (MCP) server that provides Google Search capabilities as a tool. It performs web scraping of Google Search results and returns structured data including titles, URLs, and snippets.

Overview

google-search-mcp-server implements an MCP server exposing a single tool, google_search, which accepts a search query and returns search results in a JSON-compatible format. It supports pagination, configurable language, safe search, result limits, and uses random user agents to reduce scraping detection.

Key features:

  • Google search scraping via HTTP requests
  • Structured JSON output with title, URL, and snippet
  • Supports pagination, result limits, and language/country options
  • "I'm Feeling Lucky" single-result mode
  • Built-in cookie jar and random user-agent for each search

Installation

Requirements:

  • Node.js v16 or higher
  • pnpm or bun for package management

Clone and install dependencies:

git clone https://github.com/yourusername/google-search-mcp-server.git
cd google-search-mcp-server
pnpm install
# or
bun install

Usage

Start the MCP Server

Start the server, which listens for JSON-RPC requests over standard input/output:

npm start

Upon startup, you will see:

Google Search MCP Server running on stdio

Interact with the Server

Use any JSON-RPC 2.0 client (e.g., jq, custom scripts) to list tools and call the google_search tool.

List available tools:

echo '{"jsonrpc":"2.0","method":"ListTools","params":{},"id":1}' | npm start

Call the google_search tool:

echo '{"jsonrpc":"2.0","method":"CallTool","params":{"name":"google_search","arguments":{"query":"OpenAI","num":5}},"id":2}' | npm start

Example response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"results\":[...JSON string of search results...]}"
      }
    ],
    "isError": false
  }
}

Playground

For local experimentation without MCP protocol, use the provided playground.ts script:

npx esno src/playground.ts

This will run example searches and log results to the console.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code