Google Search CLI and MCP server for AI agents
Project description
gsearch-mcp-cli
Google Search CLI and MCP server for AI agents. Search Google (regular + AI Mode), fetch web pages as Markdown, with time filtering. No Google account needed.
Vibe Coding Alert
Full transparency: this project was built by a non-developer using AI coding assistants. If you're an experienced Python developer, you might look at this codebase and wince. That's okay.
The goal here was to learn — both about building CLI tools in Python and about how modern web applications work under the hood. The code works, but it's very much a learning project released solely for the purpose of research and education, not a polished product.
[!WARNING] Unofficial & Unsupported — This project is not affiliated with, endorsed by, or supported by Google. It interacts with Google Search and Google AI Mode through unofficial, undocumented methods that may break at any time without notice if Google changes their internal behavior, DOM structure, or bot detection. Use at your own risk. The author(s) accept no responsibility for any consequences, including but not limited to rate limiting or IP blocking. This project is released strictly for educational and research purposes only.
If you know better, teach us. PRs, issues, and architectural advice are all welcome. This is open source specifically because human expertise is irreplaceable.
Install
pip
pip install gsearch-mcp-cli
uv
uv tool install gsearch-mcp-cli
pipx
pipx install gsearch-mcp-cli
Run without installing (uvx)
uvx --from gsearch-mcp-cli gsearch "your query"
Requirements: A Chromium-based browser (Chrome, Brave, Edge, Chromium, Vivaldi, or Opera).
Quick Start
gsearch setup # one-time profile warmup (~8s)
gsearch "what is kubernetes" # search Google
gsearch "AI news" --time day # last 24 hours
gsearch "breaking news" --time 1h # last hour
gsearch ai "explain docker architecture" # AI Mode (g.ai)
gsearch fetch "https://example.com" # page to Markdown
Time Filtering
Filter results by time period -- critical for news and recent events:
gsearch "query" --time hour # last hour
gsearch "query" --time 12h # last 12 hours
gsearch "query" --time day # last 24 hours
gsearch "query" --time week # last 7 days
gsearch "query" --time month # last month
gsearch "query" --time year # last year
gsearch "query" --after 2026-01-01 --before 2026-03-31 # custom range
Commands
| Command | Description |
|---|---|
gsearch "query" |
Google Search (default) with AI Overview + organic results |
gsearch ai "query" |
Google AI Mode -- synthesized answer with citations |
gsearch fetch "url" |
Fetch URL and convert to clean Markdown |
gsearch setup |
Browser profile warmup (one-time) |
gsearch setup add <tool> |
Configure MCP server for an AI tool |
gsearch config show |
Show configuration |
gsearch doctor |
Run diagnostics |
gsearch skill install <tool> |
Install skill for AI tools |
gsearch --ai |
Print AI-optimized documentation |
MCP Server
For AI agents via Model Context Protocol:
gsearch-mcp # start MCP server (stdio)
gsearch setup add cursor # configure for Cursor
gsearch setup add claude-code # configure for Claude Code
MCP Tools:
gsearch_search(query, time_filter="day", ...)-- Google Searchgsearch_ai(query, time_filter="week", ...)-- AI Modegsearch_fetch(url, format="md", ...)-- Fetch page as Markdown
How It Works
Uses headless Chrome via CDP (Chrome DevTools Protocol) with a persistent anonymous profile. Google's BotGuard requires a warmed-up browser session -- gsearch setup establishes this once. No Google account or login needed.
Supported AI Tools
MCP Setup (gsearch setup add): Claude Code, Gemini CLI, Cursor, Windsurf, Cline, Antigravity, Codex, OpenCode
Skill Install (gsearch skill install): Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Antigravity, Cline, OpenClaw, CC-Claw
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsearch_mcp_cli-0.0.8.tar.gz.
File metadata
- Download URL: gsearch_mcp_cli-0.0.8.tar.gz
- Upload date:
- Size: 217.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d01101c0924a3361d8b6baefdd5476e953f51e30d12273e28acb844c9142d26
|
|
| MD5 |
c8cc1456d20d78bd53107160007fa6df
|
|
| BLAKE2b-256 |
e9f7c3ceaabda67c9a4def53d57eba450e7d1f3ceb8bc70f45426b218967d41d
|
Provenance
The following attestation bundles were made for gsearch_mcp_cli-0.0.8.tar.gz:
Publisher:
release.yml on jacob-bd/gsearch-mcp-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsearch_mcp_cli-0.0.8.tar.gz -
Subject digest:
8d01101c0924a3361d8b6baefdd5476e953f51e30d12273e28acb844c9142d26 - Sigstore transparency entry: 1191226631
- Sigstore integration time:
-
Permalink:
jacob-bd/gsearch-mcp-cli@6c2d42a69dc1466b13cf316df59d4d3ca44d7942 -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/jacob-bd
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6c2d42a69dc1466b13cf316df59d4d3ca44d7942 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gsearch_mcp_cli-0.0.8-py3-none-any.whl.
File metadata
- Download URL: gsearch_mcp_cli-0.0.8-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30486b3f702a02a872a209034084648071f7409754ac07023c01785dc2db15e7
|
|
| MD5 |
7059d02244019385d6be79560df4c3f4
|
|
| BLAKE2b-256 |
92aea8260ca0216a53eda7f377fab244763aded5b1d1a7249087fc89a1ca8e5d
|
Provenance
The following attestation bundles were made for gsearch_mcp_cli-0.0.8-py3-none-any.whl:
Publisher:
release.yml on jacob-bd/gsearch-mcp-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsearch_mcp_cli-0.0.8-py3-none-any.whl -
Subject digest:
30486b3f702a02a872a209034084648071f7409754ac07023c01785dc2db15e7 - Sigstore transparency entry: 1191226632
- Sigstore integration time:
-
Permalink:
jacob-bd/gsearch-mcp-cli@6c2d42a69dc1466b13cf316df59d4d3ca44d7942 -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/jacob-bd
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6c2d42a69dc1466b13cf316df59d4d3ca44d7942 -
Trigger Event:
push
-
Statement type: