Google 自定义搜索引擎 MCP 服务器
一个模型上下文协议服务器,使用 CSE(自定义搜索引擎)提供搜索功能。该服务器使 LLM 能够提供常规的 Google 搜索词并返回找到的搜索结果。
该工具仅返回结果本身,不包含内容。建议将其与其他服务器(例如mcp-server-fetch)结合使用,以便从搜索结果中提取内容。您也可以将其与其他工具结合使用,以实现某种“深度搜索”或工具链式功能。
免费配额为每天 100 次搜索(1 次工具调用 == 1 次搜索),如果您不想设置计费并且这不足以满足您的使用情况,您应该考虑使用其他服务器。
可用工具
google_search- 使用搜索词搜索自定义搜索引擎并返回包含每个结果的标题、链接和片段的结果列表。search_term(字符串,必需):要搜索的搜索词,相当于通常的 Google 搜索中的查询参数q。
环境变量
API_KEY(必需):自定义搜索引擎的 API 密钥。ENGINE_ID(必需):自定义搜索引擎的引擎 ID。SERVICE_NAME(必需/可选):服务名称,如果您没有更改名称(自定义搜索),则留空。COUNTRY_REGION(可选):将搜索结果限制为来自特定国家/地区的文档。请参阅国家/地区参数值以了解有效值。GEOLOCATION(可选,默认为“us”):执行搜索的最终用户的地理位置。请参阅地理位置参数值以了解有效值。RESULT_LANGUAGE(可选,默认为“lang_en”):搜索结果的语言。请参阅自定义搜索引擎查询参数 lr了解有效值。RESULT_NUM(可选,默认 10):返回的搜索结果数量。范围为 1-10。
CSE 设置
创建自定义搜索引擎相对容易,完全免费,并且可以在 5 分钟内完成。
前往https://console.cloud.google.com/并创建一个新项目。例如,命名为“Claude CSE”。
选择项目并在搜索栏中搜索“自定义搜索 API”。
点击搜索结果,点击“启用”。
单击“凭据”选项卡并创建一个新的 API 密钥。
前往https://programmablesearchengine.google.com创建一个新的自定义搜索引擎。
创建一个新的搜索引擎并赋予它任意名称,该名称与SERVICE_NAME无关。
如果您想要正常的 Google 搜索体验,请选择“搜索整个网络”。
单击“创建”并从 js 代码中复制引擎 ID,或点击自定义并从概览中获取它。
您可以根据自己的喜好随意定制搜索引擎。
使用默认配额,您每天可免费获得 100 次搜索。例如,即使您获得 10 条结果,每次工具调用也仅需支付 1 次搜索的费用。
安装
使用 uv(推荐)
使用uv时无需特殊安装。我们将使用uvx直接运行mcp-google-cse 。
使用 PIP
或者,您可以通过 pip 安装mcp-google-cse :
安装后,您可以使用以下命令将其作为脚本运行:
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Google 自定义搜索引擎:
配置
为 Claude 应用程序配置
添加到您的claude_desktop_config.json :
使用 uvx(如果你不知道选择哪一个,请使用这个)
使用 pip 安装
本地运行
示例结果
google_search("2024-11-01 之后的 MCP 是什么") 结果:
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
使用 Google 自定义搜索引擎实现搜索功能,允许用户输入搜索词并检索搜索结果标题、链接和片段,同时促进与其他工具的集成以进行内容提取和高级搜索策略。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityProvides web search capabilities using Google Custom Search API, enabling users to perform searches through a Model Context Protocol server.Last updated -1,42748MIT License
- Asecurity-licenseAqualityAllows you to search the web using DuckDuckGo and optionally fetch and summarize content from search results.Last updated -23
- Asecurity-licenseAqualityEnables free web searching using Google search results with no API keys required, returning structured results with titles, URLs, and descriptions.Last updated -1273
- -security-license-qualityEnables AI assistants to perform real-time Google searches with anti-bot protection. Bypasses search engine restrictions using advanced browser automation to extract search results locally without requiring paid API services.Last updated -3MIT License