Mcp Google Search

Mcp Google Search

🚀 谷歌搜索的模型上下文协议服务器

本项目是一个提供网络搜索功能的 Model Context Protocol 服务器,借助 Google Custom Search API 和网页内容提取功能,能高效实现网络搜索及网页内容提取。

🚀 快速开始

本服务器结合了 Google Custom Search API 与网页内容提取功能,可实现网络搜索并提取网页内容。

✨ 主要特性

搜索

运用 Google Custom Search API 开展网络搜索,具备如下特点:

  • 可对整个互联网或特定网站进行搜索。
  • 能够控制搜索结果数量(范围为 1 - 10)。
  • 可获取结构化的搜索结果,其中涵盖标题、链接和摘录。

网页阅读器

可从任意网页提取内容,具体功能如下:

  • 抓取并解析网页内容。
  • 提取页面标题和正文文本。
  • 清理内容以去除脚本和样式。
  • 返回结构化数据,包含标题、文本和 URL。

📦 安装指南

获取 Google API 密钥和搜索引擎 ID

  1. 创建 Google Cloud 项目:
    • 访问 Google Cloud Console
    • 可创建新项目,也可选择现有项目。
    • 需启用项目的计费功能。
  2. 启用 Custom Search API:
    • 访问 API 库
    • 搜索 “Custom Search API”。
    • 点击 “启用”。
  3. 获取 API 密钥:
    • 访问 凭证
    • 点击 “创建凭证” > “API Key”。
    • 复制你的 API 密钥。
    • (可选)可将密钥限制为仅 Custom Search API 使用。
  4. 创建 Custom Search 引擎:
    • 访问 Programmable Search Engine
    • 输入要搜索的网站(若要实现全网搜索,可使用 www.google.com)。
    • 点击 “创建”。
    • 在下一步中,点击 “自定义”。
    • 在设置中启用 “搜索整个互联网”。
    • 复制你的 Search Engine ID(cx)。

客户端配置

若要在 Claude Desktop 上使用,需在服务器配置中添加 Google API 凭证:

  • 对于 MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • 对于 Windows:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"google-search": {
"command": "npx",
"args": ["-y", "@mcp-for-dev/mcp-google-search"],
"env": {
"GOOGLE_API_KEY": "你的 API 密钥",
"GOOGLE_SEARCH_ENGINE_ID": "你的搜索引擎 ID"
}
}
}
}
  • 0 关注
  • 0 收藏,8 浏览
  • system 提出于 2025-09-23 11:39

相似服务问题