How mixelpixx/google-search-mcp-server works
Main Components
• TypeScript MCP Server:
• This is the Node.js-based part (built in TypeScript) responsible for handling MCP protocol communication and providing the tool interface. It is compiled from the files in the src directory (e.g., google-search.ts, content-fetcher.ts, types.ts, etc.) and launched via Node.js.
• Python Flask Server:
• This component is made up of the Python scripts (google_search.py and link_view.py) and handles interactions with Google’s API and webpage content extraction/analysis. It uses Flask and additional Python libraries for tasks such as web scraping (beautifulsoup4, trafilatura) and API interfacing (google-api-python-client).
Relationships and Interactions
• Client / MCP Integrations:
• External clients such as the Cline VS Code extension or the Claude desktop app will send commands to the MCP server.
• These clients interact with the Node.js MCP server according to the MCP protocol and tool interface.
• Internal Coordination between Servers:
• Once a request arrives (e.g., a “google_search” or “extract_webpage_content” command), the TypeScript MCP server delegates the task to the Python Flask server.
• API Credential Management:
• Both the Node.js and Python servers rely on API keys (either from environment variables or the api-keys.json file) to authenticate with Google’s Custom Search API.
• A configuration component to show how API credentials are injected.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Divide the architecture clearly between the MCP protocol handling (Node.js/TypeScript) and Google search + webpage analysis (Python/Flask).
• Modular Design:
• How the different tools (e.g., “google_search”, “extract_webpage_content”, “extract_multiple_webpages”) are implemented as distinct modules or endpoints.
• Environment-Based Configuration:
• Support for both environment variables and configuration files (api-keys.json), which is important for secure and flexible deployments.
• Multi-Language Integration:
• It’s a hybrid system that leverages the strengths of both TypeScript (for high-performance MCP communication) and Python (for web scraping and API interaction).
Technologies and Dependencies
• Node.js + TypeScript:
• Shown in the “src” directory (google-search.ts, content-fetcher.ts, etc.) and built into a distributable JavaScript file (as indicated by the build instructions).
• Python + Flask:
• Represented by google_search.py and link_view.py, along with their dependencies (Flask, flask-cors, beautifulsoup4, trafilatura, markdownify, etc.)
• Google Cloud & API Credentials:
• Support interaction with Google’s Custom Search API.
• Supporting Scripts and Commands:
• Helper scripts like start-all-servers.cmd and start-python-servers.cmd demonstrate the orchestration of the servers.