
gsearch
io.github.RayenMlayeh由 GitHub 帳號 RayenMlayeh 發布v0.1.0更新於 Oct 26, 2026
Real Google Search for AI agents: real URLs, AI Overview and People also ask as typed JSON.
概覽
自架式 MCP 伺服器,以真實 Firefox 瀏覽器取得 Google 搜尋結果並回傳結構化 JSON,不需 API 金鑰。
- 可以做什麼
- 執行 Google 搜尋,回傳自然結果及解析後的真實連結、標題、摘要、日期與子連結
- 讀取 Google 頁面上的答案區塊:AI 概覽、其他人也問、相關搜尋、廣告與分頁
- 抓取公開網頁,回傳標題、可讀正文與主要內容中的連結
- 查詢狀態:代理資料用量與上限、已使用與被封鎖的 IP、快取狀況
- 依頁碼、語言、國家、時間範圍與指定網站限縮搜尋
- 適用情境
- 當助理需要 Google 自家索引(含 AI 概覽與「其他人也問」),而非其他搜尋服務時適用,且需在本機執行瀏覽器。適合以自身 IP 低頻使用的個人或研究用途,或已有代理的環境。
- 執行需求
- 以 Python 套件在本機執行(uvx 或 pipx),透過 stdio 通訊;首次需執行安裝指令下載約 1 GB 的瀏覽器。不需 API 金鑰或帳號。可選用 GSEARCH_PROXY 提高額度、GSEARCH_DATA_LIMIT_MB 限制代理流量,並可用 GSEARCH_ENV_FILE 指定設定檔。無圖形介面的 Linux 伺服器需安裝 Xvfb 以執行可見的瀏覽器視窗。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 gsearch,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[gsearch: Google Search for AI agents. Real results as clean JSON, over MCP.]
[Tests] [PyPI] [Python 3.12+] [MIT license] [MCP server]
Quick start · How it compares · What you get · How it works · Proxies · Performance · FAQ
Real Google Search for your AI agent. No API key. Self-hosted. Over MCP.
Your agent calls google_search and gets Google's actual results page as typed JSON: every link resolved to
its real URL, plus Google's answer boxes (sports results, top stories, videos), the AI Overview, People
also ask and related searches. A real Firefox
(Camoufox) runs Google's page as it is, on your own IP or through any
proxy you already have.
Why: plain HTTP gets a JavaScript wall, automated Chrome got a CAPTCHA 2 out of 2 times in our test, and Google's official Custom Search API closes on 1 January 2027. Other search MCP servers either aren't Google's index (Brave, Tavily, Exa, DuckDuckGo) or charge per query (SerpApi, Bright Data).
A real, live call on a home IP with a warm session, rendered from the recorded result; the wait shown is the measured time. MP4
🚀 Quick start
Then just ask: "Search Google for what asyncio is and give me the top three links", "What do people also ask about asyncio?", "Find asyncio pages on python.org from the past year.", "Search for the asyncio docs and summarize the first result."
Without a proxy, gsearch uses your own IP, at most 20 searches an hour. For more, add a proxy in any format:
Claude Desktop, Cursor and other MCP clients
gsearch setup prints this block with the full path of gsearch-mcp filled in. Use the full path if your
client doesn't find the command.
Claude Desktop: claude_desktop_config.json. Cursor: ~/.cursor/mcp.json, or .cursor/mcp.json in a
project.
No install, with uv: use "command": "uvx", "args": ["gsearch-agent"], after fetching the browser once
with uvx --from gsearch-agent gsearch setup.
Settings in a file: put them in a .env (see .env.example) and set
GSEARCH_ENV_FILE to its absolute path instead.
[!NOTE] Automated access to Google Search may breach Google's Terms of Service. Read Legal and responsible use before running live searches.
🆚 How it compares
The same comparison as text
"Varies": we did not test those projects. Our only Chromium measurement is F-0001: Playwright Chrome was sent to a CAPTCHA 2 of 2 times on an IP where gsearch was served. Read Legal before running live searches.
Measured in October 2026: F-0014, F-0006, F-0011, F-0012, F-0001; 14 s and 0.6 MB on a clean proxy IP: F-0015. Flagged proxy pools are slower: see Performance.
✨ Why gsearch
Google's official search API is closed to new customers and shuts down on 1 January 2027 (F-0005). gsearch is built for AI agents instead:
- 🦊 A real browser, not a scraper. Camoufox, a hardened Firefox, runs Google's page as it is, with a real-device fingerprint and a locale that matches its IP.
- 🔗 Real URLs. Google hides result links behind
/gotoredirects. gsearch resolves every one to the page it points to, without loading that page. - 🤖 Built for agents. One MCP server: search, page reading and status, typed JSON. Blocks come back as clear errors with
retry_after_s, never as empty results, and every string is flagged as untrusted web content. - 🌍 Any proxy, any format. Rotating residential, static VPS or datacenter lists, HTTP, HTTPS or SOCKS5, in any common layout. Every byte is counted, with a hard data limit.
- 🎯 Nothing to tune. Two settings. Everything else is fixed to what worked best in testing.
- 📊 Honest numbers. Every claim in this README links to a write-up of how it was measured.
📦 What your agent gets
[Each part of a Google results page and the JSON field it becomes]
Real output from a saved results page (offline demo mode, where url stays null; a live search fills it):
A block is never an empty list. It comes back as an error that says what happened and how long to wait:
[A CAPTCHA returned as a structured error]
Every field explained
Error codes: captcha, soft_block, hard_block, consent_wall, js_gate, rate_limited,
parse_drift, network, proxy, backend_unavailable, invalid_request. The full JSON Schema is in
serp.schema.json.
🔍 How it works
[One search: agent asks, fresh IP, real Firefox, clean JSON, all closed]
- Like a person. A visible window, because headless sessions were challenged far more often on proxy IPs (F-0015). The query is typed into the address bar. WebRTC is off, so your own IP can't leak around the proxy.
- Never forged. gsearch never generates or alters Google's tokens: the browser runs the page as it is.
- Cheap links. Links are resolved on the same IP with the same cookies and a TLS fingerprint matching the browser's (F-0011, F-0013).
- Runs on servers. On a Linux machine without a screen, the browser uses a virtual display
automatically (
sudo apt install xvfb).
🌍 Proxies
[Rotating residential, static or VPS proxies, or no proxy; any format]
- Rotating: a new IP and a new browser for every search, up to 3 at once. A blocked IP is replaced, up to
4 IPs per search.
country-xxorcc-xxin the login is checked, and exits elsewhere are dropped. - Static: each IP keeps one warm session, and the IPs take turns. Each IP has its own budget (20 searches an hour, 150 a day) and rests until midnight after a CAPTCHA, so ten IPs allow up to about 200 searches an hour.
- Data: every byte goes through a local relay that counts it, and
GSEARCH_DATA_LIMIT_MBstops everything at your limit, across restarts.
[!TIP] Check your proxy provider's acceptable-use policy. Many forbid using their network on sites whose terms prohibit automated access, and forbid solving CAPTCHAs.
📊 Performance
Proxy quality decides speed and cost. Many residential IPs are already flagged by Google. Each flagged IP costs a browser launch (about 0.7–1 MB and 20 s) before the next one is tried.
Without a proxy, a warm session on your own IP takes ~1.2 s per search, with every link resolved and 0 CAPTCHAs in testing (F-0014), capped at 20 searches an hour to protect your IP. Static proxies have not been benchmarked yet.
Measure your own proxy within your data limit:
🛠 Reference
Settings (five in total; most people need the first two)
Everything else is fixed to what worked best in testing: a new IP per search with rotating proxies, a visible browser, address-bar search, real-device fingerprints, 4 attempts per search, always resolving URLs, and a 10-minute cache for repeated queries.
MCP tools, CLI and Python
Exit codes: 0 results, 2 usage or settings error, 3 blocked or other error, 4 Google changed its
layout.
To call it over MCP from your own code, the way an agent does, see
examples/mcp_client.py.
Troubleshooting
When the browser hits a block or an error, the page is saved with a screenshot in the state folder's
evidence/, and the error's evidence_ref points to it.
❓ FAQ
Do I need a proxy? No. Without one, gsearch uses your own IP with a warm session (~1.2 s per search), capped at 20 searches an hour and 150 a day to keep your IP clean. For volume, use a proxy.
Which proxy should I buy? A rotating residential proxy with sticky sessions (a session id in the
username). Quality matters more than price: run tools/benchmark.py on a small plan before buying more.
How much proxy data does a search use? About 0.6 MB on a clean IP. Flagged IPs cost more, because each
one is a wasted browser launch. Set GSEARCH_DATA_LIMIT_MB so you can never overspend.
Does it solve CAPTCHAs? No. A blocked IP is dropped and a fresh one is tried. gsearch ships no CAPTCHA solver and never forges Google's tokens.
Can it run on a server? Yes. On Linux without a screen, install Xvfb and the browser runs on a virtual display.
Which agents work with it? Any MCP client: Claude Code, Claude Desktop, Cursor and others. You can also use the CLI or call it from Python.
📜 Legal and responsible use
- Google's Terms of Service restrict automated access to Google Search. Running this tool against Google may breach those terms, whatever this project's license says.
- Litigation risk is real and current. In Google v. SerpApi (N.D. Cal., filed 2025-12-19), Google argues that solving its SearchGuard JavaScript challenge by automated means is circumvention under DMCA §1201. gsearch runs that challenge in a real browser and does not forge or alter tokens, but the complaint also targets automated browsers. See docs/DESIGN.md (D-004).
- No CAPTCHA solver is shipped, wired in or recommended. A CAPTCHA rests the identity and is reported as an error.
- Get legal advice for your jurisdiction and use case before running live searches. The parser
(
gsearch_parse) only reads HTML you already have. - Limits are on by default and cannot be bypassed from the CLI or MCP. Don't use proxies to hammer Google.
- No personal-data harvesting. Don't profile people, scrape people-search results or collect personal data at scale. Keep caches short-lived and don't republish raw results.
- On a block, back off. CAPTCHAs and rate limits come back as errors with
retry_after_s. gsearch never tries to defeat the challenge.
Prompt injection
Every title, snippet, URL and question in a result is untrusted third-party text from the open web, and
may contain instructions aimed at your agent. The tool descriptions say so, every response carries
meta.untrusted_content: true and an MCP untrusted_content flag, and the text summary ends with a
warning. Treat results strictly as data.
🤝 Contributing
Tests never contact Google: the parser is tested against saved pages, and the browser against a local fake Google. Pull requests are welcome: pick a good first issue, see the roadmap, and start with CONTRIBUTING.md and docs/DESIGN.md.
If gsearch saves you time, a ⭐ helps other people find it.
License
MIT. Camoufox (MPL-2.0) is installed from PyPI as a dependency and is never vendored.
來源:README.md,提交 d28d2e0
工具
0版本歷史
1- v0.1.0最新Oct 18, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分