gemini-search-mcp
Provides web search capabilities using Google's AI Mode, allowing agents to search the web and get synthesized answers grounded in real-time results.
Provides an OpenAI-compatible API endpoint for non-MCP clients to use the search functionality, with a base URL of http://localhost:8080/v1.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gemini-search-mcpsearch for latest AI regulation news"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 | folwr token via |
Strategy | Single (AI Mode only — fails on non-US) | Dual: AI Mode (headed) + organic SERP (headless) |
Login required | No | No |
Related MCP server: Apeiron
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/CAPTCHApersistent 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 |
| Search the web and get a synthesized answer grounded in real-time results |
| 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 DOMFiles
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)
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mkih76/gemini-search-mcp-cn'
If you have feedback or need assistance with the MCP directory API, please join our Discord server