gemini-mcp
CLAUDE.md219 starsChanged 10 months agoMITView on GitHub
This document provides essential information for Claude when working with this Gemini MCP server project. This project is an MCP (Model Context Protocol) server that connects Claude to Google's Gemini 3 AI models. It enables bidirectional collaboration between Claude and Gemini, allowing them to work together by sharing capabilities and agent tools. Version: 0.8.1 Package: @rlabs-inc/gemini-mcp MCP Registry: io.github.rlabs-inc/gemini-mcp
- Reads credentials
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 216
File Search: Search through uploaded file stores
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Gemini MCP Server Project Guide
This document provides essential information for Claude when working with this Gemini MCP server project.
Project Overview
This project is an MCP (Model Context Protocol) server that connects Claude to Google's Gemini 3 AI models. It enables bidirectional collaboration between Claude and Gemini, allowing them to work together by sharing capabilities and agent tools.
Version: 0.8.1 Package: @rlabs-inc/gemini-mcp MCP Registry: io.github.rlabs-inc/gemini-mcp
Key Components
src/index.ts: Dual-mode entry point (MCP server or CLI)src/server.ts: MCP server implementationsrc/cli/: CLI implementation with themes and commandssrc/gemini-client.ts: Client for Google's Generative AI API (includes thinking levels, image/video generation)src/utils/logger.ts: Logging utilities with configurable verbositysrc/tools/*.ts: Various tool implementations for integration with Claude Code
Tools Implemented
- Query (
query.ts): Direct queries to Gemini with thinking level controlthinkingLevel: minimal, low, medium, high
- Brainstorm (
brainstorm.ts): Collaborative brainstorming between Claude and Gemini - Analyze (
analyze.ts): Code and text analysis using Gemini - Summarize (
summarize.ts): Content summarization at different detail levels - Image Gen (
image-gen.ts):gemini-generate-image: Generate images with Nano Banana Pro- Up to 4K resolution (1K, 2K, 4K)
- 10 aspect ratios (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9)
- Google Search grounding for real-world accuracy
- Returns base64 that Claude can SEE!
gemini-image-prompt: Generate prompts for other image tools (legacy)
- Image Edit (
image-edit.ts): Multi-turn conversational image editinggemini-start-image-edit: Start an editing sessiongemini-continue-image-edit: Continue refining with follow-up promptsgemini-end-image-edit: Close a sessiongemini-list-image-sessions: List active sessions
- Video Gen (
video-gen.ts):gemini-generate-video: Start async video generation with Veogemini-check-video: Check video generation status and download
- Code Execution (
code-exec.ts):gemini-run-code: Write and execute Python code- Supports: numpy, pandas, matplotlib, scipy, scikit-learn, tensorflow
- Returns charts as images Claude can see
- Google Search (
search.ts):gemini-search: Real-time web search with inline citations- Returns grounded responses with source URLs
- Structured Output (
structured.ts):gemini-structured: JSON responses with schema validationgemini-extract: Convenience tool for entities, facts, sentiment, keywords
- YouTube Analysis (
youtube.ts):gemini-youtube: Analyze YouTube videos by URL with clippinggemini-youtube-summary: Quick video summarization
- Document Analysis (
document.ts):gemini-analyze-document: Analyze PDFs, DOCX, spreadsheetsgemini-summarize-pdf: Quick PDF summarizationgemini-extract-tables: Extract tables from documents
- URL Context (
url-context.ts):gemini-analyze-url: Analyze content from URLsgemini-compare-urls: Compare content between two URLsgemini-extract-from-url: Extract specific data types from URLs
- Context Caching (
cache.ts):gemini-create-cache: Cache large documents for repeated queriesgemini-query-cache: Query cached contentgemini-list-caches: List active cachesgemini-delete-cache: Delete a cache
- Speech/TTS (
speech.ts):gemini-speak: Text-to-speech with 30 voicesgemini-dialogue: Multi-speaker dialogue generationgemini-list-voices: List available voices
- Token Counting (
token-count.ts):gemini-count-tokens: Count tokens and estimate costs
- Deep Research (
deep-research.ts):gemini-deep-research: Start autonomous multi-step research (async)gemini-check-research: Check research status and get resultsgemini-research-followup: Ask follow-up questions on completed research- Note: Research typically takes 5-20 minutes, max 60 minutes
- Full response saved to
GEMINI_OUTPUT_DIRas JSON
- Image Analysis (
image-analyze.ts): Community contribution by @acreegergemini-analyze-image: Analyze images with object detection and bounding boxes- Supports JPEG, PNG, WebP, HEIC, HEIF, GIF
- Returns
box_2d(normalized 0-1000) andbbox_pixels(pixel coordinates) - Structured JSON output with object labels and confidence
- Thinking level support for complex analysis
- Handles large files (>20MB) via Files API automatically
Environment Variables
| Variable | Required | Default | Description |
GEMINI_API_KEY | Yes | - | Google Gemini API key |
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_VIDEO_MODEL | No | veo-2.0-generate-001 | Video model |
GEMINI_OUTPUT_DIR | No | ./gemini-output | Output directory for generated files |
VERBOSE | No | false | Enable verbose logging |
QUIET | No | false | Minimize logging |
GEMINI_ENABLED_TOOLS | No | - | Comma-separated list of tool groups to load |
GEMINI_TOOL_PRESET | No | - | Preset profile: minimal, text, image, research, media, full |
HTTP_PROXY | No | - | HTTP proxy URL (e.g. http://127.0.0.1:7890) for routing traffic through a proxy |
HTTPS_PROXY | No | - | HTTPS proxy URL; used as fallback when HTTP_PROXY is not set |
Command Line Options
-v, --verbose: Enable verbose logging-q, --quiet: Run in quiet mode-h, --help: Show help message
Installation
# Basic install
claude mcp add gemini -s user -- env GEMINI_API_KEY=YOUR_KEY npx -y @rlabs-inc/gemini-mcp
# With HTTP proxy (for developers behind firewalls)
claude mcp add gemini -s user -- \
env GEMINI_API_KEY=YOUR_KEY \
HTTP_PROXY=http://127.0.0.1:7890 \
npx -y @rlabs-inc/gemini-mcpDevelopment Commands
bun install # Install dependencies
bun run build # Build the project
bun run dev # Run in development mode (with watch)
bun run dev -- -v # Run with verbose logging
bun run typecheck # Type check without emitting
bun run format # Format code with Prettier
bun run lint # Lint code with ESLintDependencies
@google/genai: ^1.34.0 - Google Generative AI SDK@modelcontextprotocol/sdk: 1.22.0 - MCP SDK (pinned; 1.23.0+ causes TypeScript OOM)undici: ^7.0.0 - HTTP client used to inject global proxy support for Node.js fetch()zod: 3.24.3 - Schema validation (pinned for compatibility with MCP SDK)zod-to-json-schema: 3.24.5 - Zod to JSON Schema conversion (pinned; 3.25+ requires zod/v3 export)
Architecture Notes
- The server uses stdio transport for communication with Claude Code
- Image generation returns base64 data that Claude can render inline
- Video generation is async - returns operation ID for polling
- Generated files are saved to
GEMINI_OUTPUT_DIR - Thinking levels control reasoning depth in Gemini 3
- Image editing uses chat sessions with automatic thought signature handling
- HTTP Proxy:
src/index.tsinjects a globalundiciProxyAgent before any network calls whenHTTP_PROXY/HTTPS_PROXYis set. This is needed because Node.js's built-infetch()does not natively respect these env vars (unlike Bun, which does).
Gemini 3 Specific Features
Thinking Levels
minimal: Fastest, minimal reasoning (Flash only)low: Fast responses, basic reasoningmedium: Balanced reasoning (Flash only)high: Deep reasoning for complex tasks (default)
Nano Banana Pro (Image Generation)
- Model:
gemini-3-pro-image-preview - Resolutions: 1K, 2K (default), 4K
- Google Search grounding for real-world accuracy
- High-fidelity text rendering
Thought Signatures
- Handled automatically by the SDK when using chat sessions
- Required for multi-turn image editing
- Preserved in conversation history for function calling
Key Changes in v0.8.0
- Image Analysis Tool: New
gemini-analyze-imagewith object detection and bounding boxes (community contribution by @acreeger) - Thinking Level Support: Added thinkingLevel parameter to image analysis for complex visual reasoning
- Dual Coordinate Output: Returns both normalized (box_2d) and pixel (bbox_pixels) coordinates
Key Changes (unreleased)
- HTTP Proxy Support:
src/index.tsnow natively readsHTTP_PROXY/HTTPS_PROXYenv vars and injects a globalundiciProxyAgent before any network request. No external wrapper script needed. - New dependency:
undiciadded for proxy agent injection.
Previous Versions
- v0.7.x: Published to MCP Registry, CLI renamed to gcli
- v0.6.3: Deep Research Agent, Token Counting
- v0.6.0: TTS with 30 voices, context caching, URL analysis
- v0.5.0: Code execution, Google Search, YouTube analysis, document analysis
- v0.3.0: Gemini 3 models, thinking levels, 4K image gen, multi-turn editing
Future Roadmap
See docs/ROADMAP.md for implementation plan. Remaining features:
- Lyria Music Generation: Real-time music via WebSocket (complex)
- Live Streaming API: Real-time bidirectional streaming
- File Search: Search through uploaded file stores
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

