AI Personal Learning
and practical guidance
豆包Marscode1

G-Search-MCP: MCP Server for Free Google Search

General Introduction

G-Search-MCP is an open source Google search tool hosted on GitHub by developer jae-jae based on the google-search Modified. It runs through the MCP (Model Context Protocol) server , the core function is to support multiple keywords at the same time in Google search . The search results are returned in JSON format, which is easy for users to process and analyze. This tool uses the Playwright browser to simulate the operation of real users, which can effectively reduce the risk of being blocked by Google. It is suitable for users who need to quickly access a large amount of information, such as developers, researchers or data analysts. The project also provides flexible configuration of parameters, such as the number of results and language selection.

 

Function List

  • Multi-keyword parallel search: Supports simultaneous searching of multiple keywords to improve efficiency.
  • Browser Optimization: Save resources by opening multiple tabs in a single browser instance.
  • CAPTCHA auto-detection: Switch to visible mode when CAPTCHA is found and wait for the user to verify.
  • User behavior simulation: Mimic real user operations to avoid being restricted by search engines.
  • JSON Data Output: Search results are returned in a structured format for ease of use by the program.
  • parameterization: Options such as number of results, timeout period, language region, etc. can be set.

 

Using Help

G-Search-MCP is a technical tool that needs to be installed and configured in order to be used. The installation process and operation are described in detail below.

Installation process

  1. Inspection of environmental requirements
    • Requires Node.js 18 or later, with NPM or Yarn installed.
    • Make sure your computer has Git for downloading code.
    • Prepare a modern browser (e.g. Chromium) and the tool will be installed automatically.
  2. Download Project Code
    • Open a terminal and run the command:
      git clone https://github.com/jae-jae/g-search-mcp.git
      
    • Go to the project catalog:
      cd g-search-mcp
      
  3. Installation of dependencies
    • Enter the command to install the necessary packages:
      npm install
      
  4. Install Playwright Browser
    • Run the following command to install the Chromium browser:
      npx playwright install chromium
      
    • This step ensures that the tool runs the browser instance properly.
  5. Build Server
    • Enter the command to build the project:
      npm run build
      
  6. quick start
    • Use the command to run it directly:
      npx -y g-search-mcp
      
    • The server is ready to use after startup.

Configuring the MCP server (optional)

If you want to be in the Claude Using this tool in Desktop, you can configure the MCP Server:

  • Configuration file path
    • MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows:%APPDATA%/Claude/claude_desktop_config.json
  • Configuration content
    • Edit the JSON file to add the following:
      {
      "mcpServers": {
      "g-search": {
      "command": "npx",
      "args": ["-y", "g-search-mcp"]
      }
      }
      }
      

How to use

basic operation

  1. Single Keyword Search
    • Run command:
      npx -y g-search-mcp --keywords "人工智能"
      
    • The browser opens a tab to display the results and the terminal returns JSON data.
  2. Multi-Keyword Search
    • Enter multiple keywords, separated by commas:
      npx -y g-search-mcp --keywords "人工智能,机器学习"
      
    • The browser will open multiple tabs, one for each keyword.

Featured Function Operation

  1. Adjustment of the number of results
    • utilization --limit Parameters:
      npx -y g-search-mcp --keywords "人工智能" --limit 20
      
    • Returns the first 20 results, default is 10.
  2. Setting the timeout period
    • utilization --timeout Parameters:
      npx -y g-search-mcp --keywords "人工智能" --timeout 120000
      
    • Set the timeout to 120 seconds; the default is 60 seconds.
  3. Change language region
    • utilization --locale Parameters:
      npx -y g-search-mcp --keywords "人工智能" --locale "zh-CN"
      
    • Results are prioritized to display in Chinese.
  4. Enable debug mode
    • increase --debug Parameters:
      npx -y g-search-mcp --keywords "人工智能" --debug
      
    • Visible in the browser window for easy viewing of the operation.
  5. CAPTCHA handling
    • If a CAPTCHA is encountered, the tool pauses and displays the browser window.
    • After the user completes the validation manually, the tool continues to run.
  6. View JSON output
    • After the search is completed, the terminal displays results similar to the following:
      {
      "searches": [
      {
      "query": "人工智能",
      "results": [
      {
      "title": "人工智能简介",
      "link": "https://example.com",
      "snippet": "人工智能是..."
      }
      ]
      }
      ]
      }
      
    • Results can be saved to a file:
      npx -y g-search-mcp --keywords "人工智能" > result.json
      

Development mode (optional)

  • Auto-rebuild: Run npm run watchThe code is modified and automatically updated.
  • Debugging Tools: Run npm run inspectorTo check the operation status, use MCP Inspector.

caveat

  • network connection: Internet access to Google services is required.
  • resource occupancy: Multi-keyword searches may consume more memory.
  • Competence issues: Ensure that the terminal has sufficient privileges to run the command.

Example of operation

Let's say you're searching for "blockchain" and "smart contracts":

  1. Enter the command:
npx -y g-search-mcp --keywords "区块链,智能合约" --limit 15 --locale "zh-CN"
  1. The browser opens two tabs and displays Chinese search results.
  2. The terminal returns JSON data containing the title, link, and summary of each result.

This tool is intuitive and powerful for technical users to collect information in bulk.


 

application scenario

  1. Technical studies
    Developers can use it to search for keywords such as "front-end frameworks" and "back-end technologies" to quickly compare information.
  2. data analysis
    Analysts can use JSON output to analyze keyword results such as "market trends" and "user needs".
  3. Educational support
    Students can use it to search for "physics" and "chemical reactions" for quick access to learning resources.

 

QA

  1. What should I do if Playwright is missing at startup?
    (of a computer) run npx playwright install chromium Install the browser.
  2. What about incomplete search results?
    Check the network, or add --timeout time, such as 120000 milliseconds.
  3. How do I save my search results?
    append > 文件名.jsonFor example npx -y g-search-mcp --keywords "人工智能" > result.jsonThe
May not be reproduced without permission:Chief AI Sharing Circle " G-Search-MCP: MCP Server for Free Google Search
en_USEnglish