这是一个具备 Google 搜索功能与网页内容分析工具的 Model Context Protocol (MCP) 服务器。借助该服务器,AI 模型能够以编程方式开展 Google 搜索并对网页内容进行分析。
此服务器可让 AI 模型通过编程执行 Google 搜索并分析网页内容。你可以按照以下步骤进行安装、配置、构建和运行。
npm install
pip install flask google-api-python-client flask-cors
api-keys.json
文件,包含你的 Google API 凭据:{
"api_key": "your-google-api-key",
"search_engine_id": "your-custom-search-engine-id"
}
%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):{
"mcpServers": {
"google-search": {
"command": "npm",
"args": ["run", "start:all"],
"cwd": "/path/to/google-search-server"
}
}
}
npm run build
同时启动 TypeScript 和 Python 服务器:
npm run start:all
或者分别运行它们:
npm start
npm run start:python
执行 Google 搜索并获取结果。
{
"name": "search",
"arguments": {
"query": "your search query",
"num_results": 5 // 可选, 默认值:5
}
}
从单个网页提取并分析内容。
{
"name": "analyze_webpage",
"arguments": {
"url": "https://example.com"
}
}
在一次请求中分析多个网页。
{
"name": "batch_analyze_webpages",
"arguments": {
"urls": [
"https://example1.com",
"https://example2.com"
]
}
}
可根据实际需求调整搜索参数和分析策略,以满足不同场景的需求。
服务器由两个主要部分组成:
本项目采用 MIT 许可证。
api-keys.json
文件中。服务器为以下情况提供详细的错误消息: