使用说明
基本能力
产品定位
Google Search MCP Server 是一个为 AI 模型提供 Google 搜索和网页内容分析能力的中间件服务。
核心功能
- 高级 Google 搜索(支持日期、语言、国家/地区和安全搜索过滤)
- 详细的网页内容提取和分析
- 批量网页分析(用于比较多个来源)
- 支持环境变量的 API 凭据配置
- 全面的错误处理和用户反馈
- 符合 MCP 协议的接口,便于与 AI 助手无缝集成
适用场景
- AI 辅助研究时需要进行网络搜索
- 需要从多个网页来源提取和比较信息
- 自动化内容分析和摘要生成
工具列表
- google_search:使用 Google 搜索引擎查找网页、文章和特定主题的信息
- extract_webpage_content:从单个网页提取和分析内容,转换为可读文本
- extract_multiple_webpages:从多个网页提取和分析内容,便于比较不同来源
常见问题解答
- 如何获取 Google API 凭据?
- 需要在 Google Cloud Console 创建项目并启用 Custom Search API
- 然后创建 API Key 和 Custom Search Engine ID
- 如何处理搜索失败?
- 服务器会提供详细的错误信息,包括无效凭据、网络问题等
使用教程
使用依赖
- Node.js (v16 或更高版本)
- Python (v3.8 或更高版本)
- Google Cloud Platform 账号
- Custom Search Engine ID
- Google API Key
安装教程
-
克隆仓库:
git clone https://github.com/your-username/google-search-mcp.git cd google-search-mcp -
安装 Node.js 依赖:
npm install -
安装 Python 依赖:
pip install flask google-api-python-client flask-cors beautifulsoup4 trafilatura markdownify -
构建 TypeScript 代码:
npm run build -
创建启动 Python 服务器的帮助脚本(Windows 示例):
# 创建 start-python-servers.cmd @echo off echo Starting Python servers for Google Search MCP... REM 启动 Python 搜索服务器 start "Google Search API" cmd /k "python google_search.py" REM 启动 Python 链接查看器 start "Link Viewer" cmd /k "python link_view.py" echo Python servers started. You can close this window.
调试方式
-
推荐方法:单独启动 Python 服务器
start-python-servers.cmd然后配置 MCP 设置只运行 Node.js 服务器
-
或者使用一体化脚本:
npm run start:all -
测试搜索功能:
Search for information about artificial intelligence -
测试内容提取:
Extract the content from https://example.com/article