Google MCP Server - MCP服务,MCP服务器,MCP教程

基本能力

产品定位

Google MCP Server 是一个实现了模型上下文协议(MCP)的服务,用于与Google API集成,支持AI助手和其他MCP兼容客户端的连接。

核心功能

  1. googleSearchContent: 使用Google Custom Search API执行网页搜索,并返回结构化的结果(标题、链接和摘要)。
  2. googleSearchImages: 使用Google Custom Search API执行图像搜索,并返回第一个结果的Markdown图像链接。

适用场景

  1. 需要集成Google搜索功能的AI助手。
  2. 需要结构化搜索结果的MCP兼容客户端。
  3. 需要图像搜索功能的应用程序。

工具列表

  1. googleSearchContent: 执行网页搜索并返回结构化结果。
  2. googleSearchImages: 执行图像搜索并返回图像链接。

常见问题解答

  1. 确保Google API密钥和CX ID正确设置在.env文件或环境中。
  2. 检查所有依赖是否已安装(npm install)。
  3. 确认使用Node.js 18或更新版本。
  4. 如果修改了代码,重启服务器或测试脚本。

使用教程

使用依赖

  1. Node.js 18+
  2. npm

安装教程

  1. 克隆仓库
    sh
    git clone https://github.com/your-username/mcp-google-search.git
    cd google-mcp-server
  2. 安装依赖
    sh
    npm install
  3. 设置Google Custom Search API凭证
    在项目根目录创建.env文件,内容如下:
    GOOGLE_API_KEY=your_google_api_key_here
    GOOGLE_CX_ID=your_custom_search_engine_id_here

调试方式

  1. 运行测试搜索
    sh
    npx ts-node src/test.ts
  2. 与MCP兼容客户端集成
    在MCP设置文件中添加如下条目:
    json
    {
    "mcpServers": {
    "google-api": {
    "command": "npx",
    "args": ["ts-node", "src/index.ts"],
    "env": {
    "GOOGLE_API_KEY": "your_google_api_key_here",
    "GOOGLE_CX_ID": "your_custom_search_engine_id_here"
    }
    }
    }
    }

点击访问

搜索工具

🔍 GitHub MCP Server Search API - MCP服务,MCP服务器,MCP教程

2025-4-29 11:44:15

搜索工具

Search Engine with RAG and MCP - MCP服务,MCP服务器,MCP教程

2025-4-29 11:44:22

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索