这是一个提供网页搜索功能的模型上下文协议(MCP)服务器,借助谷歌自定义搜索API和网页内容提取功能,为用户提供便捷的网页搜索与内容提取服务。
npm install
npm run build
npm run watch
使用谷歌自定义搜索API执行网页搜索:
提取任何网页内容:
要自动通过Smithery安装适用于Claude桌面的谷歌自定义搜索服务器:
npx -y @smithery/cli install @adenot/mcp-google-search --client claude
与Claude桌面一起使用时,添加包含你的谷歌API凭证的服务器配置:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json{
"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"
}
}
}
}
{
"name": "search",
"arguments": {
"query": "你的搜索查询",
"num": 5 // 可选,默认为5,范围1-10
}
}
{
"name": "extract",
"arguments": {
"url": "网页链接"
}
}
{
"items": [
{
"title": "结果标题1",
"link": "https://example.com/1",
"snippet": "结果摘录1"
},
// 其他结果...
]
}
{
"title": "页面标题",
"text": "页面正文内容..."
}
使用DEBUG=mcp-google-search环境变量启用调试输出:
DEBUG=mcp-google-search npm start