gemini-search-mcp
Free, unlimited web search MCP server powered by Google AI Mode (Gemini) without API key. Provides real-time search results for AI agents like Claude, Cursor, and Windsurf.
README
gemini-search-mcp (cn fork)
Free MCP server for web search powered by Google AI Mode (Gemini). Forked from Sophomoresty/gemini-search-mcp with adaptations for non-US IP environments.
What's different from upstream
| Aspect | Upstream | This fork |
|---|---|---|
| Target environment | US IP + headed Chrome + persistent profile | Same, plus auto-fallback for headless/non-US |
| AI Mode flow | folwr token via google.com.hk (breaks on non-US) |
folwr token via google.com + organic SERP fallback |
| Strategy | Single (AI Mode only — fails on non-US) | Dual: AI Mode (headed) + organic SERP (headless) |
| Login required | No | No |
Quick start
# 1. Install
pip install -e .
# 2. Prime a persistent Chrome profile (headed, manual CAPTCHA solve if prompted)
python scripts/prime_chrome_v2.py --profile-dir ~/.cache/gemini-search/chrome-profile
# 3. Add to your MCP config (Claude Desktop, Hermes, etc.)
MCP server config:
{
"mcpServers": {
"gemini-search": {
"command": "python",
"args": ["-m", "gemini_search_mcp"],
"env": {
"GEMINI_SEARCH_USER_DATA_DIR": "~/.cache/gemini-search/chrome-profile",
"HEADLESS": "0",
"BROWSER_CHANNEL": "chrome"
}
}
}
}
Requirements for AI Mode (full quality)
Google AI Mode is gated by 3 things:
- headed Chrome window —
--headless=newtriggers/sorry/CAPTCHA - persistent profile — fresh profiles get 91KB JS shell instead of 360KB token page
- US-region IP — non-US IPs see "AI Mode is not currently available on your device or account"
When all three are met, the engine auto-detects AI Mode availability during _warmup and uses it. When any fails, it falls back to organic SERP extraction (still 5 results with links, just not AI-synthesized).
Headless fallback
Set HEADLESS=1 to run without a visible window. The engine will:
- Use the persistent profile (still required)
- Detect that AI Mode is blocked (91KB shell, no
data-srtsttoken) - Fall back to extracting top 5 organic Google results from the rendered DOM
Answer quality is lower (snippet concat vs Gemini synthesis) but stable and fast.
MCP tools
| Tool | Description |
|---|---|
web_search(query) |
Search the web and get a synthesized answer grounded in real-time results |
ask(prompt) |
General question — Gemini Search decides whether to search the web |
Architecture
Agent calls web_search("query")
→ Chrome Runtime.evaluate (CDP via websockets)
→ _warmup: navigate to google.com/search?q=hello (no udm)
→ builds cookie session (NID, AEC, SNID)
→ Probe AI Mode: fetch google.com/search?q=test&udm=50
→ if has data-srtst token → AI Mode enabled
→ if 91KB shell or /sorry/ → organic fallback
→ ask():
[AI Mode path]
→ fetch AI Mode URL (udm=50&aep=1&ntc=1)
→ extract data-srtst, data-xsrf-folwr-token, data-garc, etc.
→ POST to /async/folwr endpoint
→ parse .pTRUV + .n6owBd blocks from HTML
[Organic path]
→ navigate to /search?q=...
→ extract top 5 div.g blocks from rendered DOM
Files
gemini_search/engine.py— Chrome CDP engine, dual strategygemini_search_mcp/— FastMCP server exposingweb_search+asktoolsgemini_search/server.py— OpenAI-compatible API server (gemini-search --port 8080)scripts/prime_chrome_v2.py— headed CAPTCHA priming helperscripts/uc_google_probe.py— undetected-chromedriver probe (for advanced CAPTCHA bypass)scripts/windows_chrome_profile_probe.py— Windows-specific two-phase profile verifiercompare_v2.py— Gemini Search vs Tavily comparison harness (13 queries)generate_report_v2.py— generates markdown report from results JSON
License
MIT (same as upstream)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。