Back to MCP directory
publicPublicdnsLocal runtime

Gemini Search MCP Server

一个基于Gemini API和Google搜索的MCP服务器,为AI助手提供实时信息查询功能

article

README

🚀 使用双子星搜索的MCP服务器

这是一个借助Gemini API和Google Search,基于最新信息生成回答的MCP服务器。此服务器不能单独运行,需与AI助手(如Cline)配合使用。将该项目加载到AI助手中,即可启用Gemini搜索功能。

MCP 服务器

🚀 快速开始

此MCP服务器需与AI助手结合使用,加载项目到AI助手后,Gemini搜索功能便可启用。

✨ 主要特性

工具

  • search - 利用Gemini 2.0和Google Search生成答案。它接收查询作为输入,返回Gemini的回答以及相关搜索结果。

📦 安装指南

安装依赖

npm install

构建

npm run build

设置环境变量

在项目根目录创建一个.env文件,内容如下:

GEMINI_API_KEY=your_api_key_here

⚠️ 重要提示

您可以在Google AI Studio获取Gemini API密钥。

💻 使用示例

开发期间自动构建

npm run watch

与Claude Desktop配合使用

在Windows系统中,在%APPDATA%/Claude/claude_desktop_config.json添加以下配置:

{
  "mcpServers": {
    "gemini": {
      "command": "node",
      "args": ["path/to/gemini-search-server/build/index.js"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here"
      }
    }
  }
}

调试

由于MCP服务器通过stdio通信,推荐使用MCP Inspector进行调试:

npm run inspector

Inspector会提供一个可在浏览器中访问调试工具的URL。

📄 许可证

此项目的代码在MIT License下发布。但需注意,该项目使用了Google Gemini API,受Google的服务条款约束。在使用此MCP服务器时,您必须同时遵守我们代码的MIT许可证和Gemini API的Google服务条款。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client