io.github.RLabs-Inc/gemini-mcp MCP Server
io.github.RLabs-Inc/gemini-mcp
Integrate Google's Gemini 3 with Claude via 30+ tools: image/video generation, research, code execution, TTS, and web search.
What is the io.github.RLabs-Inc/gemini-mcp MCP server?
The Gemini MCP server is a Model Context Protocol server that connects Google's Gemini 3 models with Claude, exposing 30+ tools for image generation, video creation, web research, code execution, text-to-speech, and document analysis. It enables powerful AI collaboration between Claude and Gemini for development, content creation, and research workflows.
This MCP server bridges Claude and Google's Gemini 3, giving Claude access to Gemini's capabilities including 4K image generation, video creation with Veo, real-time web search, deep research, code execution, text-to-speech with 30 voices, YouTube analysis, document processing, and more. Use it to extend Claude's abilities for creative generation, research, data extraction, and multimodal tasks.
How to install io.github.RLabs-Inc/gemini-mcp
Copy-paste configuration for popular MCP clients.
GEMINI_API_KEYrequiredsecretYour Google Gemini API key (get one at https://aistudio.google.com/apikey)
GEMINI_OUTPUT_DIRDirectory for generated files (images, videos, audio)
{
"mcpServers": {
"gemini-mcp": {
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<YOUR_GEMINI_OUTPUT_DIR>"
}
}
}
}{
"mcpServers": {
"gemini-mcp": {
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<YOUR_GEMINI_OUTPUT_DIR>"
}
}
}
}{
"mcpServers": {
"gemini-mcp": {
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<YOUR_GEMINI_OUTPUT_DIR>"
}
}
}
}{
"servers": {
"gemini-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<YOUR_GEMINI_OUTPUT_DIR>"
}
}
}
}claude mcp add gemini-mcp --env GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> --env GEMINI_OUTPUT_DIR=<YOUR_GEMINI_OUTPUT_DIR> -- npx -y @rlabs-inc/gemini-mcpTools & capabilities
Tools this server exposes to the agent.
gemini-query— Direct queries to Gemini Pro or Flash models with configurable thinking levels (low/medium/high)gemini-generate-image— Generate images up to 4K resolution with style, aspect ratio, and seed controlgemini-start-image-edit— Begin a multi-turn image editing session for iterative refinementgemini-continue-image-edit— Refine an image in an active editing sessiongemini-end-image-edit— Close an image editing sessiongemini-list-image-sessions— List all active image editing sessionsgemini-generate-video— Generate videos using Veo 2.0 with async polling supportgemini-check-video— Check video generation status and download when completegemini-analyze-code— Analyze code for quality, security, performance, bugs, or general issuesgemini-analyze-text— Analyze text for sentiment, entities, key points, or summariesgemini-brainstorm— Collaborative brainstorming between Claude and Geminigemini-summarize— Summarize content in brief, moderate, or detailed formatsgemini-run-code— Execute Python code written by Gemini with numpy, pandas, matplotlib, scipy, scikit-learn, tensorflowgemini-search— Real-time web search with inline citations and source URLsgemini-structured— Get JSON responses matching a provided schemagemini-extract— Extract entities, facts, keywords, sentiment, or custom fields from textgemini-youtube— Analyze YouTube videos by URL with optional timestamp clippinggemini-youtube-summary— Summarize YouTube videos in brief, detailed, bullet-point, or chapter formatsgemini-analyze-document— Analyze PDFs and documents (DOCX, spreadsheets) with questionsgemini-summarize-pdf— Summarize PDF documents in brief, detailed, outline, or key-points formats
Use cases
- Generate 4K images and iteratively refine them through multi-turn editing conversations
- Execute Python data analysis and visualization tasks with Gemini writing and running code
- Conduct deep research on topics with autonomous web search and citation tracking
- Analyze documents, PDFs, and YouTube videos to extract insights and summaries
- Create videos, generate speech in 30 voices, and build Claude+Gemini collaborative workflows
io.github.RLabs-Inc/gemini-mcp MCP server FAQ
It's an MCP server that connects Google's Gemini 3 models to Claude, exposing 30+ tools for image/video generation, web research, code execution, text-to-speech, document analysis, and more. It enables Claude to leverage Gemini's capabilities for creative, analytical, and research tasks.
The server itself is free (MIT licensed). You need a free Google Gemini API key from Google AI Studio (aistudio.google.com/apikey). Free tier has rate limits; paid plans available for higher usage.
Run: `claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY npx -y @rlabs-inc/gemini-mcp` (replace YOUR_KEY with your API key from Google AI Studio). For Cursor, use the same command or add to your MCP configuration.
You need a Google Gemini API key from Google AI Studio (free, takes seconds to generate). Set it via the GEMINI_API_KEY environment variable when installing the MCP server.
Yes. Install globally with `npm install -g @rlabs-inc/gemini-mcp`, set your API key with `gcli config set api-key YOUR_KEY`, then use commands like `gcli image`, `gcli search`, `gcli research`, `gcli speak`, etc.
Use tool presets or explicit tool lists. Set `GEMINI_TOOL_PRESET=minimal` for just query/brainstorm, or `GEMINI_ENABLED_TOOLS=query,search,image-gen` to load only specific tools. Presets include: minimal, text, image, research, media, full.
README (reference)
Source of truth, from the repository.
MCP Server Gemini
A Model Context Protocol (MCP) server for integrating Google's Gemini 3 models with Claude Code, enabling powerful collaboration between both AI systems. Now with a beautiful CLI!
MCP Registry Support: Now discoverable in the official MCP ecosystem!
Features
| Feature | Description |
|---|---|
| Deep Research Agent | Autonomous multi-step research with web search and citations |
| Token Counting | Count tokens and estimate costs before API calls |
| Text-to-Speech | 30 unique voices, single speaker or two-speaker dialogues |
| URL Analysis | Analyze, compare, and extract data from web pages |
| Context Caching | Cache large documents for efficient repeated queries |
| YouTube Analysis | Analyze videos by URL with timestamp clipping |
| Document Analysis | PDFs, DOCX, spreadsheets with table extraction |
| 4K Image Generation | Generate images up to 4K with 10 aspect ratios |
| Multi-Turn Image Editing | Iteratively refine images through conversation |
| Video Generation | Create videos with Veo 2.0 (async with polling) |
| Code Execution | Gemini writes and runs Python code (pandas, numpy, matplotlib) |
| Google Search | Real-time web information with inline citations |
| Structured Output | JSON responses with schema validation |
| Data Extraction | Extract entities, facts, sentiment from text |
| Thinking Levels | Control reasoning depth (minimal/low/medium/high) |
| Direct Query | Send prompts to Gemini 3 Pro/Flash models |
| Brainstorming | Claude + Gemini collaborative problem-solving |
| Code Analysis | Analyze code for quality, security, performance |
| Summarization | Summarize content at different detail levels |
Quick Installation
MCP Server for Claude Code
# Using npm (Recommended)
claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY npx -y @rlabs-inc/gemini-mcp
# Using bun
claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY bunx @rlabs-inc/gemini-mcp
CLI (Global Install)
# Install globally
npm install -g @rlabs-inc/gemini-mcp
# Set your API key once (stored securely)
gcli config set api-key YOUR_KEY
# Now use any command!
gcli search "latest news"
glci image "sunset over mountains" --ratio 16:9
Get your API key: Visit Google AI Studio - it's free and takes seconds!
Installation Options
# With verbose logging
claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY VERBOSE=true bunx -y @rlabs-inc/gemini-mcp
# With custom output directory for generated images/videos
claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY GEMINI_OUTPUT_DIR=/path/to/output bunx -y @rlabs-inc/gemini-mcp
Available Tools
gemini-query
Direct queries to Gemini with thinking level control:
prompt: "Explain quantum entanglement"
model: "pro" or "flash"
thinkingLevel: "low" | "medium" | "high" (optional)
- low: Fast responses, minimal reasoning
- medium: Balanced (Flash only)
- high: Deep reasoning for complex tasks (default)
gemini-generate-image
Generate images with Nano Banana Pro (Claude can SEE them!):
prompt: "a futuristic city at sunset"
style: "cyberpunk" (optional)
aspectRatio: "16:9" (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9)
imageSize: "2K" (1K, 2K, 4K)
useGoogleSearch: false (ground in real-world info)
thinkingLevel: "high" (optional - minimal, low, medium, high)
personGeneration: "ALLOW_ALL" (optional - ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE)
seed: 42 (optional - for reproducible results)
gemini-start-image-edit
Start a multi-turn image editing session:
prompt: "a cozy cabin in the mountains"
aspectRatio: "16:9"
imageSize: "2K"
useGoogleSearch: false
thinkingLevel: "high" (optional - minimal, low, medium, high)
personGeneration: "ALLOW_ALL" (optional - ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE)
seed: 42 (optional - for reproducible results)
Returns a session ID for iterative editing.
gemini-continue-image-edit
Continue refining an image:
sessionId: "edit-123456789"
prompt: "add snow on the roof and make it nighttime"
gemini-end-image-edit
Close an editing session:
sessionId: "edit-123456789"
gemini-list-image-sessions
List all active editing sessions.
gemini-generate-video
Generate videos using Veo:
prompt: "a cat playing piano"
aspectRatio: "16:9" (optional)
negativePrompt: "blurry, text" (optional)
Video generation is async (takes 1-5 minutes). Use gemini-check-video to poll.
gemini-check-video
Check video generation status and download when complete:
operationId: "operations/xxx-xxx-xxx"
gemini-analyze-code
Analyze code for issues:
code: "function foo() { ... }"
language: "typescript" (optional)
focus: "quality" | "security" | "performance" | "bugs" | "general"
gemini-analyze-text
Analyze text content:
text: "Your text here..."
type: "sentiment" | "summary" | "entities" | "key-points" | "general"
gemini-brainstorm
Collaborative brainstorming:
prompt: "How could we implement real-time collaboration?"
claudeThoughts: "I think we should use WebSockets..."
maxRounds: 3 (optional)
gemini-summarize
Summarize content:
content: "Long text to summarize..."
length: "brief" | "moderate" | "detailed"
format: "paragraph" | "bullet-points" | "outline"
gemini-run-code
Let Gemini write and execute Python code:
prompt: "Calculate the first 50 prime numbers and plot them"
data: "optional CSV data to analyze" (optional)
Supports libraries: numpy, pandas, matplotlib, scipy, scikit-learn, tensorflow, and more. Generated charts are saved to the output directory and returned as images.
gemini-search
Real-time web search with citations:
query: "What happened in tech news this week?"
returnCitations: true (default)
Returns grounded responses with inline citations and source URLs.
gemini-structured
Get JSON responses matching a schema:
prompt: "Extract the meeting details from this email..."
schema: '{"type":"object","properties":{"date":{"type":"string"},"attendees":{"type":"array"}}}'
useGoogleSearch: false (optional)
gemini-extract
Convenience tool for common extraction patterns:
text: "Your text to analyze..."
extractType: "entities" | "facts" | "summary" | "keywords" | "sentiment" | "custom"
customFields: "name, date, amount" (for custom extraction)
gemini-youtube
Analyze YouTube videos directly:
url: "https://www.youtube.com/watch?v=..."
question: "What happens at 2:30?"
startTime: "1m30s" (optional, for clipping)
endTime: "5m00s" (optional, for clipping)
gemini-youtube-summary
Quick video summarization:
url: "https://www.youtube.com/watch?v=..."
style: "brief" | "detailed" | "bullet-points" | "chapters"
gemini-analyze-document
Analyze PDFs and documents:
filePath: "/path/to/document.pdf"
question: "Summarize the key findings"
mediaResolution: "low" | "medium" | "high"
gemini-summarize-pdf
Quick PDF summarization:
filePath: "/path/to/document.pdf"
style: "brief" | "detailed" | "outline" | "key-points"
gemini-extract-tables
Extract tables from documents:
filePath: "/path/to/document.pdf"
outputFormat: "markdown" | "csv" | "json"
Workflow: Claude + Gemini
The killer combination for development:
| Claude | Gemini |
|---|---|
| Complex logic | Frontend/UI |
| Architecture | Visual components |
| Backend code | Image generation |
| Integration | React/CSS styling |
| Reasoning | Creative generation |
Example workflow:
- Ask Claude to design the backend API
- Use
gemini-generate-imagefor UI mockups - Ask Gemini to generate React components via
gemini-query - Use multi-turn editing to refine visuals
- Let Claude wire everything together
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
GEMINI_API_KEY | Yes | - | Your Google Gemini API key |
GEMINI_OUTPUT_DIR | No | ./gemini-output | Where to save generated files |
GEMINI_MODEL | No | - | Override model for init test |
GEMINI_PRO_MODEL | No | gemini-3-pro-preview | Pro model (Gemini 3) |
GEMINI_FLASH_MODEL | No | gemini-3-flash-preview | Flash model (Gemini 3) |
GEMINI_IMAGE_MODEL | No | gemini-3-pro-image-preview | Image model (Nano Banana Pro) |
GEMINI_IMAGE_THINKING_LEVEL | No | high | Default thinking level for image generation (minimal, low, medium, high) |
GEMINI_VIDEO_MODEL | No | veo-2.0-generate-001 | Video model |
VERBOSE | No | false | Enable verbose logging |
QUIET | No | false | Minimize logging |
GEMINI_ENABLED_TOOLS | No | - | Comma-separated list of tool groups to load (e.g., query,search,image-gen) |
GEMINI_TOOL_PRESET | No | - | Preset profile: minimal, text, image, research, media, full |
Tool Configuration
By default, all 37 tools are loaded. To reduce context usage, configure which tools to load:
Available Presets
| Preset | Tool Groups |
|---|---|
minimal | query, brainstorm |
text | query, brainstorm, analyze, summarize, structured |
image | query, image-gen, image-edit, image-analyze |
research | query, search, deep-research, url-context, document |
media | query, image-gen, image-edit, image-analyze, video-gen, youtube, speech |
full | All 18 tool groups (default) |
Using Presets
# Minimal - query and brainstorm
GEMINI_TOOL_PRESET=minimal
# Text processing
GEMINI_TOOL_PRESET=text # query, brainstorm, analyze, summarize, structured
# Image workflows
GEMINI_TOOL_PRESET=image # query, image-gen, image-edit, image-analyze
# Research workflows
GEMINI_TOOL_PRESET=research # query, search, deep-research, url-context, document
Using Explicit Tool Lists
# Only specific tools
GEMINI_ENABLED_TOOLS=query,search,image-gen
Combining Preset + Explicit
# Start with preset, add extras
GEMINI_TOOL_PRESET=minimal
GEMINI_ENABLED_TOOLS=search,image-gen # Adds to minimal preset
Available Tool Groups
| Group | Tools |
|---|---|
query | gemini-query |
brainstorm | gemini-brainstorm |
analyze | gemini-analyze-code, gemini-analyze-text |
summarize | gemini-summarize |
image-gen | gemini-generate-image, gemini-image-prompt |
image-edit | gemini-start-image-edit, gemini-continue-image-edit, gemini-end-image-edit, gemini-list-image-sessions |
video-gen | gemini-generate-video, gemini-check-video |
code-exec | gemini-run-code |
search | gemini-search |
structured | gemini-structured, gemini-extract |
youtube | gemini-youtube, gemini-youtube-summary |
document | gemini-analyze-document, gemini-summarize-pdf, gemini-extract-tables |
url-context | gemini-analyze-url, gemini-compare-urls, gemini-extract-from-url |
cache | gemini-create-cache, gemini-query-cache, gemini-list-caches, gemini-delete-cache |
speech | gemini-speak, gemini-dialogue, gemini-list-voices |
token-count | gemini-count-tokens |
deep-research | gemini-deep-research, gemini-check-research, gemini-research-followup |
image-analyze | gemini-analyze-image |
Manual Installation
Global Install
# Using npm
npm install -g @rlabs-inc/gemini-mcp
# Using bun
bun install -g @rlabs-inc/gemini-mcp
Claude Code Configuration
{
"gemini": {
"command": "npx",
"args": ["-y", "@rlabs-inc/gemini-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key",
"GEMINI_OUTPUT_DIR": "/path/to/save/files"
}
}
}
Troubleshooting
Rate Limits (429 Errors)
If you're hitting rate limits on the free tier:
- Set
GEMINI_MODEL=gemini-3-flash-previewto use Flash for init (higher limits) - Or upgrade to a paid plan
Connection Issues
- Verify your API key at Google AI Studio
- Check server status:
claude mcp list - Try with verbose logging:
VERBOSE=true
Image/Video Issues
- Ensure your API key has access to image/video generation
- Check output directory permissions
- Files save to
GEMINI_OUTPUT_DIR(default:./gemini-output) - For 4K images, generation takes longer
Previous Versions
0.7.2
Beautiful CLI with Themes! Use Gemini directly from your terminal:
# Install globally
npm install -g @rlabs-inc/gemini-mcp
# Set your API key once
gcli config set api-key YOUR_KEY
# Generate images, videos, search, research, and more!
gcli image "a cat astronaut" --size 4K
gcli search "latest AI news"
gcli research "quantum computing applications" --wait
gcli speak "Hello world" --voice Puck
5 Beautiful Themes: terminal, neon, ocean, forest, minimal
CLI Commands:
gcli query- Direct Gemini queries with thinking levelsgcli search- Real-time web search with citationsgcli research- Deep research agentgcli image- Generate images (up to 4K)gcli video- Generate videos with Veogcli speak- Text-to-speech with 30 voicesgcli tokens- Count tokens and estimate costsgcli config- Manage settings
v0.6.x: Deep Research, Token Counting, TTS, URL analysis, Context Caching v0.5.x: 30+ tools, YouTube analysis, Document analysis v0.4.x: Code execution, Google Search v0.3.x: Thinking levels, Structured output, 4K images v0.2.x: Image/Video generation with Veo
Development
git clone https://github.com/rlabs-inc/gemini-mcp.git
cd gemini-mcp
bun install
bun run build
bun run dev -- --verbose
Scripts
| Command | Description |
|---|---|
bun run build | Build for production |
bun run dev | Development mode with watch |
bun run typecheck | Type check without emitting |
bun run format | Format with Prettier |
bun run lint | Lint with ESLint |
License
MIT License
Made with Claude + Gemini working together
Related MCP servers
Scrapling MCP Server
Give your AI agent stealth web scraping with Cloudflare bypass and CSS selection, powered by Scrapling.
Chrome DevTools MCP
Give your AI coding agent full control of a live Chrome browser for automation, debugging, and performance analysis.
com.puter/mcp-server
Let AI agents manage your Puter files, websites, and serverless workers over MCP.
Browser automation for AI agents via MCP, powering ByteDance's Agent TARS hybrid GUI/DOM browser control.
Run arbitrary shell commands from an MCP-connected AI agent.
Filesystem access MCP server from ByteDance's UI-TARS/Agent TARS ecosystem.