这是一个使用Google自定义搜索API提供网络搜索功能并具备网页内容提取功能的Model Context Protocol服务器。
创建一个Google Cloud项目:
启用自定义搜索API:
获取API密钥:
创建自定义搜索引擎:
安装依赖项:
npm install
构建服务器:
npm run build
开发时自动重建:
npm run watch
使用Google自定义搜索API执行网络搜索:
从任何网页提取内容:
要通过Smithery自动安装Google自定义搜索服务器到Claude桌面:
npx -y @smithery/cli install @adenot/mcp-google-search --client claude
要在Claude桌面中使用,请添加包含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",
"@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
}
}
{
"name": "read_webpage",
"arguments": {
"url": "https://example.com"
}
}
网页阅读器示例响应:
{
"title": "示例域名",
"text": "提取并清理的网页内容...",
"url": "https://example.com"
}
由于MCP服务器通过标准I/O通信,调试可能会比较困难。我们推荐使用作为包脚本提供的MCP Inspector:
npm run inspector
Inspector会提供一个URL,以便您可以在浏览器中访问调试工具。