mcp-google-server A MCP Server for Google Custom Search and Webpage Reading

mcp-google-server A MCP Server for Google Custom Search and Webpage Reading

site icon
2025.02.08 13
JavaScript网页搜索内容提取搜索工具
mcp-google-search 是一个基于 Model Context Protocol 的服务,提供使用 Google 自定义搜索 API 进行网页搜索和网页内容提取的功能。它允许用户通过 API 进行网络搜索,并提取网页的主要内容,适用于需要集成搜索和内容提取功能的应用程序。
View on GitHub

Overview

基本能力

产品定位

mcp-google-search 是一个提供网页搜索和内容提取功能的 MCP 服务,主要用于集成 Google 自定义搜索和网页内容解析能力到其他应用中。

核心功能

  1. 搜索工具
  2. 使用 Google 自定义搜索 API 进行网页搜索
  3. 可以搜索整个网络或特定网站
  4. 控制返回结果数量(1-10)
  5. 获取结构化结果,包括标题、链接和摘要

  6. 网页阅读器工具

  7. 从任何网页提取内容
  8. 提取页面标题和主要内容
  9. 清理内容,移除脚本和样式
  10. 返回包含标题、文本和 URL 的结构化数据

适用场景

  • 需要集成网络搜索功能的应用程序
  • 需要提取网页内容的自动化工具
  • 需要结构化搜索结果的开发项目

工具列表

  1. search:执行网络搜索
  2. read_webpage:提取网页内容

常见问题解答

  • 调试建议:使用 MCP Inspector 进行调试
  • API 限制:需要有效的 Google API 密钥和搜索引擎 ID

使用教程

使用依赖

  1. 获取 Google API 密钥和搜索引擎 ID
  2. 创建 Google Cloud 项目
  3. 启用 Custom Search API
  4. 获取 API 密钥
  5. 创建自定义搜索引擎

安装教程

  1. 通过 Smithery 安装:
npx -y @smithery/cli install @adenot/mcp-google-search --client claude
  1. 配置 Claude Desktop 使用该服务:
{
  "mcpServers": {
    "google-search": {
      "command": "npx",
      "args": [
        "-y",
        "@adenot/mcp-google-search"
      ],
      "env": {
        "GOOGLE_API_KEY": "your-api-key-here",
        "GOOGLE_SEARCH_ENGINE_ID": "your-search-engine-id-here"
      }
    }
  }
}

调试方式

使用 MCP Inspector 进行调试:

npm run inspector

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。