google-search
MCP ServerFreeA Playwright-based Node.js tool that bypasses search engine anti-scraping mechanisms to execute Google searches. Local alternative to SERP APIs with MCP server integration.
Capabilities10 decomposed
playwright-based google search execution with anti-bot evasion
Medium confidenceExecutes real Google searches using Playwright browser automation while implementing multiple anti-detection strategies (user-agent rotation, viewport randomization, request throttling, browser state persistence) to bypass Google's anti-scraping mechanisms. The core googleSearch() function in src/search.ts orchestrates browser navigation, DOM waiting, and result extraction without relying on external SERP APIs, enabling unlimited searches without rate limits or API quotas.
Combines Playwright's headless browser automation with stateful browser persistence (saving/restoring cookies and session state) to minimize CAPTCHA triggers, unlike stateless SERP API calls. Implements multi-layered anti-detection (user-agent rotation, viewport randomization, request throttling) at the browser level rather than HTTP header manipulation alone.
Eliminates SERP API costs and rate limits (SerpAPI charges $0.005-0.02 per search) while providing real-time results; slower than cached APIs but faster than manual browser interaction and suitable for agents requiring fresh data.
mcp server integration for ai assistant search access
Medium confidenceWraps the core googleSearch() function as a Model Context Protocol (MCP) server using the MCP SDK, enabling AI assistants like Claude to invoke Google searches via standardized tool-calling interface. The mcp-server.ts component manages McpServer instance, StdioServerTransport for stdio communication, and a global persistent Playwright browser to serve multiple search requests from a single AI session without browser restart overhead.
Implements MCP server using stdio transport with persistent global Playwright browser, avoiding browser restart overhead per request. Registers search as a native MCP tool with schema-based parameter validation, enabling seamless integration into Claude's tool-calling pipeline without custom wrapper code.
Provides native MCP integration (vs. requiring custom API wrappers or HTTP servers) and maintains persistent browser state across multiple AI assistant requests, reducing latency compared to stateless SERP API integrations.
command-line interface with configurable search parameters
Medium confidenceExposes search functionality via CLI using the commander package (src/index.ts) with options for result limit, timeout, headless mode toggle, browser state file path, and HTML extraction modes. Parses command-line arguments and invokes the core googleSearch() function with validated parameters, supporting both structured JSON output and raw HTML retrieval for downstream processing.
Uses commander package for declarative CLI argument parsing with built-in help/version generation. Supports both structured JSON output (for programmatic consumption) and raw HTML extraction (--get-html, --save-html), enabling flexible integration into shell pipelines and scripts.
Simpler than writing custom Node.js scripts while more flexible than web-based search tools; enables shell integration without HTTP server overhead.
browser state persistence for captcha mitigation
Medium confidenceSaves and restores Playwright browser state (cookies, localStorage, sessionStorage) to a JSON file (default ./browser-state.json) between search invocations. This stateful approach preserves Google's session context and reduces CAPTCHA triggers by maintaining browser identity across multiple searches, unlike stateless HTTP clients that appear as fresh visitors to Google on each request.
Implements stateful browser persistence at the Playwright level (saving/restoring browser context) rather than HTTP-level cookie management. Preserves full browser state including localStorage and sessionStorage, maintaining Google's session context more effectively than header-based cookie jars.
More effective CAPTCHA mitigation than stateless SERP APIs or simple cookie rotation; trades state file management complexity for sustained search access without manual intervention.
structured result extraction with title, link, snippet fields
Medium confidenceParses Google search result DOM using Playwright's page.locator() and evaluate() methods to extract structured data (title, link, snippet) from each result element. Returns SearchResponse JSON array with typed fields, enabling downstream processing without regex parsing or HTML string manipulation. Extraction logic handles Google's dynamic DOM structure and adapts to layout variations.
Uses Playwright's page.locator() and evaluate() for DOM-aware extraction rather than regex or HTML parsing libraries. Returns typed SearchResponse objects with validated fields, enabling type-safe downstream processing in TypeScript/Node.js applications.
More robust than regex-based extraction (handles DOM variations) and more maintainable than brittle CSS selector chains; provides structured output suitable for LLM context vs. raw HTML strings.
raw html retrieval and screenshot capture for custom analysis
Medium confidenceProvides --get-html flag to return raw HTML string of search results page and --save-html flag to capture and save full page screenshot/HTML to disk. Enables custom parsing, archival, or visual debugging workflows where structured extraction is insufficient. Playwright's page.content() and page.screenshot() methods handle full-page capture including dynamic content.
Offers dual output modes: structured extraction (SearchResponse) for programmatic use and raw HTML/screenshots for custom analysis. Playwright's page.content() captures dynamic content after JavaScript execution, unlike static HTML fetching.
More flexible than structured-only extraction; enables custom parsing for edge cases (knowledge panels, ads, featured snippets) while maintaining option for clean structured output.
configurable timeout and headless mode control
Medium confidenceExposes --timeout <milliseconds> (default 60000) and --no-headless CLI options to control Playwright browser behavior. Timeout parameter sets page navigation and element waiting limits; --no-headless disables headless mode to show visible browser window for debugging. Enables developers to tune performance vs. reliability and visually inspect search execution.
Exposes Playwright's timeout and headless mode as CLI flags, enabling non-developers to adjust behavior without code changes. --no-headless provides visual debugging capability absent in most SERP APIs.
More flexible than fixed-timeout SERP APIs; enables visual debugging vs. blind API calls and supports network-specific tuning.
pino-based structured logging for debugging and monitoring
Medium confidenceImplements logging via Pino logger (src/logger.ts) with structured JSON output, enabling developers to track search execution flow, anti-bot detection events, and errors. Logs include timestamps, log levels, and contextual data suitable for parsing by log aggregation systems (ELK, Datadog, CloudWatch). Supports configurable log levels for production vs. development environments.
Uses Pino for structured JSON logging with minimal overhead, enabling log aggregation and analysis. Logs include search-specific context (query, result count, anti-bot events) suitable for monitoring search health.
Structured JSON logging (vs. unstructured console.log) enables automated parsing and alerting; Pino's performance is optimized for high-volume logging.
typescript type system with searchresponse and htmlresponse interfaces
Medium confidenceDefines typed interfaces (src/types.ts) for SearchResponse (array of {title, link, snippet} objects) and HtmlResponse (raw HTML string) using TypeScript. Enables type-safe consumption of search results in TypeScript applications and provides IDE autocomplete for result fields. Type definitions document expected output structure and catch type errors at compile time.
Provides explicit TypeScript interfaces for search results, enabling IDE autocomplete and compile-time type checking. Interfaces document expected output structure without runtime validation overhead.
More maintainable than untyped JavaScript; enables IDE support and catches type errors early vs. runtime failures.
multi-layered anti-detection strategy with user-agent and viewport randomization
Medium confidenceImplements anti-bot evasion through user-agent rotation (randomizing User-Agent header), viewport randomization (varying browser window size), and request throttling (adding delays between navigation and interactions). These strategies operate at the Playwright browser level, making searches appear as legitimate user traffic rather than automated bots. Combines multiple evasion techniques to increase success rate against Google's detection heuristics.
Combines multiple evasion techniques (user-agent rotation, viewport randomization, request throttling, state persistence) at the Playwright browser level rather than HTTP header manipulation alone. Stateful approach (preserving browser session) is more effective than stateless techniques.
More sophisticated than simple user-agent rotation; combines behavioral mimicry (throttling) with session persistence. Less effective than proxy rotation but requires no external infrastructure.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with google-search, ranked by overlap. Discovered automatically through the match graph.
Google PSE/CSE
** - A Model Context Protocol (MCP) server providing access to Google Programmable Search Engine (PSE) and Custom Search Engine (CSE).
WebSearch-MCP
** - Self-hosted Websearch API
Exa
** - Exa AI Search API
Search1API
** - One API for Search, Crawling, and Sitemaps
Scrapeless
** - Integrate real-time [Scrapeless](https://www.scrapeless.com/en) Google SERP(Google Search, Google Flight, Google Map, Google Jobs....) results into your LLM applications. This server enables dynamic context retrieval for AI workflows, chatbots, and research tools.
Brave Search
** - Web and local search using Brave's Search API. Has been replaced by the [official server](https://github.com/brave/brave-search-mcp-server).
Best For
- ✓AI agents and LLM applications requiring real-time search without external API dependencies
- ✓Developers building local-first search tools with no cloud infrastructure
- ✓Teams migrating from paid SERP APIs (SerpAPI, DataForSEO) to self-hosted alternatives
- ✓AI agent developers using Claude or other MCP-compatible LLMs
- ✓Teams building AI research assistants requiring real-time web search
- ✓Developers extending Claude's capabilities with local search tools
- ✓DevOps engineers integrating search into automation scripts
- ✓Researchers performing batch searches from command line
Known Limitations
- ⚠Subject to Google's dynamic anti-bot detection; may encounter CAPTCHAs or IP blocks on high-frequency searches
- ⚠Browser state persistence (./browser-state.json) mitigates but doesn't eliminate CAPTCHA challenges
- ⚠Single-threaded Playwright execution limits concurrent search parallelism
- ⚠No built-in proxy rotation; requires external proxy infrastructure for large-scale scraping
- ⚠Slower than cached SERP APIs (Playwright startup + navigation overhead ~3-5 seconds per search)
- ⚠MCP server runs as separate process; requires stdio communication overhead (~10-50ms per request)
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Apr 6, 2025
About
A Playwright-based Node.js tool that bypasses search engine anti-scraping mechanisms to execute Google searches. Local alternative to SERP APIs with MCP server integration.
Categories
Alternatives to google-search
Are you the builder of google-search?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →