Gemini MCP Server
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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini MCP ServerExplain quantum computing in simple terms"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Gemini Chat MCP
Prerequisites
1. AIStudioProxyAPI Backend
This MCP server requires AIStudioProxyAPI as the backend service.
# Clone and setup AIStudioProxyAPI
git clone https://github.com/CJackHwang/AIstudioProxyAPI.git
cd AIstudioProxyAPI
poetry install
poetry run python launch_camoufox.py --headlessThe API will be available at http://127.0.0.1:2048 by default.
2. uv Package Manager
# Install uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | shInstallation
# Clone this repository
git clone https://github.com/YOUR_USERNAME/aistudio-gemini-mcp.git
cd aistudio-gemini-mcp
# Install dependencies
uv syncConfiguration
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:
{
"mcpServers": {
"gemini": {
"command": "uv",
"args": ["run", "--directory", "/path/to/aistudio-gemini-mcp", "python", "server.py"],
"env": {
"GEMINI_API_BASE_URL": "http://127.0.0.1:2048"
}
}
}
}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 ( |
| string | No | Override model selection |
| string | No | System context |
| float | No | Sampling temperature (0.0-2.0) |
| int | No | Max response tokens |
| enum | No |
|
Examples:
# Simple query
gemini_chat(prompt="Explain quantum computing")
# With file
gemini_chat(prompt="Review this code", file=["main.py"])
# With image
gemini_chat(prompt="Describe this", file=["photo.png"])
# Continue conversation
gemini_chat(prompt="Tell me more", session_id="last")
# Multiple files
gemini_chat(prompt="Analyze", file=["src/**/*.py"])gemini_list_models
List available Gemini models.
Parameter | Type | Required | Description |
| string | No | Filter models by name |
| enum | No |
|
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
# Start the MCP server
uv run python server.pyProject Structure
aistudio-gemini-mcp/
├── server.py # MCP server implementation
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lock file
├── README.md # This file
├── LICENSE # MIT License
└── mcp_config_example.jsonRelated 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.
Available Tools
2 toolsgemini_chatARead-only
Send a message to Google Gemini and get a response.
Args:
params (GeminiChatInput): Chat parameters including:
- prompt (str): The prompt to send
- file (Optional[list[str]]): Files to include (text, code, images)
- session_id (Optional[str]): Session ID for multi-turn chat, use 'last' for recent
- model (Optional[str]): Override model selection
- system_prompt (Optional[str]): System context
- temperature (Optional[float]): Creativity (0.0-2.0)
- max_tokens (Optional[int]): Max response length
- response_format: Output format - 'markdown' or 'json'
Returns:
str: Response with SESSION_ID for continuation.
Examples:
- Simple: prompt="What is AI?"
- With file: prompt="Review", file=["main.py"]
- With image: prompt="Describe", file=["photo.jpg"]
- Continue: prompt="Tell me more", session_id="last"
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds valuable behavioral context beyond what annotations provide. While annotations indicate read-only and non-destructive operations, the description explains multi-turn chat capabilities with session_id, file handling with glob patterns, and model auto-selection behavior. No contradictions with annotations exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (Args, Returns, Examples), uses bullet points for readability, and every sentence adds value. It's appropriately sized for a complex tool with many parameters and provides essential information without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (8 parameters, multi-turn chat, file handling) and the presence of an output schema, the description provides complete context. It explains parameter usage, behavioral characteristics, and includes practical examples, making it fully adequate for an AI agent to understand and use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema description coverage, the description comprehensively documents all 8 parameters with clear explanations of their purpose, constraints, and usage patterns. It adds significant value beyond the bare schema by explaining what each parameter does and how to use them effectively.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Send a message to Google Gemini and get a response') with the exact resource (Google Gemini). It distinguishes from the sibling tool gemini_list_models by focusing on chat completion rather than model listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool (for sending messages to Gemini) and includes examples that illustrate different usage scenarios. However, it doesn't explicitly state when NOT to use it or mention the sibling tool as an alternative for different purposes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gemini_list_modelsBRead-onlyIdempotent
List available Gemini models.
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds no behavioral context beyond what annotations provide, such as rate limits, authentication needs, or what 'available' means in practice. No contradiction with annotations exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple listing operation and front-loaded with essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity, rich annotations, and presence of an output schema, the description is minimally adequate. However, it lacks details on parameter usage and doesn't leverage the output schema to hint at return values, leaving gaps in completeness for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description mentions no parameters at all. The input schema includes 'response_format' and 'filter_text', but the description doesn't explain their purpose or usage. Since there are parameters, the baseline is 3, but the description fails to compensate for the low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('available Gemini models'), making the purpose immediately understandable. It distinguishes from the sibling tool 'gemini_chat' by focusing on listing rather than conversational interaction. However, it doesn't specify what information about models is returned, keeping it from a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tool 'gemini_chat' or any other potential alternatives, nor does it specify prerequisites or contextual triggers for listing models versus other operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
gemini_chat - First observed
gemini_list_models
TDQS
The two tools have completely distinct purposes with no overlap: gemini_chat handles chat interactions with the Gemini API, while gemini_list_models provides metadata about available models. An agent would never confuse these tools as they serve fundamentally different functions in the workflow.
Both tools follow a consistent 'gemini_' prefix + descriptive_snake_case pattern (gemini_chat and gemini_list_models). This creates a predictable naming convention that clearly associates both tools with the Gemini service while maintaining readability and consistency throughout the toolset.
With only 2 tools, this server feels severely under-equipped for a comprehensive Gemini API integration. While chat functionality is essential, the absence of tools for embeddings, file analysis, or other Gemini capabilities creates a thin surface that will limit agent effectiveness. The count is too low for the apparent scope of a full Gemini MCP server.
The tool surface is significantly incomplete for a Gemini integration server. While chat functionality is well-implemented, there are major gaps: no tools for embeddings generation, file content analysis beyond chat context, model information beyond listing, or other Gemini API endpoints. This creates dead ends for agents trying to perform common Gemini workflows beyond basic chat interactions.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI LLM with Gemini, MiniMax, Replicate, OpenRouter. Vision, search, code review. USDC on Base.
- UproarOAuthchat.uproar
Chat where AI agents are first-class members, with their own identity and permissions.
1 Swift AI: Access a wide range of AI models⚡, including OpenAI 🤖,DeepSeek 🔍, Claude 🧠, Gemini 🌟, and.
247 LLMs + image/video/voice/music gen + crypto/DeFi/markets/web-search. Pay-per-call USDC, no key.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Google's Gemini AI models including file uploads, conversation management, and batch API processing for large-scale tasks at reduced costs. Supports multiple Gemini models with advanced features like embeddings generation and automated workflow processing.21201MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables chatting with Google Gemini AI models and custom Gems, supporting text and image generation with automatic cookie synchronization via Chrome extension.3-
- AlicenseBqualityDmaintenanceEnables AI-powered web searches using Google's Gemini 2.5 models with Google Search Grounding. Supports multiple Gemini models (Flash, Flash-Lite, Pro) with configurable thinking budget and web search capabilities.1162MIT
- FlicenseAqualityDmaintenanceEnables Gemini-powered multimodal analysis (video, audio, image, documents), Google search, and code execution via the API易 service. Supports Docker deployment and flexible configuration.2-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xumingjun5208/aistudio-gemini-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server