Ask Google MCP Server
This server exposes a single tool, ask_google, which lets AI agents query current web information via Google Search-grounded Gemini responses.
Key capabilities:
Current information retrieval: Get up-to-date facts beyond training data — latest versions, releases, changelogs, API changes, breaking news, and recent announcements.
Multi-source synthesis: Generates reasoned answers with citations, source URLs/titles, per-claim grounding supports, and the search queries performed.
Auto-routing: Default
automode uses a classifier to select betweenflash(complex, multi-source queries) andflash-lite(simple lookups); can be overridden explicitly.Structured output: Returns answer text, sources, search queries performed, grounding status, and diagnostics (model used, routing decisions, timing).
Robust error handling: Surfaces categorized failures — auth errors, quota limits, timeouts — and starts gracefully without an API key (returns
[AUTH_ERROR]on tool call).Configurable: Adjust timeout (default 300s), retries, fallback model, and model aliases via environment variables.
Flexible input: Accepts
questionorquery(alias), up to 64,000 characters.Integrates with Claude Code or Claude Desktop via stdio MCP transport.
MIT licensed and dev-friendly with unit/integration tests and an environment validation script.
Enables querying Google via Gemini with Google Search grounding to retrieve current web information, including synthesized answers, source links, and search queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Ask Google MCP Serverwhat is the latest stable Node.js version?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ask Google MCP Server
ask-google-mcp is a stdio MCP server that exposes a single tool, ask_google.
That tool sends a question to Gemini with Google Search grounding enabled, then returns:
a synthesized answer
appended source links
appended search queries Gemini performed
This is for agent workflows that need current web information inside an MCP client such as Claude Code.
What It Does
ask_google is useful when the agent needs information that should not be answered from stale training data alone, for example:
latest versions, releases, and changelogs
current docs, standards, or API changes
comparisons between current products or libraries
recent announcements or status checks
short web research tasks with citations
The server is intentionally narrow:
one MCP tool:
ask_googlestdio transport only
no web UI
no HTTP server
Related MCP server: Gemini MCP Server
Recommended Setup: Claude Code User Scope
I checked the local Claude Code CLI help.
claude mcp --help shows that add supports scopes local, user, and project, and claude mcp add --help shows the default scope is local.
If you want this available across all projects, use --scope user.
Option 1: Install from npm globally
npm install -g @gpriday/ask-google-mcpThen add it to Claude Code at user scope and set the API key directly in the MCP config:
claude mcp add --scope user -e GOOGLE_API_KEY=your_api_key_here ask-google -- ask-google-mcpVerify it:
claude mcp get ask-google
claude mcp listOption 2: Use a local checkout
This is better for development, not for normal usage.
git clone https://github.com/gpriday/ask-google-mcp.git
cd ask-google-mcp
npm installThen register that checkout with Claude Code:
claude mcp add --scope user -e GOOGLE_API_KEY=your_api_key_here ask-google -- node /absolute/path/to/ask-google-mcp/src/index.jsRequirements
Node.js
>=20A Google AI Studio API key with Gemini access
Get an API key here:
How Configuration Actually Works
The server loads environment variables in this order:
process.cwd()/.env~/.envexisting process environment variables
That means:
it does read
~/.envit does not read a fixed repository root unless the server process is started from that directory
for Claude Code, passing the API key with
claude mcp add -e GOOGLE_API_KEY=...is the clearest and most reliable setup
Minimum required variable for live tool calls:
GOOGLE_API_KEY=your_api_key_hereOptional variables:
ASK_GOOGLE_MAX_RETRIES=2 # 0 disables retries entirely
ASK_GOOGLE_INITIAL_RETRY_DELAY_MS=1000
# Size caps
ASK_GOOGLE_MAX_QUESTION_LENGTH=64000
ASK_GOOGLE_MAX_RESPONSE_CHARS=2000000
ASK_GOOGLE_MAX_OUTPUT_TOKENS=32768
# Timeouts (milliseconds)
ASK_GOOGLE_TIMEOUT_MS=120000 # hard ceiling per attempt
ASK_GOOGLE_TTFT_MS=45000 # abort if no first token arrives in this window
ASK_GOOGLE_INACTIVITY_MS=25000 # abort if the stream goes silent mid-response
ASK_GOOGLE_OVERALL_BUDGET_MS=420000
# Gemini 3.7 Flash thinking level: LOW|MEDIUM|HIGH (default LOW)
ASK_GOOGLE_THINKING_LEVEL=LOW
# Override the model id, only needed if Google renames it
# ASK_GOOGLE_MODEL=gemini-3.7-flashRuntime Behavior
The server starts even if
GOOGLE_API_KEYis missing.MCP clients can still initialize and list tools without the key.
The
ask_googletool itself returns an[AUTH_ERROR]if called without a key.Each attempt is capped by
ASK_GOOGLE_TIMEOUT_MS, with the whole call bounded byASK_GOOGLE_OVERALL_BUDGET_MS.Retries are enabled for retryable upstream failures.
Tool Reference
Tool name
ask_google
Inputs
question- required string (also accepted asqueryalias; do not set both)
That is the entire input surface. There is no model parameter: every request goes to
gemini-3.7-flash.
Model
The server always calls gemini-3.7-flash. There are no tiers, no model argument, and no
routing step — one model handles both quick lookups and multi-source research briefs.
Set ASK_GOOGLE_MODEL if Google renames the model id and you need to point at the new one.
Breaking change in 0.11.0. Earlier versions exposed a
modelparameter (auto,flash,flash-lite, plus a legacyproalias) and an auto-routing classifier. All of that is gone. Amodelargument sent by an older caller is ignored rather than rejected, so existing integrations keep working — they just always getgemini-3.7-flash.
Example Tool Calls
Basic current-information query
{
"name": "ask_google",
"arguments": {
"question": "Find the current Node.js LTS version and its release date"
}
}Research-style comparison
{
"name": "ask_google",
"arguments": {
"question": "React 19 vs React 18: current migration risks, breaking changes, and official upgrade guidance"
}
}What The Tool Returns
The tool returns text content that includes:
Gemini's answer
a
Sourcessection appended by the servera
Search queries performedsection appended by the server when available
CLI Usage
If you installed the package globally:
ask-google-mcpIf you are running from a local checkout:
npm startCLI flags:
ask-google-mcp --help
ask-google-mcp --versionEnvironment Validation
For local development, validate configuration with:
npm run check-envThat script checks:
whether a local
.envor~/.envexistswhether
GOOGLE_API_KEYlooks present and non-placeholderNode.js version compatibility
optional runtime settings like timeout flags
Claude Desktop
Claude Code is the primary recommended workflow, but Claude Desktop can also run the server.
Global install example:
{
"mcpServers": {
"ask-google": {
"command": "ask-google-mcp",
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}Local checkout example:
{
"mcpServers": {
"ask-google": {
"command": "node",
"args": ["/absolute/path/to/ask-google-mcp/src/index.js"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}Development
Project structure:
src/
ask-google.js
config.js
errors.js
index.js
prompt.js
retry.js
sanitize.js
server.js
system-prompt.txt
tool.js
scripts/
check-env.js
test/
integration/
support/
unit/Scripts:
npm start- start the MCP servernpm test- run unit testsnpm run test:integration- run live integration tests when enablednpm run test:all- run both suitesnpm run dev- run withnode --watchnpm run check-env- validate environment config
Live integration tests only run when both are set:
RUN_LIVE_TESTS=1
GOOGLE_API_KEY=your_api_key_hereError Categories
Tool failures are surfaced as MCP errors with categorized messages:
[AUTH_ERROR]- missing or invalid API key[QUOTA_ERROR]- quota or rate limit exceeded[TIMEOUT_ERROR]- request timed out[API_ERROR]- other Gemini/API failures
License
MIT
Available Tools
1 toolask_googleARead-onlyIdempotent
Gemini with Google Search grounding. Use for current/latest facts that post-date your training: versions, releases, API changes, changelogs, breaking news, on-demand web research. Do not use for stable syntax or knowledge already in your training. Short lookups or multi-paragraph briefs both work.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Google model. 'auto' (default, recommended) picks the right tier automatically. Override with 'flash' or 'flash-lite' only if you need a specific one. | auto |
| query | No | Alias for `question`. Accepted for compatibility with callers that use the name `query`; prefer `question`. Do not set both at once. | |
| question | No | Your question for the AI researcher. Short lookups or multi-paragraph research briefs both work. Prefer 'current/latest/as of today' over hardcoding dates unless a specific historical year matters. `query` is accepted as an alias. |
Output Schema
| Name | Required | Description |
|---|---|---|
| answer | Yes | |
| sources | No | |
| supports | No | |
| diagnostics | No | |
| search_queries | No | |
| grounding_status | No | How thoroughly the answer is grounded. 'grounded' = sources + per-claim supports. 'sources_only' = pages retrieved but no per-claim mapping. 'no_sources' = search ran but returned nothing — answer is from training data, treat with high skepticism. 'not_attempted' / 'unavailable' = even worse. |
| answer_with_citations | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, and idempotentHint. The description adds context about using Gemini with Google Search grounding and the nature of queries. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is brief (3 sentences), front-loaded with purpose, and every sentence adds value. No unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no sibling tools, rich annotations, full schema coverage, and presence of output schema, the description is complete. It covers when to use, when not to use, and the nature of the tool without omissions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with detailed descriptions and examples for both parameters. The description adds only a minor note that queries can be short or long, but the schema already covers parameter semantics adequately. Baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool is for current/latest facts post-dating training, listing specific use cases like versions, API changes, and breaking news. It distinguishes itself from general knowledge by explicitly stating what not to use it for.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides when to use (current topics) and when not to use (stable syntax, training knowledge). Also mentions both short lookups and multi-paragraph briefs are acceptable, offering clear guidance on usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Only one tool exists, so there is no risk of confusion between tools. The tool's purpose is clear and distinct.
The single tool name 'ask_google' follows a clear verb_noun pattern, which is consistent with best practices. No other tools exist to create inconsistency.
A single tool is borderline for a server. While it serves a specific purpose (web search with grounding), users might expect additional related tools such as search with different parameters or result formatting.
The tool covers the core functionality of web search, but lacks features like search type selection, result filtering, or session management. Minor gaps exist but the tool can still perform its primary task effectively.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Google AI Overview answers and cited sources via the Apify Google AI Overview API, hosted MCP.
Web search, scraping, RAG answers with citations, and translation as MCP tools.
Serper MCP — wraps the Serper Google Search API (serper.dev)
MCP server for Google search results via SERP API
Related MCP Servers
- AlicenseAqualityCmaintenanceImplementation of Model Context Protocol (MCP) server that provides tools for accessing Google Cloud's Vertex AI Gemini models, supporting features like web search grounding and direct knowledge answering for coding assistance and general queries.204887MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to perform web searches using Google's Gemini API and return synthesized responses with citations.53MIT
- AlicenseNot gradedqualityDmaintenanceFree, unlimited web search MCP server using Gemini CLI's Google Search grounding to provide cited, live web results for any AI agent.1MIT
- FlicenseNot gradedqualityDmaintenanceMinimal MCP server that provides access to Google's Gemini API with Google Search grounding for up-to-date information through a single ask_gemini tool.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gregpriday/ask-google-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server