Gemini MCP Server
Provides access to Google's Gemini API for multi-turn conversations and image generation using Nano Banana, serving as a drop-in alternative to Codex MCP.
README
Gemini MCP Server
An MCP (Model Context Protocol) server that provides access to Google's Gemini API. Drop-in alternative to Codex MCP with matching interface.
Features
- gemini - Start a new Gemini conversation with configurable context
- gemini-reply - Continue multi-turn conversations
- gemini-image - Generate images using Nano Banana (Gemini's native image generation)
Installation
npm install
npm run build
Configuration
Create a .env file or set environment variables:
# Required: Your Google Gemini API key
GEMINI_API_KEY=your_api_key_here
# Optional: Override the model (default: gemini-3-pro-preview)
GEMINI_MODEL=gemini-3-pro-preview
Get your API key from Google AI Studio.
Usage with Claude Code
Add to your MCP settings (~/.claude/mcp.json):
{
"mcpServers": {
"gemini": {
"command": "node",
"args": ["/path/to/gemini-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your_api_key_here"
}
}
}
}
Tools
gemini
Start a new conversation with Gemini.
Parameters:
prompt(required) - The initial promptcwd- Working directory contextsandbox- Access policy: "read-only", "workspace-write", or "danger-full-access"base-instructions- Override default system instructionsdeveloper-instructions- Additional context for the model
Returns: Response text and a conversationId for follow-up.
gemini-reply
Continue an existing conversation.
Parameters:
conversationId(required) - ID from a previous gemini callprompt(required) - Your follow-up message
gemini-image
Generate images using Nano Banana, Google's native image generation built into Gemini.
Models:
- Nano Banana (
gemini-2.5-flash-image) - Fast, cost-effective (~$0.04/image), good for most use cases - Nano Banana Pro (
gemini-3-pro-image-preview) - Advanced model with better text rendering, ideal for infographics, diagrams, and text-heavy images
Auto-Detection: The server automatically uses Nano Banana Pro when your prompt contains keywords like:
- "nano banana pro", "pro model"
- "infographic", "diagram", "chart", "graph"
- "text", "typography", "font", "lettering"
- "logo", "brand", "poster", "flyer", "banner"
- "slide", "presentation", "document"
- "high quality", "4k", "detailed text"
Parameters:
prompt(required) - Description of the image to generatenumberOfImages- How many images (1-4, default: 1)aspectRatio- Image ratio: "1:1", "3:4", "4:3", "9:16", "16:9"usePro- Force Nano Banana Pro (auto-detected from prompt if not specified)outputPath- Directory to save generated images
Example:
// Auto-detects Pro model
"Create an infographic showing the software development lifecycle"
// Explicitly request Pro
{ "prompt": "A sunset over mountains", "usePro": true }
// Fast generation (default)
"A cute cat wearing a hat"
Development
# Run in development mode
npm run dev
# Build for production
npm run build
# Start production server
npm start
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.