谷歌搜索MCP服务器
](https://smithery.ai/server/@gradusnikov/google-search-mcp-server)
提供Google自定义搜索功能的模型上下文协议(MCP)服务器。
安装
通过Smithery安装
通过以下方式自动为Claude Desktop安装谷歌搜索mcp服务器 史密瑟里:
npx -y @smithery/cli install @gradusnikov/google-search-mcp-server --client claude手动安装
- 克隆存储库:
git clone https://github.com/gradusnikov/google-search-mpc-server.git
cd google-search-mpc-server- 安装依赖项:
pip install fastmcp google-api-python-client python-dotenv配置
创建一个 .env 项目根目录中的文件,包含以下变量:
GOOGLE_API_KEY=your_google_api_key
GOOGLE_CSE_ID=your_custom_search_engine_id要获取这些凭据:
- 创建Google Cloud项目并启用自定义搜索API
- 从Google云控制台生成API密钥
- 在以下位置创建自定义搜索引擎https://cse.google.com/cse/all并获取其ID
用法
使用MCP启动服务器:
mcp run google_search_mcp_server.py或将服务器添加到Claude Desktop应用程序 *CLAUDE_DIRECTORY/CLAUDE_desktop_config json*。例如,如果您使用的是Windows Linux子系统(WSL),它可能看起来像这样:
"google-search": {
"command": "wsl.exe",
"args": [
"bash",
"-c",
"source /home/[user]/anaconda3/etc/profile.d/conda.sh && conda activate mcp && /home/[user]/anaconda3/bin/mcp run /home/[user]/google-search-mpc-server/google_search_mcp_server.py"
]
},