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
招投标大数据服务
Provides comprehensive information queries for enterprise qualification certificates, including honors, administrative licenses, and profiles.
Find BGM
Finds background music for YouTube shorts by analyzing script content and recommending tracks from YouTube Music.
门店大数据服务
Provides comprehensive offline store information queries, including enterprise restaurant brand store search, offline store search, and restaurant brand store statistics.
Custom Elasticsearch
A simple MCP server for Elasticsearch, designed for cloud environments where your public key is already authorized.
Finviz MCP Server
Provides stock screening and fundamental analysis using Finviz data. Requires a Finviz Elite subscription.
招投标大数据服务
Query comprehensive enterprise information from e-commerce platforms, including store details, sales data, and product statistics.
Langgraph Deep Search MCP Server
A deep search server powered by LangGraph and the Google Gemini API.
Exa
Exa AI Search API
National Parks
Access real-time information about U.S. National Parks, including park details, alerts, and activities, via the National Park Service (NPS) API.
Google Maps MCP Server
Integrates Google Maps for route planning, traffic analysis, and cost estimation.