Purpose
google-ai-search-mcp is a server implementing the Model Context Protocol (MCP), aimed at AI programming scenarios, providing a set of search and documentation tools powered by Google AI, designed to help AI programming assistants overcome the knowledge gaps and information limitations of large language models.
Main Capabilities
The project provides two categories of tools. The core search and documentation tools include:
- answer_query_websearch: natural language queries for developers, with automatic technical detection, enhanced search methods, and code formatting using Google AI's real-time search results.
- explain_topic_with_docs: concise technical explanations, improved debugging scenarios, synthesizing information from official documentation, reducing verbosity and enhancing troubleshooting guidance.
- get_doc_snippets: enhanced code snippet retrieval, providing progressively complex examples, advanced search patterns, version-specific targeting, and full context for technical queries against official documentation.
- generate_project_guidelines: generates structured project guideline documents based on specified technologies, using web search to obtain current best practices and industry standards.
Advanced analysis tools include:
- code_analysis_with_docs: evidence-based code analysis, providing standardized citations, severity classification, and actionable recommendations, comparing code against official documentation best practices.
- technical_comparison: generates technical comparisons according to requested criteria using available current search context. Quantitative or market claims must be verified against cited primary sources.
- architecture_pattern_recommendation: generates architectural options, trade-offs, and implementation considerations for described use cases. Recommendations must be validated against the system's actual constraints before adoption.
The input/output schemas for each tool are defined in the corresponding files within src/tools/ and exposed through the MCP server.
Configuration and Usage
Configuration files are controlled via environment variables, allowing configuration of model ID, temperature, streaming behavior, maximum output tokens, and retry settings. By default, the streaming API is used for better responsiveness, including basic retry logic for transient API errors. Minimal safety filtering (BLOCK_NONE) is applied to reduce potential blocking (use with caution).
Prerequisites: Bun (can be installed via npm install -g bun installation); using Vertex AI requires a Google Cloud project with billing enabled; enable the Vertex AI API in the GCP project; configure Google Cloud authentication in the environment (recommended to use application default credentials via gcloud auth application-default login, or use a service account key) or a Gemini API key.
Setup and installation steps:
- Clone/place the project in the target location.
- Install dependencies: bun install
- Configure the environment: create a .env file in the project root (copy .env.example), and set the required and optional environment variables as described in .env.example. Set AI_PROVIDER to "vertex" or "gemini". If AI_PROVIDER="vertex", GOOGLE_CLOUD_PROJECT is required; if AI_PROVIDER="gemini", GEMINI_API_KEY is required.
- Build the server: bun run build, which compiles the TypeScript code to build/index.js.
Standalone run / NPX: This package has been published to npm and can be run directly with npx, or installed globally. Before running standalone, the necessary environment variables must be set in the shell environment (such as GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, GEMINI_API_KEY, authentication credentials, etc.).
Docker: After building the local container image, it can be run with the Gemini API provider. When using Vertex AI, pass in AI_PROVIDER=vertex, GOOGLE_CLOUD_PROJECT, and optionally GOOGLE_CLOUD_LOCATION, and application default credentials must also be provided inside the container (usually via a read-only credentials mount). Do not bake API keys or service account files into the image.
Using with Cline: Add/update the configuration in the Cline MCP settings file (such as .roo/mcp.json). There are two main ways to configure the command. Method A uses Node to run the compiled script directly, which is suitable for local development, and you need to ensure that args paths correctly point to build/index.js; using absolute paths may be more reliable. Method B uses NPX to automatically download and run the server package from the npm registry, without needing to clone the repository. Ensure that the environment variables in the env block are set correctly, consistent with the actual .env or explicitly defined here. After that, restart/reload Cline, and these tools can be used.
Development commands: watch mode bun run watch; build bun run build; inspector bun run inspector.
Applicable scenarios and limitations
This tool is suitable for scenarios where an AI programming assistant needs real-time information retrieval, official documentation references, code quality analysis, technology selection comparisons, or architectural advice during coding.
The implementation notes point out that provider selection and credentials are resolved at runtime, so the fact that a tool is listed does not prove that its upstream provider has been configured or is reachable. Model-generated comparisons, architectural guidance, and security analyses should be treated as material that needs to be verified against the cited original sources, rather than as definitive conclusions.
The project uses the MIT license; see the LICENSE file for details.