谷歌AI概述抓取器
通过Chrome扩展程序中继删除Google AI Overviews。可作为HTTP API和MCP服务器用于人工智能代理,如Claude Code、Claude Desktop和Cursor。
没有浏览器焦点窃取。查询在后台选项卡中运行。
MCP Client / HTTP Client
↕
MCP Server (stdio or SSE)
↕ httpx
Shared FastAPI Backend (:15551)
↕ polling
Chrome Extension
→ background tab → scrape → result先决条件
- Python 3.13+
- 紫外线
- Chrome或其他基于Chromium的浏览器
快速安装
uvx google-ai-scraper从Chrome网上应用商店安装已发布的扩展程序:
https://chromewebstore.google.com/detail/google-ai-overview-scrape/oidaeopefkgfpeigcjapebhppnbcocpc?authuser=1&hl=en
然后打开扩展的选项页面,将服务器URL设置为 http://localhost:15551.
对于MCP客户端,最简单的配置是:
{
"mcpServers": {
"google-ai-scraper": {
"command": "uvx",
"args": ["google-ai-scraper"]
}
}
}每个MCP客户端进程自动重用或自动启动上的共享后端 127.0.0.1:15551,因此多个Claude Code窗口可以使用相同的配置,而无需手动设置SSE。
地方发展设置
1.安装依赖项
cd server
uv sync2.安装延长件
从Chrome网上应用商店安装已发布的扩展程序:
https://chromewebstore.google.com/detail/google-ai-overview-scrape/oidaeopefkgfpeigcjapebhppnbcocpc?authuser=1&hl=en
然后打开扩展的选项页面,将服务器URL设置为 http://localhost:15551.
3.启动本地后端进行直接HTTP测试
cd server
uv run google-ai-scraper --backend --port 15551如果你在开发过程中更喜欢原始的FastAPI,这也适用:
cd server
uv run uvicorn google_ai_scraper.app:app --port 155514.验证
# Check server + extension connectivity
curl -s http://localhost:15551/health
# Run a query
curl -s "http://localhost:15551/ask?q=what+is+photosynthesis" | python3 -m json.toolHTTP API
FastAPI后端直接公开这些端点:
| 端点 | 方法 | 描述 |
|---|---|---|
/ask?q={query} | GET | 搜索。退货 {query, query_id, thread_id, markdown, citations} |
/ask?q={query}&thread_id={id} | GET | 在现有线程中跟进 |
/thread/{thread_id} | DELETE | 关闭线程及其选项卡 |
/health | GET | 服务器状态、扩展连接、队列深度 |
# Search
curl -s "http://localhost:15551/ask?q=what+is+rust+programming" | python3 -m json.tool
# Follow-up (use thread_id from previous response)
curl -s "http://localhost:15551/ask?q=how+does+ownership+work&thread_id=abc123def456" | python3 -m json.tool
# Close thread
curl -s -X DELETE "http://localhost:15551/thread/abc123def456"MCP 服务器
MCP服务器将HTTP API封装为AI代理的3个工具。在默认的stdio模式下,每个MCP客户端进程都会自动重用或自动启动端口上的共享后端 15551.
MCP工具
| 工具 | 参数 | 描述 |
|---|---|---|
search | query | 搜索谷歌人工智能概述。返回降价、引用和 thread_id 以便后续跟进。 |
follow_up | query, thread_id | 在现有线程中继续对话。 |
health | -- | 检查服务器和扩展连接。 |
线程在2分钟不活动后自动过期。
选项A:标准运输
推荐给大多数用户。这是最简单的设置,即使在多个Claude Code窗口中也能很好地工作。
使用已发布的软件包:
{
"mcpServers": {
"google-ai-scraper": {
"command": "uvx",
"args": ["google-ai-scraper"]
}
}
}使用来自源的本地签出:
{
"mcpServers": {
"google-ai-scraper": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/server",
"google-ai-scraper"
]
}
}
}替换 /absolute/path/to/server 与完整的路径 server/ 目录。
选项B:SSE运输
仍然支持显式始终开启设置。运行共享后端和MCP SSE服务器一次,然后通过URL连接客户端。
启动这两项服务:
cd server
./start-services.sh
# FastAPI on :15551, MCP SSE on :8001客户端配置:
{
"mcpServers": {
"google-ai-scraper": {
"type": "sse",
"url": "http://localhost:8001/sse"
}
}
}工作室与SSE
| 站起来 | ||
|---|---|---|
| MCP进程生命周期 | 每个客户端会话的新进程 | 持久共享MCP服务器 |
| FastAPI后端 | 自动启动或重新使用 :15551 | 通常与SSE一起明确开始 |
| 用户设置 | 最简单 | 最适合始终在线的共享服务设置 |
| 推荐给 | 大多数用户 | 高级/共享基础架构 |
LaunchAgent(macOS)
登录时自动启动共享后端和SSE服务器,崩溃时重新启动。包含的plist跑步 start-services.sh.
# Edit the plist if your clone path differs from /Users/balakumar/personal/google-ai-scraper
cp com.google-ai-scraper.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.google-ai-scraper.plist验证:
curl -s http://localhost:15551/health
curl -s http://localhost:8001/sse --max-time 2日志:
tail -f /tmp/google-ai-scraper.log /tmp/google-ai-scraper.err停止:
launchctl unload ~/Library/LaunchAgents/com.google-ai-scraper.plist配置
| 环境变量 | 默认值 | 描述 |
|---|---|---|
GOOGLE_AI_SCRAPER_URL | http://127.0.0.1:15551 | MCP进程的FastAPI后端URL |
更改FastAPI端口
如果您从端口更改 15551:
- 启动后端或MCP流程
--port XXXX,或设置GOOGLE_AI_SCRAPER_URL. - 将扩展的选项页面更新为相同
http://localhost:XXXXURL。 manifest.json已经允许所有localhost端口,因此不需要更改主机权限。
