MCP Gemini Grounded Search
A Go-based MCP server providing grounded search functionality using Google's Gemini API.
MCP Gemini Grounded Search
MCP Gemini Grounded Search is a Go-based MCP server implementation that provides grounded search functionality using Google's Gemini API, allowing MCP clients (e.g., Claude Desktop) to perform web searches and retrieve up-to-date information with sources.
Features
- MCP Compliance: Provides a JSON‐RPC based interface for tool execution according to the MCP specification.
- Grounded Search: Uses Gemini API to generate search results with source information (attributions).
- Customizable: Configure through config file, environment variables, or command line options.
Requirements
- Docker (recommended)
For local development:
- Go 1.24 or later
- Gemini API key
Using with Docker (Recommended)
docker pull cnosuke/mcp-gemini-grounded-search:latest
docker run -i --rm -e GEMINI_API_KEY="your-api-key" cnosuke/mcp-gemini-grounded-search:latest
Using with Claude Desktop (Docker)
To integrate with Claude Desktop using Docker, add an entry to your claude_desktop_config.json file:
{
"mcpServers": {
"gemini-search": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GEMINI_API_KEY=your-api-key", "cnosuke/mcp-gemini-grounded-search:latest"]
}
}
}
Usage with Claude Code (Docker)
To integrate with Claude Code using Docker, type the following command in the terminal:
claude mcp add-json mcp-gemini-grounded-search '{
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GEMINI_API_KEY",
"-e",
"GEMINI_MODEL_NAME",
"cnosuke/mcp-gemini-grounded-search:latest"
],
"env": {
"GEMINI_MODEL_NAME": "gemini-2.5-flash",
"GEMINI_API_KEY": "<your-gemini-api-key>"
}
}'
Building and Running (Go Binary)
Alternatively, you can build and run the Go binary directly:
# Build the server
make bin/mcp-gemini-grounded-search
# Run the server
./bin/mcp-gemini-grounded-search server --api-key="your-api-key"
Using with Claude Desktop (Go Binary)
To integrate with Claude Desktop using the Go binary, add an entry to your claude_desktop_config.json file:
{
"mcpServers": {
"gemini-search": {
"command": "./bin/mcp-gemini-grounded-search",
"args": ["server"],
"env": {
"LOG_PATH": "mcp-gemini-grounded-search.log",
"DEBUG": "false",
"GEMINI_API_KEY": "your-api-key",
"GEMINI_MODEL_NAME": "gemini-2.5-flash-preview-04-17"
}
}
}
}
Configuration
The server is configured via a YAML file (default: config.yml). For example:
log: 'path/to/mcp-gemini-grounded-search.log' # Log file path, if empty no log will be produced
debug: false # Enable debug mode for verbose logging
gemini:
api_key: "your-api-key" # Gemini API key
model_name: "gemini-2.5-flash-preview-04-17" # Gemini model to use
You can override configurations using environment variables:
LOG_PATH: Path to log fileDEBUG: Enable debug mode (true/false)GEMINI_API_KEY: Gemini API keyGEMINI_MODEL_NAME: Gemini model name
Logging
Logging behavior is controlled through configuration:
- If
logis set in the config file, logs will be written to the specified file - If
logis empty, no logs will be produced - Set
debug: truefor more verbose logging
MCP Server Usage
MCP clients interact with the server by sending JSON‐RPC requests to execute various tools. The following MCP tools are supported:
search: Performs a web search using the Gemini API and returns results with source information.-
Parameters:
query(string, required): The search querymax_token(number, optional): Maximum number of tokens for the generated response
-
Response format:
{ "text": "Generated text content", "groundings": [ { "title": "Source title", "domain": "Source domain", "url": "Source URL" }, ... ] }
-
Command-Line Parameters
When starting the server, you can specify various settings:
./bin/mcp-gemini-grounded-search server [options]
Options:
--config,-c: Path to the configuration file (default: "config.yml")--log,-l: Path to log file (overrides config file)--debug,-d: Enable debug mode (overrides config file)--api-key,-k: Gemini API key (overrides config file)--model,-m: Gemini model name (overrides config file)
Contributing
Contributions are welcome! Please fork the repository and submit pull requests for improvements or bug fixes. For major changes, open an issue first to discuss your ideas.
License
This project is licensed under the MIT License.
Author: cnosuke ( x.com/cnosuke )
Related Servers
Google Research
Perform advanced web research using Google Search, with intelligent content extraction and multi-source synthesis.
Search Intent MCP
Analyzes user search keyword intent for SEO support using the AI Search Intent API.
DevRag
Free local RAG for Claude Code - Save tokens & time with vector search. Indexes markdown docs and finds relevant info without reading entire files (40x fewer tokens, 15x faster).
Harmonic Search
Search for companies and professionals using the Harmonic.ai API.
ChunkHound
A local-first semantic code search tool with vector and regex capabilities, designed for AI assistants.
展会大数据服务
Query comprehensive exhibition information, including enterprise participation records, venue details, and exhibition search.
PubTator MCP Server
A server for biomedical literature annotation and relationship mining, based on PubTator3.
Librarian
A server to query Wikipedia and automatically fact-check information for any LLM with a compatible MCP client.
Deep Research
An agent-based tool for web search and advanced research, including analysis of PDFs, documents, images, and YouTube transcripts.
Sketchfab
Search, view details, and download 3D models from the Sketchfab platform.