Provides access to Google Gemini AI models for multi-turn conversations, file and image analysis, automatic model selection based on content length, deep thinking mode with reasoning output, and Google Search integration for up-to-date information.
Gemini MCP Server
A Model Context Protocol (MCP) server that provides Google Gemini AI capabilities to MCP-compatible clients like Claude Desktop and Claude Code.
Overview
This MCP server acts as a bridge between MCP clients and Google Gemini models, enabling:
Multi-turn conversations with session management
File and image analysis with glob pattern support
Automatic model selection based on content length
Deep thinking mode with reasoning output
Google Search integration for up-to-date information
Prerequisites
1. AIStudioProxyAPI Backend
This MCP server requires AIStudioProxyAPI as the backend service.
The API will be available at http://127.0.0.1:2048 by default.
2. uv Package Manager
Installation
Configuration
Environment Variables
Variable | Default | Description |
|
| AIStudioProxyAPI endpoint |
| (empty) | Optional API key |
|
| Root directory for file resolution |
Claude Desktop / Claude Code
Add to ~/.claude/mcp.json:
Tools
gemini_chat
Send a message to Google Gemini with optional file attachments.
Parameter | Type | Required | Description |
| string | Yes | Message to send (1-100,000 chars) |
| list[string] | No | File paths or glob patterns |
| string | No | Session ID (
for recent) |
| string | No | Override model selection |
| string | No | System context |
| float | No | Sampling temperature (0.0-2.0) |
| int | No | Max response tokens |
| enum | No |
or
|
Examples:
gemini_list_models
List available Gemini models.
Parameter | Type | Required | Description |
| string | No | Filter models by name |
| enum | No |
or
|
Model Selection
Auto-selects model based on content length:
Content Size | Model |
≤ 8,000 chars |
|
> 8,000 chars |
|
Fallback |
|
Features
Session Management
Automatic session creation
Use
"last"to continue recent conversationLRU eviction (max 50 sessions)
File Support
Images: PNG, JPG, JPEG, GIF, WebP, BMP
Text: Any text-based file with auto-encoding detection
Glob patterns:
*.py,src/**/*.ts, etc.
Built-in Capabilities
reasoning_effort: high- Deep thinking modegoogle_search- Web search integrationAutomatic retry with model fallback
Running Standalone
Project Structure
Related Projects
AIStudioProxyAPI - Backend API service (required)
Model Context Protocol - MCP specification
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.