{
  "markdown": "# Google AI Search MCP\n\n[![Smithery](https://smithery.ai/badge/ishariqriaz/google-ai-search-mcp)](https://smithery.ai/servers/ishariqriaz/google-ai-search-mcp)\n\nThis project implements a Model Context Protocol (MCP) server that provides a comprehensive suite of Google AI-powered search and documentation tools specifically designed to help AI coders overcome LLM knowledge gaps and information limitations.\n\n## Implementation notes\n\nProvider selection and credentials are resolved at runtime, so a tool being listed does not prove that its upstream provider is configured or reachable. Treat model-produced comparisons, architecture guidance, and security analysis as material to verify against the cited primary sources rather than deterministic findings.\n\nFor a source-linked comparison of the design pressures across this project and six other public MCP implementations, see [What building seven MCP servers taught me about production MCP](https://www.orchestriai.com/blog/lessons-building-seven-mcp-servers).\n\n## Features\n\n*   Provides access to Google AI models (Vertex AI and Gemini API) via specialized MCP tools.\n*   Focuses on real-time information retrieval and documentation-based analysis.\n*   Supports web search grounding for current information that LLMs lack.\n*   Configurable model ID, temperature, streaming behavior, max output tokens, and retry settings via environment variables.\n*   Uses streaming API by default for potentially better responsiveness.\n*   Includes basic retry logic for transient API errors.\n*   Minimal safety filters applied (`BLOCK_NONE`) to reduce potential blocking (use with caution).\n\n## Tools Provided\n\n### Core Search & Documentation Tools\n*   `answer_query_websearch`: Developer-focused natural language queries with automatic technical detection, enhanced search methodology, and comprehensive code formatting using Google AI with real-time search results.\n*   `explain_topic_with_docs`: Streamlined technical explanations with improved debugging scenarios, synthesizing information from official documentation with reduced verbosity and enhanced troubleshooting guidance.\n*   `get_doc_snippets`: Enhanced code snippet retrieval with progressive complexity examples, advanced search patterns, version-specific targeting, and comprehensive context for technical queries from official documentation.\n*   `generate_project_guidelines`: Generates comprehensive structured project guidelines documents based on specified technologies, using web search for current best practices and industry standards.\n\n### Advanced Analysis Tools\n*   `code_analysis_with_docs`: Evidence-based code analysis with standardized citations, severity categorization, and actionable recommendations by comparing code against official documentation best practices.\n*   `technical_comparison`: Produces technology comparisons across requested criteria using current search context where available. Verify quantitative or market claims against the cited primary sources.\n*   `architecture_pattern_recommendation`: Produces architecture options, tradeoffs, and implementation considerations for a described use case. Validate the recommendation against the system's actual constraints before adopting it.\n\n*(Note: Input/output schemas for each tool are defined in their respective files within `src/tools/` and exposed via the MCP server.)*\n\n## Prerequisites\n\n*   Node.js (v18+)\n*   Bun (`npm install -g bun`)\n*   Google Cloud Project with Billing enabled (if using Vertex AI).\n*   Vertex AI API enabled in the GCP project (if using Vertex AI).\n*   Google Cloud Authentication configured in your environment (Application Default Credentials via `gcloud auth application-default login` is recommended, or a Service Account Key) OR Gemini API key.\n\n## Setup & Installation\n\n1.  **Clone/Place Project:** Ensure the project files are in your desired location.\n2.  **Install Dependencies:**\n    ```bash\n    bun install\n    ```\n3.  **Configure Environment:**\n    *   Create a `.env` file in the project root (copy `.env.example`).\n    *   Set the required and optional environment variables as described in `.env.example`.\n        *   Set `AI_PROVIDER` to either `\"vertex\"` or `\"gemini\"`.\n        *   If `AI_PROVIDER=\"vertex\"`, `GOOGLE_CLOUD_PROJECT` is required.\n        *   If `AI_PROVIDER=\"gemini\"`, `GEMINI_API_KEY` is required.\n4.  **Build the Server:**\n    ```bash\n    bun run build\n    ```\n    This compiles the TypeScript code to `build/index.js`.\n\n## Usage (Standalone / NPX)\n\nThe package is published to npm and can be run directly with `npx`:\n\n```bash\n# Ensure required environment variables are set (e.g., GOOGLE_CLOUD_PROJECT or GEMINI_API_KEY)\nbunx google-ai-search-mcp\n```\n\nAlternatively, install it globally:\n\n```bash\nbun install -g google-ai-search-mcp\n# Then run:\ngoogle-ai-search-mcp\n```\n\n**Note:** Running standalone requires setting necessary environment variables (like `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION`, `GEMINI_API_KEY`, authentication credentials if not using ADC) in your shell environment before executing the command.\n\n### Docker\n\nBuild the local container image:\n\n```bash\ndocker build -t google-ai-search-mcp .\n```\n\nRun with the Gemini API provider:\n\n```bash\ndocker run --rm -i \\\n  -e AI_PROVIDER=gemini \\\n  -e GEMINI_API_KEY \\\n  google-ai-search-mcp\n```\n\nFor Vertex AI, pass `AI_PROVIDER=vertex`, `GOOGLE_CLOUD_PROJECT`, and optionally\n`GOOGLE_CLOUD_LOCATION`. Application Default Credentials must also be available\ninside the container, normally through a read-only credential mount. Do not bake\nAPI keys or service-account files into the image.\n\n## Running with Cline\n\n1.  **Configure MCP Settings:** Add/update the configuration in your Cline MCP settings file (e.g., `.roo/mcp.json`). You have two primary ways to configure the command:\n\n    **Option A: Using Node (Direct Path - Recommended for Development)**\n\n    This method uses `node` to run the compiled script directly. It's useful during development when you have the code cloned locally.\n\n    ```json\n    {\n      \"mcpServers\": {\n        \"google-ai-search-mcp\": {\n          \"command\": \"node\",\n          \"args\": [\n            \"/full/path/to/your/google-ai-search-mcp/build/index.js\" // Use absolute path or ensure it's relative to where Cline runs node\n          ],\n          \"env\": {\n            // --- General AI Configuration ---\n            \"AI_PROVIDER\": \"vertex\", // \"vertex\" or \"gemini\"\n            // --- Required (Conditional) ---\n            \"GOOGLE_CLOUD_PROJECT\": \"YOUR_GCP_PROJECT_ID\", // Required if AI_PROVIDER=\"vertex\"\n            // \"GEMINI_API_KEY\": \"YOUR_GEMINI_API_KEY\", // Required if AI_PROVIDER=\"gemini\"\n            // --- Optional Model Selection ---\n            \"VERTEX_MODEL_ID\": \"gemini-2.5-pro\", // If AI_PROVIDER=\"vertex\" (Example override)\n            \"GEMINI_MODEL_ID\": \"gemini-2.5-pro\", // If AI_PROVIDER=\"gemini\"\n            // --- Optional AI Parameters ---\n            \"GOOGLE_CLOUD_LOCATION\": \"us-central1\", // Specific to Vertex AI\n            \"AI_TEMPERATURE\": \"0.0\",\n            \"AI_USE_STREAMING\": \"true\",\n            \"AI_MAX_OUTPUT_TOKENS\": \"65536\", // Default from .env.example\n            \"AI_MAX_RETRIES\": \"3\",\n            \"AI_RETRY_DELAY_MS\": \"1000\",\n            // --- Optional Vertex Authentication ---\n            // \"GOOGLE_APPLICATION_CREDENTIALS\": \"/path/to/your/service-account-key.json\" // If using Service Account Key for Vertex\n          },\n          \"disabled\": false,\n          \"alwaysAllow\": [\n             // Add tool names here if you don't want confirmation prompts\n             // e.g., \"answer_query_websearch\"\n          ],\n          \"timeout\": 3600 // Optional: Timeout in seconds\n        }\n        // Add other servers here...\n      }\n    }\n    ```\n    *   **Important:** Ensure the `args` path points correctly to the `build/index.js` file. Using an absolute path might be more reliable.\n\n    **Option B: Using NPX (Requires Package Published to npm)**\n\n    This method uses `npx` to automatically download and run the server package from the npm registry. This is convenient if you don't want to clone the repository.\n\n    ```json\n    {\n      \"mcpServers\": {\n        \"google-ai-search-mcp\": {\n          \"command\": \"bunx\", // Use bunx\n          \"args\": [\n            \"-y\", // Auto-confirm installation\n            \"google-ai-search-mcp\" // The npm package name\n          ],\n          \"env\": {\n            // --- General AI Configuration ---\n            \"AI_PROVIDER\": \"vertex\", // \"vertex\" or \"gemini\"\n            // --- Required (Conditional) ---\n            \"GOOGLE_CLOUD_PROJECT\": \"YOUR_GCP_PROJECT_ID\", // Required if AI_PROVIDER=\"vertex\"\n            // \"GEMINI_API_KEY\": \"YOUR_GEMINI_API_KEY\", // Required if AI_PROVIDER=\"gemini\"\n            // --- Optional Model Selection ---\n            \"VERTEX_MODEL_ID\": \"gemini-2.5-pro\", // If AI_PROVIDER=\"vertex\" (Example override)\n            \"GEMINI_MODEL_ID\": \"gemini-2.5-pro\", // If AI_PROVIDER=\"gemini\"\n            // --- Optional AI Parameters ---\n            \"GOOGLE_CLOUD_LOCATION\": \"us-central1\", // Specific to Vertex AI\n            \"AI_TEMPERATURE\": \"0.0\",\n            \"AI_USE_STREAMING\": \"true\",\n            \"AI_MAX_OUTPUT_TOKENS\": \"65536\", // Default from .env.example\n            \"AI_MAX_RETRIES\": \"3\",\n            \"AI_RETRY_DELAY_MS\": \"1000\",\n            // --- Optional Vertex Authentication ---\n            // \"GOOGLE_APPLICATION_CREDENTIALS\": \"/path/to/your/service-account-key.json\" // If using Service Account Key for Vertex\n          },\n          \"disabled\": false,\n          \"alwaysAllow\": [\n             // Add tool names here if you don't want confirmation prompts\n             // e.g., \"answer_query_websearch\"\n          ],\n          \"timeout\": 3600 // Optional: Timeout in seconds\n        }\n        // Add other servers here...\n      }\n    }\n    ```\n    *   Ensure the environment variables in the `env` block are correctly set, either matching `.env` or explicitly defined here. Remove comments from the actual JSON file.\n\n2.  **Restart/Reload Cline:** Cline should detect the configuration change and start the server.\n\n3.  **Use Tools:** You can now use the comprehensive list of Google AI-powered search and documentation tools via Cline.\n\n## Development\n\n*   **Watch Mode:** `bun run watch`\n*   **Build:** `bun run build`\n*   **Inspector:** `bun run inspector`\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
  "bytes": 10431,
  "sha": "577dd94d8e5baf81ff214028412e933bd8fa770091db9ceba69142927e3d475c",
  "repo_slug": "shariqriazz/google-ai-search-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_shariqriazz_google_ai_search_m_3a9aa4b3/readme"
}