SerpMCP
SerpMCP
一个用于 Google 搜索的 模型上下文协议 (MCP) 服务器,通过 AceDataCloud API 使用 SERP API。
直接从 Claude、VS Code 或任何兼容 MCP 的客户端执行 Google 搜索并获取结构化结果。
功能
网页搜索 - 带有结构化结果的常规 Google 网页搜索
图片搜索 - 搜索带有 URL 和缩略图的图片
新闻搜索 - 获取关于任何主题的最新新闻文章
视频搜索 - 查找来自 YouTube 和其他来源的视频
地点搜索 - 搜索本地企业和地点
地图搜索 - 查找位置和地理信息
知识图谱 - 获取结构化的实体信息
本地化 - 支持多个国家和语言
时间过滤 - 按时间范围过滤结果
Related MCP server: SerpApi MCP Server
工具参考
工具 | 描述 |
| 搜索 Google 并使用 SERP API 获取结构化结果。 |
| 搜索 Google 图片并获取图片结果。 |
| 搜索 Google 新闻并获取新闻文章结果。 |
| 搜索 Google 视频并获取视频结果。 |
| 在 Google 上搜索本地地点和企业。 |
| 在 Google 地图上搜索位置。 |
| 列出所有可用的 Google 搜索类型。 |
| 列出 Google 搜索常用的国家代码。 |
| 列出 Google 搜索常用的语言代码。 |
| 列出 Google 搜索可用的时间范围过滤器。 |
| 获取使用 Google SERP 工具的综合指南。 |
快速入门
1. 获取您的 API 令牌
在 AceDataCloud 平台 注册
前往 API 文档页面
点击 “Acquire” 获取您的 API 令牌
复制令牌以供下方使用
2. 使用托管服务器(推荐)
AceDataCloud 托管了一个受管理的 MCP 服务器 —— 无需本地安装。
端点: https://serp.mcp.acedata.cloud/mcp
所有请求都需要 Bearer 令牌。请使用第 1 步中的 API 令牌。
Claude.ai
通过 OAuth 直接在 Claude.ai 上连接 —— 无需 API 令牌:
前往 Claude.ai 设置 → 集成 → 添加更多
输入服务器 URL:
https://serp.mcp.acedata.cloud/mcp完成 OAuth 登录流程
开始在对话中使用这些工具
Claude Desktop
添加到您的配置中(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Cursor / Windsurf
添加到您的 MCP 配置中(.cursor/mcp.json 或 .windsurf/mcp.json):
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}VS Code (Copilot)
添加到您的 VS Code MCP 配置中(.vscode/mcp.json):
{
"servers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}或者为 VS Code 安装 Ace Data Cloud MCP 扩展,它一键捆绑了所有 15 个 MCP 服务器。
JetBrains IDEs
前往 设置 → 工具 → AI Assistant → 模型上下文协议 (MCP)
点击 添加 → HTTP
粘贴:
{
"mcpServers": {
"serp": {
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Claude Code
Claude Code 原生支持 MCP 服务器:
claude mcp add serp --transport http https://serp.mcp.acedata.cloud/mcp \
-h "Authorization: Bearer YOUR_API_TOKEN"或者添加到您项目的 .mcp.json 中:
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Cline
添加到 Cline 的 MCP 设置中(.cline/mcp_settings.json):
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Amazon Q Developer
添加到您的 MCP 配置中:
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Roo Code
添加到 Roo Code MCP 设置中:
{
"mcpServers": {
"serp": {
"type": "streamable-http",
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Continue.dev
添加到 .continue/config.yaml 中:
mcpServers:
- name: serp
type: streamable-http
url: https://serp.mcp.acedata.cloud/mcp
headers:
Authorization: "Bearer YOUR_API_TOKEN"Zed
添加到 Zed 的设置中(~/.config/zed/settings.json):
{
"language_models": {
"mcp_servers": {
"serp": {
"url": "https://serp.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}
}cURL 测试
# Health check (no auth required)
curl https://serp.mcp.acedata.cloud/health
# MCP initialize
curl -X POST https://serp.mcp.acedata.cloud/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'3. 或者本地运行(替代方案)
如果您更喜欢在自己的机器上运行服务器:
# Install from PyPI
pip install mcp-serp
# or
uvx mcp-serp
# Set your API token
export ACEDATACLOUD_API_TOKEN="your_token_here"
# Run (stdio mode for Claude Desktop / local clients)
mcp-serp
# Run (HTTP mode for remote access)
mcp-serp --transport http --port 8000Claude Desktop (本地)
{
"mcpServers": {
"serp": {
"command": "uvx",
"args": ["mcp-serp"],
"env": {
"ACEDATACLOUD_API_TOKEN": "your_token_here"
}
}
}
}Docker (自托管)
docker pull ghcr.io/acedatacloud/mcp-serp:latest
docker run -p 8000:8000 ghcr.io/acedatacloud/mcp-serp:latest客户端使用自己的 Bearer 令牌进行连接 —— 服务器会从每个请求的 Authorization 标头中提取令牌。
可用工具
搜索工具
工具 | 描述 |
| 带有所有选项的灵活 Google 搜索 |
| 搜索图片 |
| 搜索新闻文章 |
| 搜索视频 |
| 搜索本地地点/企业 |
| 搜索地图位置 |
信息工具
工具 | 描述 |
| 列出可用的搜索类型 |
| 列出用于本地化的国家代码 |
| 列出用于本地化的语言代码 |
| 列出时间范围过滤选项 |
| 获取综合使用指南 |
使用示例
基础网页搜索
User: Search for information about artificial intelligence
Claude: I'll search for information about AI.
[Calls serp_google_search with query="artificial intelligence"]带时间过滤器的新闻搜索
User: What's the latest news about technology?
Claude: I'll search for recent tech news.
[Calls serp_google_news with query="technology", time_range="qdr:d"]本地化搜索
User: Find popular restaurants in Tokyo
Claude: I'll search for restaurants in Tokyo.
[Calls serp_google_places with query="popular restaurants Tokyo", country="jp"]图片搜索
User: Find images of the Northern Lights
Claude: I'll search for aurora borealis images.
[Calls serp_google_images with query="Northern Lights aurora borealis"]搜索参数
搜索类型
类型 | 描述 |
| 常规网页搜索(默认) |
| 图片搜索 |
| 新闻文章 |
| 地图结果 |
| 本地企业 |
| 视频结果 |
时间范围过滤器
代码 | 时间范围 |
| 过去一小时 |
| 过去一天 |
| 过去一周 |
| 过去一月 |
常用国家代码
代码 | 国家 |
| 美国 |
| 英国 |
| 中国 |
| 日本 |
| 德国 |
| 法国 |
常用语言代码
代码 | 语言 |
| 英语 |
| 中文(简体) |
| 日语 |
| 西班牙语 |
| 法语 |
| 德语 |
响应结构
常规搜索结果
knowledge_graph: 实体信息(公司、人物等)
answer_box: 直接答案
organic: 带有标题、链接、摘要的常规搜索结果
people_also_ask: 相关问题
related_searches: 相关查询
图片搜索结果
images: 带有 URL 和缩略图的图片结果
新闻搜索结果
news: 带有来源和日期的新闻文章
配置
环境变量
变量 | 描述 | 默认值 |
| 来自 AceDataCloud 的 API 令牌 | 必需 |
| API 基础 URL |
|
| OAuth 客户端 ID(托管模式) | — |
| 平台基础 URL |
|
| 请求超时(秒) |
|
| 日志级别 |
|
命令行选项
mcp-serp --help
Options:
--version Show version
--transport Transport mode: stdio (default) or http
--port Port for HTTP transport (default: 8000)开发
设置开发环境
# Clone repository
git clone https://github.com/AceDataCloud/SerpMCP.git
cd SerpMCP
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
# Install with dev dependencies
pip install -e ".[dev,test]"运行测试
# Run unit tests
pytest
# Run with coverage
pytest --cov=core --cov=tools
# Run integration tests (requires API token)
pytest tests/test_integration.py -m integration代码质量
# Format code
ruff format .
# Lint code
ruff check .
# Type check
mypy core tools构建与发布
# Install build dependencies
pip install -e ".[release]"
# Build package
python -m build
# Upload to PyPI
twine upload dist/*项目结构
SerpMCP/
├── core/ # Core modules
│ ├── __init__.py
│ ├── client.py # HTTP client for SERP API
│ ├── config.py # Configuration management
│ ├── exceptions.py # Custom exceptions
│ └── server.py # MCP server initialization
├── tools/ # MCP tool definitions
│ ├── __init__.py
│ ├── search_tools.py # Search tools
│ └── info_tools.py # Information tools
├── prompts/ # MCP prompt templates
│ └── __init__.py
├── tests/ # Test suite
│ ├── conftest.py
│ ├── test_client.py
│ └── test_config.py
├── deploy/ # Deployment configs
│ └── production/
│ ├── deployment.yaml
│ ├── ingress.yaml
│ └── service.yaml
├── .env.example # Environment template
├── .gitignore
├── CHANGELOG.md
├── Dockerfile # Docker image for HTTP mode
├── docker-compose.yaml # Docker Compose config
├── LICENSE
├── main.py # Entry point
├── pyproject.toml # Project configuration
└── README.mdAPI 参考
此服务器封装了 AceDataCloud Google SERP API:
贡献
欢迎贡献!请:
Fork 本仓库
创建功能分支 (
git checkout -b feature/amazing)提交您的更改 (
git commit -m 'Add amazing feature')推送到分支 (
git push origin feature/amazing)开启 Pull Request
许可证
MIT 许可证 - 详情请参阅 LICENSE。
链接
由 AceDataCloud 用心制作
Available Tools
11 toolsserp_get_usage_guideGet Google search usage guideARead-onlyIdempotentInspect
Get a comprehensive guide for using the Google SERP tools.
Provides detailed information on how to use the SERP search tools
effectively, including parameters, examples, and best practices.
Returns:
Complete usage guide for SERP tools.
Inputs: no named parameters. Returns: result
serp_google_imagesSearch Google ImagesCRead-onlyInspect
Search Google Images and get image results.
Performs a Google Image search and returns structured image results.
Inputs: query (required), page, number, country, +2 more. Returns: result
serp_google_mapsSearch Google MapsCRead-onlyInspect
Search Google Maps for locations.
Performs a Google Maps search and returns structured map results.
Inputs: query (required), page, number, country, +1 more. Returns: result
serp_google_newsSearch Google NewsCRead-onlyInspect
Search Google News and get news article results.
Performs a Google News search and returns structured news results.
Inputs: query (required), page, number, country, +2 more. Returns: result
serp_google_placesSearch Google PlacesCRead-onlyInspect
Search Google for local places and businesses.
Performs a Google Places search and returns structured place results.
Inputs: query (required), page, number, country, +1 more. Returns: result
serp_google_searchSearch GoogleBRead-onlyInspect
Search Google and get structured results using the SERP API.
Performs a Google search and returns the complete JSON response from the API,
preserving all available fields and data.
Args:
query: The search query string. Required.
search_type: Type of search to perform. Options:
- "search": Regular web search (default)
- "images": Image search
- "news": News articles
- "maps": Map results
- "places": Local business/place results
- "videos": Video results
country: Country code for localized results (e.g., "us", "cn", "uk").
Default is "us".
language: Language code for results (e.g., "en", "zh-cn", "fr").
Default is "en".
time_range: Time filter for results. Options:
- "qdr:h": Past hour
- "qdr:d": Past day
- "qdr:w": Past week
- "qdr:m": Past month
- None: No time restriction (default)
number: Number of results per page (default: 10).
Note: More than 10 results may incur additional credits.
page: Page number for pagination (default: 1).
Returns:
Complete JSON response from the SERP API containing all available data.
Example:
serp_google_search(query="artificial intelligence", search_type="news")
Inputs: query (required), page, number, country, +4 more. Returns: result
serp_google_videosSearch Google VideosCRead-onlyInspect
Search Google Videos and get video results.
Performs a Google Video search and returns structured video results.
Inputs: query (required), page, number, country, +1 more. Returns: result
serp_list_countriesList search country codesARead-onlyIdempotentInspect
List commonly used country codes for Google search.
Shows common country codes that can be used to localize search results.
Returns:
Table of country codes and their countries.
Inputs: no named parameters. Returns: result
serp_list_languagesList search language codesARead-onlyIdempotentInspect
List commonly used language codes for Google search.
Shows common language codes that can be used to get results in specific languages.
Returns:
Table of language codes and their languages.
Inputs: no named parameters. Returns: result
serp_list_search_typesList Google search typesARead-onlyIdempotentInspect
List all available Google search types.
Shows all available search types and their use cases.
Use this to understand which search type to use for your query.
Returns:
Table of all search types with descriptions.
Inputs: no named parameters. Returns: result
serp_list_time_rangesList search time filtersARead-onlyIdempotentInspect
List available time range filters for Google search.
Shows all time range options that can be used to filter results by date.
Returns:
Table of time range codes and their meanings.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
The serp_list_* and serp_get_usage_guide tools are distinct, but serp_google_search accepts a search_type parameter covering images/news/videos/places/maps while separate tools exist for each of those same verticals. This creates multiple overlapping search tools with unclear boundaries, so an agent may struggle to choose between the general and specialized versions.
All tools use a consistent serp_ prefix and snake_case naming, with predictable groupings: serp_list_* for reference lists, serp_get_* for guides, and serp_google_* for search actions. The pattern is easy to follow and no naming convention is mixed.
At 11 tools, the set is within a reasonable range for a Google SERP API wrapper. However, the five specialized search tools duplicate functionality already available through serp_google_search, so the surface is slightly larger than necessary.
The tool set covers the apparent domain well: it provides a general Google search, all major search verticals (images, news, videos, places, maps), and reference lists for search types, countries, languages, and time ranges. There are no obvious missing operations for a read-only SERP search server.
Maintenance
Related MCP Connectors
Hosted SEO MCP server for AI agents: keyword research, live Google SERPs and Maps, local rank tracking, backlinks, site audits, competitor research, and Search Console data.
Google SERP API MCP: live Google, Bing, AI Overview and Google Maps results as JSON. Pay per call.
Web search API and MCP server for developers building AI agents.
Live Google Maps business search, review, and photo data for AI agents over MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceAn 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.262-
- AlicenseAqualityAmaintenanceAn MCP server that integrates with SerpApi to retrieve search results from multiple search engines including Google, Bing, Yahoo, and others, enabling fast access to both live and archived search data.4188MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) based search API server that provides standardized access to Google Maps, Google Flights, Google Hotels and other services. This server enables AI assistants to access various search services through a unified interface.74MIT
- -licenseNot gradedqualityNot gradedmaintenanceAn MCP (Multi-Agent Conversation Protocol) Server that enables interaction with Google's Custom Search API, allowing agents to perform customized web searches through natural language requests.-