Google Search MCP Server

Google Search MCP Server

site icon
2025.03.20 2
PythonGoogle 搜索API 集成搜索工具
Google Search MCP Server 是一个基于模型上下文协议(MCP)的服务,提供 Google 自定义搜索功能。它允许用户通过 API 访问 Google 的搜索服务,适用于需要集成 Google 搜索功能的应用程序或工具。
View on GitHub

Overview

基本能力

产品定位

Google Search MCP Server 是一个提供 Google 自定义搜索功能的 MCP 服务,旨在为开发者提供便捷的 Google 搜索 API 集成方案。

核心功能

  1. 提供 Google 自定义搜索功能
  2. 支持通过 MCP 协议与其他工具或应用集成
  3. 可通过环境变量配置 API 密钥和自定义搜索引擎 ID

适用场景

  1. 需要集成 Google 搜索功能的应用程序
  2. 开发需要搜索功能的工具或服务
  3. 自动化搜索任务

工具列表

  1. google-api-python-client:用于与 Google API 交互
  2. fastmcp:用于实现 MCP 协议
  3. python-dotenv:用于管理环境变量

常见问题解答

  1. 如何获取 Google API 密钥和自定义搜索引擎 ID?
  2. 创建 Google Cloud 项目并启用 Custom Search API
  3. 从 Google Cloud Console 生成 API 密钥
  4. 在 https://cse.google.com/cse/all 创建自定义搜索引擎并获取其 ID

使用教程

使用依赖

  1. 确保已安装 Python 和 pip
  2. 确保已安装 git(用于克隆仓库)

安装教程

通过 Smithery 安装

npx -y @smithery/cli install @gradusnikov/google-search-mcp-server --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/gradusnikov/google-search-mpc-server.git
cd google-search-mpc-server
  1. 安装依赖:
pip install fastmcp google-api-python-client python-dotenv

配置

创建 .env 文件并添加以下内容:

GOOGLE_API_KEY=your_google_api_key
GOOGLE_CSE_ID=your_custom_search_engine_id

调试方式

启动服务器:

mcp run google_search_mcp_server.py

或者将服务器添加到 Claude Desktop 应用的配置文件中。

许可证

None