Web搜索
启用免费的网络搜索,使用Google搜索结果,无需API密钥,返回带有标题、URL和描述的结构化结果。
服务介绍
Web Search MCP 服务器
一个使用 Google 搜索结果实现自由网络搜索的模型上下文协议 (MCP) 服务器,无需 API 密钥。
特性
- 使用 Google 搜索结果进行网络搜索
- 无需 API 密钥或身份验证
- 返回带有标题、URL 和描述的结构化结果
- 可配置每次搜索的结果数量
安装
- 克隆或下载此仓库
- 安装依赖项:
npm install
- 构建服务器:
npm run build
- 将服务器添加到您的 MCP 配置中:
对于 VSCode (Claude Dev 扩展):
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}
对于 Claude 桌面版:
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}
使用方法
该服务器提供了一个名为 search 的工具,接受以下参数:
{
"query": string, // The search query
"limit": number // Optional: Number of results to return (default: 5, max: 10)
}
示例用法:
use_mcp_tool({
server_name: "web-search",
tool_name: "search",
arguments: {
query: "your search query",
limit: 3 // optional
}
})
示例响应:
[
{
"title": "Example Search Result",
"url": "https://example.com",
"description": "Description of the search result..."
}
]
限制
由于此工具使用了 Google 搜索结果的网页抓取技术,因此需要注意一些重要的限制:
-
速率限制:如果在短时间内执行过多搜索,Google 可能会暂时阻止请求。为了避免这种情况:
- 保持搜索频率合理
- 谨慎使用 limit 参数
- 如有必要,请在搜索之间实施延迟
-
结果准确性:
- 该工具依赖于 Google 的 HTML 结构,这可能会发生变化
- 某些结果可能缺少描述或其他元数据
- 复杂的搜索运算符可能无法按预期工作
-
法律考虑:
- 此工具仅供个人使用
- 遵守 Google 的服务条款
- 根据您的使用情况考虑实现适当的速率限制
贡献
欢迎提交问题和增强请求!