The Gemini AI MCP Server is a tool that provides AI-powered web search and summarization using the Gemini API. Unlike traditional search tools, it synthesizes information to provide comprehensive answers with citations rather than just returning raw results.
git clone https://github.com/ml0-1337/mcp-gemini-grounding.git
cd mcp-gemini-grounding
make build
To see all available commands:
make help
# From source
make install
# Or using go install directly
go install github.com/ml0-1337/mcp-gemini-grounding/cmd/gemini-grounding@latest
The server supports two authentication methods:
OAuth Credentials (Preferred)
~/.gemini/oauth_creds.json
API Key (Fallback)
GEMINI_API_KEY
environment variableImportant: When configuring, always use the full absolute path to the binary.
Using CLI:
# If installed globally
claude mcp add gemini-grounding
# Or with full absolute path (required)
claude mcp add gemini-grounding /full/path/to/mcp-gemini-grounding
Manual Configuration:
{
"mcpServers": {
"gemini-grounding": {
"command": "/path/to/mcp-gemini-grounding",
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}
Using CLI:
# If installed globally
claude mcp add gemini-grounding -s project
# Or with full absolute path
claude mcp add gemini-grounding -s project /full/path/to/mcp-gemini
Manual Configuration:
.mcp.json
file in your project root:{
"mcpServers": {
"gemini-grounding": {
"command": "mcp-gemini-grounding",
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}
GEMINI_API_KEY
environment variable locallyUsing CLI:
# If installed globally
claude mcp add gemini-grounding -s user
# Or with full absolute path
claude mcp add gemini-grounding -s user /full/path/to/mcp-gemini
Manual Configuration:
{
"mcpServers": {
"gemini-grounding": {
"command": "gemini",
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}
After adding the server, set your API key:
# macOS/Linux
export GEMINI_API_KEY="your-api-key-here"
# Windows (PowerShell)
$env:GEMINI_API_KEY="your-api-key-here"
# Windows (Command Prompt)
set GEMINI_API_KEY=your-api-key-here
For permanent configuration, add the export to your shell profile.
Once configured, the google_search
tool will be available in Claude Code. You can prompt Claude to search for information:
The tool returns search results with:
Example output:
Web search results for "quantum computing":
Quantum computing is a rapidly evolving field[1]. Recent breakthroughs have shown promise for practical applications[2].
Sources:
[1] Quantum Computing Explained - MIT (https://mit.edu/quantum)
[2] Latest Quantum Breakthroughs - Nature (https://nature.com/quantum)
Check OAuth credentials exist:
ls ~/.gemini/oauth_creds.json
Or ensure API key is set:
echo $GEMINI_API_KEY
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "gemini-grounding" '{"command":"mcp-gemini-grounding","env":{"GEMINI_API_KEY":"$GEMINI_API_KEY"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"gemini-grounding": {
"command": "mcp-gemini-grounding",
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"gemini-grounding": {
"command": "mcp-gemini-grounding",
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect