一个使用Google搜索结果进行免费网络搜索的Model Context Protocol (MCP)服务器,无需API密钥。
npm install
npm run build
对于VSCode(Claude Dev扩展):
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}
对于Claude Desktop:
{
"mcpServers": {
"web-search": {
"command": "node",
"args": ["/path/to/web-search/build/index.js"]
}
}
}
该服务器提供了一个名为search的工具,接受以下参数:
{
"query": string, // 搜索查询
"limit": number // 可选:要返回的结果数量(默认:5,最大:10)
}
使用示例:
use_mcp_tool({
server_name: "web-search",
tool_name: "search",
arguments: {
query: "your search query",
limit: 3 // 可选
}
})
响应示例:
[
{
"title": "Example Search Result",
"url": "https://example.com",
"description": "Description of the search result..."
}
]
由于此工具使用了对Google搜索结果的网页抓取,需要注意一些重要的限制:
速率限制:如果短时间内执行过多搜索,Google可能会暂时阻止请求。为了避免这种情况:
结果准确性:
法律考量:
欢迎提交问题和改进请求!