Google Search MCP Server

by moritalous
Apache 2.0

Integrations

  • Manages environment variables for storing Google API credentials and configuration

  • Enables web search capabilities through Google Search API, allowing retrieval of up to 20 search results in JSON format

  • Provides the interface between AI assistants and the Google Search API functionality

Google 搜索 MCP 服务器

该项目是一个模型上下文协议 (MCP) 服务器,为 AI 助手提供 Google 搜索 API 功能。

概述

Google Search MCP Server 是一种工具,可让您的 AI 助手使用 Google Search API 执行网络搜索。我们使用 Gradio 和 MCP 来提供 AI 助手和 Google 搜索 API 之间的接口。

功能

  • 使用 Google 搜索 API 搜索网页
  • 以 JSON 格式返回搜索结果
  • 获取最多 20 个搜索结果

先决条件

  • Python 3.12 或更高版本
  • Google 自定义搜索引擎 ID
  • Google API 密钥

安装

  1. 克隆存储库:
git clone https://github.com/yourusername/google-search-mcp-server.git cd google-search-mcp-server
  1. 安装依赖项:
pip install -e .
  1. 设置环境变量:

.env.sample文件复制到.env并添加必要的 API 密钥:

cp .env.sample .env

编辑.env文件并设置以下值:

GOOGLE_CSE_ID=あなたのGoogleカスタム検索エンジンID GOOGLE_API_KEY=あなたのGoogleAPIキー

如何使用

要启动服务器:

python app.py

这将启动 Gradio 界面并充当 MCP 服务器。

与 MCP 集成

该服务器使用模型上下文协议(MCP)与AI助手集成。 AI助手可以通过该服务器访问谷歌搜索功能。

API 参考

执行网络搜索

perform_web_search(query: str, num_results: int = 10)

参数

  • query (str):搜索查询(最多 400 个字符,50 个单词)
  • num_results (int):结果数(1-20,默认10)。

返回

  • str :JSON格式的搜索结果
-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器,使 AI 助手能够使用 Google 搜索 API 执行网络搜索,并以 JSON 格式返回最多 20 个搜索结果。

  1. 概述
    1. 功能
      1. 先决条件
        1. 安装
          1. 如何使用
            1. 与 MCP 集成
              1. API 参考
                1. 执行网络搜索

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.
                Last updated -
                2,806
                • Apple
              • A
                security
                F
                license
                A
                quality
                A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
                Last updated -
                1
                44
                8
                JavaScript
                • Apple
                • Linux
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that provides real-time web search capabilities to AI assistants through pluggable search providers, currently integrated with the Brave Search API.
                Last updated -
                3
                TypeScript
                MIT License
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server implementation that enables AI assistants like Claude to perform Google searches and retrieve web data directly through natural language requests.
                Last updated -
                1
                75
                3
                TypeScript
                MIT License

              View all related MCP servers

              ID: pqwszp1v9d