> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xhuoapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Search MCP Integration Guide

> serp MCP 服务器集成

[MCP (Model Context Protocol)](https://modelcontextprotocol.io) is a model context protocol launched by Anthropic that allows AI models (such as Claude, GPT, etc.) to call external tools through standardized interfaces. With the SERP MCP Server provided by XHuoAPI, you can directly perform Google searches in AI clients like Claude Desktop, VS Code, Cursor, etc., to obtain search results for web pages, images, news, videos, locations, and more.

## Feature Overview

The SERP MCP Server provides the following core functionalities:

* **Web Search** — Search Google web results
* **Image Search** — Search Google images
* **News Search** — Search Google news
* **Video Search** — Search Google videos
* **Location Search** — Search Google location information
* **Map Search** — Search Google maps
* **Multilingual and Multiregional** — Supports custom country and language parameters
* **Time Range Filtering** — Filter results by day, week, month, year

## Prerequisites

Before use, you need to obtain an XHuoAPI API Token:

1. Register or log in to the [XHuoAPI platform](https://api.xhuoapi.ai)
2. Go to the [Google SERP API](https://api.xhuoapi.ai/documents/serp-google) page
3. Click "Acquire" to get the API Token (first-time applicants receive free credits)

## Installation Configuration

### Method 1: pip Installation (Recommended)

```bash theme={null}
pip install mcp-serp
```

### Method 2: Source Installation

```bash theme={null}
git clone https://github.com/XHuoAPI/SerpMCP.git
cd SerpMCP
pip install -e .
```

Once the installation is complete, you can use the `mcp-serp` command to start the service.

## Using in Claude Desktop

Edit the Claude Desktop configuration file:

* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

Add the following configuration:

```json theme={null}
{
  "mcpServers": {
    "serp": {
      "command": "mcp-serp",
      "env": {
        "XHuoAPI_API_TOKEN": "Your API Token"
      }
    }
  }
}
```

If using `uvx` (no need to install the package in advance):

```json theme={null}
{
  "mcpServers": {
    "serp": {
      "command": "uvx",
      "args": ["mcp-serp"],
      "env": {
        "XHuoAPI_API_TOKEN": "Your API Token"
      }
    }
  }
}
```

After saving the configuration, restart Claude Desktop to use the Google search-related tools in the conversation.

## Using in VS Code / Cursor

Create a `.vscode/mcp.json` in the project root directory:

```json theme={null}
{
  "servers": {
    "serp": {
      "command": "mcp-serp",
      "env": {
        "XHuoAPI_API_TOKEN": "Your API Token"
      }
    }
  }
}
```

Or use `uvx`:

```json theme={null}
{
  "servers": {
    "serp": {
      "command": "uvx",
      "args": ["mcp-serp"],
      "env": {
        "XHuoAPI_API_TOKEN": "Your API Token"
      }
    }
  }
}
```

## Available Tools List

| Tool Name            | Description            |
| -------------------- | ---------------------- |
| `serp_google_search` | Google web search      |
| `serp_google_images` | Google image search    |
| `serp_google_news`   | Google news search     |
| `serp_google_videos` | Google video search    |
| `serp_google_places` | Google location search |
| `serp_google_maps`   | Google map search      |

## Usage Examples

After configuration, you can directly call these functions in the AI client using natural language, for example:

* "Help me search for the latest AI papers"
* "Search for good hotpot restaurants in Beijing"
* "Find images about Python asynchronous programming"
* "Search for today's tech news"
* "Find nearby cafes on the map"

## More Information

* GitHub Repository: [XHuoAPI/SerpMCP](https://github.com/XHuoAPI/SerpMCP)
* PyPI Package: [mcp-serp](https://pypi.org/project/mcp-serp/)
* API Documentation: [Search Engine API](https://api.xhuoapi.ai/documents/serp)
