
gemini-grounding-mcp
Gemini Grounding MCP
Give Claude Code and other MCP clients current Google Search results through the Gemini API - with inline citation markers and a numbered source list under every answer.
Use it when an assistant needs web-grounded research instead of relying on
training data alone. It builds on nothing but the official @google/genai and
@modelcontextprotocol/sdk packages, pinned to exact versions.
Scope of use: research queries only. Not intended for production workloads or for connecting to sensitive systems.
What it offers
- Citations you can check. Markers such as
[1]sit in the answer text, numbered to match the source list below it. A marker can be missing, but it is never placed where the API does not support it - so an unmarked sentence is a reason to look closer. - The queries Gemini actually ran. The footer lists what was typed into Google, which answers what no source list can: whether the search covered your question at all.
- Token usage for every call, split into input, output and thinking tokens. What they cost is on Google's pricing page.
- Model and thinking level are yours to set. Both persist, both can be overridden for a single request, and both are read at call time, so a change applies to the next answer rather than after a client restart. The thinking level is the main lever on how many tokens a query consumes.
- Failures stay visible. An answer cut off at the token limit or stopped by a filter is marked as such, dropped citation markers are counted, and a failing model returns an error instead of a quiet switch to a different one.
- Search, URL Context and Code Execution in one call. Gemini can read a page you name and run code; if it did, the code and its output are part of the answer. The only instruction the server adds is today's date - what gets researched follows from your question.
- A command line tool on the same core. Verify your API key and model choice before registering the server, and read the full error text when a call fails.
What an answer looks like
Question: "Which Node.js version is currently LTS?"
The current Node.js release versions are as follows [1]:
* Latest LTS: v24.18.1 (recommended for most users)
* Latest Current release: v26.5.1
Sources:
[1] nodejs.org - https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQG52u...
---
π’ 30 input / 86 output / 0 thinking tokens | π 1 sources | π€ gemini-flash-latest (thinking: minimal)
π Searched: Node js latest LTS version
The redirect URL is abbreviated here for readability; the real output carries it in full.
Quick start
Nothing to install up front: the client starts the server through npx, which
fetches the package on first use and caches it - only that first call takes a
few seconds longer. A permanent install is optional and mainly of interest for
the command line tool (see
Installing globally).
1. Set your API key
The key is passed exclusively through the GEMINI_API_KEY environment variable,
never in code and never in the config file. It has to be set persistently,
before the client starts the server.
Windows (PowerShell, user scope, once):
[Environment]::SetEnvironmentVariable('GEMINI_API_KEY', '<your-api-key>', 'User')
Reopen the shell afterwards so the variable is available.
macOS / Linux - add to ~/.zshrc, ~/.bashrc or equivalent:
export
Related servers

n8n
Updated todayby n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

mcp-server-fetch
OfficialUpdated todayA Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

@modelcontextprotocol/server-filesystem
OfficialUpdated todayMCP server for filesystem access