Open source Google search tool using Playwright bypasses anti-bot detection supports MCP integration
The Google Search Tool is an advanced Playwright-based Node.js tool designed to bypass search engine anti-scraping mechanisms and provide real-time search capabilities. It can be deployed as both a command-line tool and an MCP server, offering seamless integration with AI applications such as Claude Desktop. This powerful tool leverages sophisticated anti-bot detection techniques and raw HTML retrieval options, making it an indispensable resource for developers building intelligent search functionalities.
The Google Search Tool MCP Server excels in providing robust local execution of search operations without relying on paid third-party APIs. Key features include:
Local SERP API Alternative: Bypasses the need for expensive commercial services, all searches are executed locally.
Advanced Anti-Bot Techniques:
Raw HTML & Screenshot Retrieval: Ability to fetch raw HTML and screenshots, enabling detailed data extraction.
MCP Protocol Compliance: Native support for integration with a variety of AI applications through the Model Context Protocol (MCP).
The core architecture of the Google Search Tool MCP Server revolves around its interoperability with other AI platforms. It adheres to the MCP protocol, ensuring seamless data exchange and service invocation between servers and clients. The tool is structured into key components:
The implementation of the MCP protocol in this server ensures compatibility with multiple AI applications by adhering to a predefined messaging format. The flow can be visualized as:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
Clone the Repository:
git clone https://github.com/your-repo/google-search-tool.git
cd google-search-tool
Install Dependencies:
pnpm install
# Optionally, install Playwright browsers for testing
pnpm run postinstall
Build the Project:
pnpm build
Start Developing or Running the Server:
# Development mode
pnpm dev "search keywords"
# Debug mode (shows browser interface)
pnpm debug "search keywords"
# Run compiled code directly
pnpm start "search keywords"
Testing Search Functionality:
pnpm test
For researchers and developers needing to automate the gathering of data, this tool can be integrated into workflows that require frequent and complex queries.
Example use case:
// Assuming integration with Claude Desktop
const mcpServer = new GoogleSearchToolMCPServer();
async function searchResearch(query: string) {
const results = await mcpServer.search(query);
// Process & save the research data
}
Enhance chatbots by providing dynamic and up-to-date answers based on real-time query responses.
Example use case:
// Assuming the MCP Client is Continue
const mcpClient = new ContinueMCPClient();
async function answerUserQuery(query: string) {
const results = await mcpClient.invoke(mcpServer.search, { query });
// Formulate chatbot response based on search results
}
MPC Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
State files are critical for maintaining persistent browser sessions. They contain cookies and other storage data that must be kept secure. Misuse can lead to unexpected behavior or security breaches.
Ensure Node.js v16 or higher is installed, and necessary dependencies are correctly managed.
A1: The tool employs intelligent browser fingerprint management to simulate real user behavior, coupled with state persistence across sessions to minimize anti-bot interventions.
A2: Yes, through custom configurations detailed in your MCP server script. This allows for tailored interactions and responses based on specific application needs.
A3: All searches are executed locally, without sending data to third-party services, ensuring complete privacy of search queries.
A3: Absolutely. As an open-source project, it is fully customizable and extensible via TypeScript interfaces and Playwright automation capabilities.
A3: Ensure to run Command Prompt or PowerShell as administrator during initial setup, and allow network connections when prompted by the firewall.
Contributions are welcomed! Developers can propose improvements, report bugs, or enhance existing features. Detailed contribution guidelines are available in the repository's CONTRIBUTING.md
file.
By leveraging the Google Search Tool MCP Server, developers can create robust and secure AI applications that integrate seamlessly with various MCP clients. This comprehensive guide ensures smooth implementation and integration for developers building cutting-edge solutions in the field of artificial intelligence.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods