mcp-gemini-google-search

MCP server for Google Search integration using Gemini's built-in search capabilities

GitHub Stars

66

User Rating

Not Rated

Favorites

0

Views

41

Forks

4

Issues

2

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js 18 or later
Google AI Studio API key or Google Cloud Project with Vertex AI enabled

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version

Installation Steps

1. Clone Repository

bash
git clone https://github.com/yukukotani/mcp-gemini-google-search.git
cd mcp-gemini-google-search

2. Install Dependencies

bash
npm install -g mcp-gemini-google-search

3. Configure Claude Desktop

Edit claude_desktop_config.json to add the MCP server:
json
{
  "mcpServers": {
    "gemini-google-search": {
      "command": "npx",
      "args": ["mcp-gemini-google-search"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

4. Start Server

bash
npm start

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.

Configuration

Configuration

Basic Configuration

Claude Desktop Setup

Edit ~/.config/claude-desktop/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
json
{
  "mcpServers": {
    "gemini-google-search": {
      "command": "npx",
      "args": ["mcp-gemini-google-search"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Environment Variables

Set the following environment variables as needed:
bash
export GEMINI_API_KEY="your-api-key-here"
export GEMINI_MODEL="gemini-2.5-flash"

Advanced Configuration

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels

Performance Tuning

Configure timeout values
Limit concurrent executions
Set up caching

Configuration Examples

Basic Configuration

json
{
  "mcpServers": {
    "gemini-google-search": {
      "command": "npx",
      "args": ["mcp-gemini-google-search"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Advanced Configuration

json
{
  "mcpServers": {
    "advanced-mcp": {
      "command": "python",
      "args": ["-m", "server"],
      "cwd": "/path/to/server",
      "env": {
        "PYTHONPATH": "/path/to/modules",
        "CONFIG_FILE": "/path/to/config.json"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - google_search: Search Google for information.
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('google_search', {
  query: 'latest TypeScript features'
});

console.log(result);

Advanced Examples

Automation Script

bash
#!/bin/bash

Batch processing example

for file in *.txt; do mcp-tool process "$file" done

API Integration

python

Python example

import requests import json def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:3000/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('google_search', { 'query': 'latest TypeScript features' })

Use Cases

Real-time information retrieval in web applications
Instant responses to user queries in AI chatbots
Fetching the latest information for data analysis tools
Research assistance in educational platforms

Additional Resources