Skip to main content

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.

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 Search
  • gsearch_ai(query, time_filter="week", ...) -- AI Mode
  • gsearch_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, Alef

License

MIT

Release files for gsearch-mcp-cli 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gsearch-mcp-cli 0.1.4
File Size Uploaded
gsearch_mcp_cli-0.1.4.tar.gz 235.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gsearch-mcp-cli 0.1.4
File Interpreter ABI Platform
gsearch_mcp_cli-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 297.1 kB

Release files / gsearch_mcp_cli-0.1.4.tar.gz

Download URL gsearch_mcp_cli-0.1.4.tar.gz
Size 235.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4479d8a6726ec7f4b18f930a5f7944dea2ba47c43e7c19d2cebb5035dd80a3f3
BLAKE2b-256 checksum
How to use checksums
b415fb8e54ecd76e66d85a5f9766d1911ddd886318b9d122dc1e76b4844e1e78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / gsearch_mcp_cli-0.1.4-py3-none-any.whl

Download URL gsearch_mcp_cli-0.1.4-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
235c2902887b9dd869a48477b438b3cfb7127aa9e8cb522c94399a5c4b589edd
BLAKE2b-256 checksum
How to use checksums
ea30cf24285da838d7755ee15d986a6824e177caf811cec18db60a488f073218
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page