Claude-to-Gemini MCP Server
This MCP server exposes four tools for Gemini-powered text/codebase analysis and image generation.
ask_gemini: Query Gemini for large-context analysis, architecture design, or whole-codebase review, withflashorpromodels and optional extensive context.gemini_analyze_codebase: Analyze an entire codebase for architecture, duplications, security, performance, or general issues.generate_image_gemini: Generate 1โ4 images using Gemini 2.5 Flash Image (Nano Banana) for contextual image creation/editing/composition.generate_image_imagen: Generate 1โ4 photorealistic, high-resolution images using Imagen 4 (paid).Note: the server schema exposes only these four tools, not the broader image/video/music/audio toolset described in the README.
Enables Claude to delegate tasks to Google Gemini models for large-scale context analysis, codebase reviews, architecture analysis, security vulnerability detection, and performance optimization through two main functions: general AI assistance and specialized codebase analysis
Click on "Deploy 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., "@Claude-to-Gemini MCP Server ask_gemini to analyze this large codebase for security vulnerabilities"
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.
Claude-to-Gemini MCP Server
An Agent-to-Agent integration project using Google Gemini as an MCP (Model Context Protocol) server in Claude Code.
๐ฏ Project Purpose
Claude Code: Main AI (general coding, debugging, file creation/modification)
Gemini: Sub AI (large-scale context analysis, codebase review, 6 types of specialized image generation)
Related MCP server: deep-code-reasoning
โจ Key Features
1. ask_gemini - Text/Code Generation
Purpose: General Gemini calls, large context analysis
Model Selection:
flash(default): Gemini 2.5 Flash - Free, fastpro: Gemini 3.1 Pro - Latest model (released Feb 2026), highest performance
Context: Up to 1M tokens
2. gemini_analyze_codebase - Codebase Analysis
Purpose: Comprehensive analysis of the entire codebase
Analysis Types:
architecture: Architecture pattern analysisduplications: Duplicate code detectionsecurity: Security vulnerability scanperformance: Performance optimization opportunitiesgeneral: Comprehensive analysis
3. generate_logo - Logo/Icon Generation
Purpose: Creating logos, icons, and branding assets
Model: Nano Banana Pro (
gemini-3-pro-image-preview) - Specialized for professional asset creationParameters:
prompt: Logo description (English)brandName: Brand/text name to include (optional)style:minimal|modern|vintage|playful|corporatecolorScheme: Color palette (optional)
Features: Simple and scalable design, 1:1 ratio default
4. generate_illustration - Illustration/Artwork Generation
Purpose: Illustrations, artwork, characters, concept art
Model: Nano Banana 2 (
gemini-3.1-flash-image-preview) - Fast generation, freeParameters:
prompt: Illustration description (English)style:watercolor|cartoon|vector|oil_painting|sketch|anime|pixel_artmood:cheerful|dark|calm|dramatic(optional)aspectRatio:1:1|16:9|9:16|4:3|3:4numberOfImages: Number of images to generate (1-4)
5. generate_infographic - Infographic/Diagram Generation
Purpose: Infographics, diagrams, flowcharts, timelines
Model: Nano Banana Pro (
gemini-3-pro-image-preview) - Thinking mode + text rendering optimizationParameters:
prompt: Infographic topic/content (English)data: Data/information to visualize (optional)type:infographic|diagram|flowchart|timeline|comparison|statsaspectRatio:1:2(default) |1:4|1:1|16:9
Features: Easy-to-read text rendering, supports vertical long layouts
6. generate_photo - Realistic Photo Generation
Purpose: Photorealistic images, product mockups, advertising photos
Model: Imagen 4 (
imagen-4.0-generate-001) - Highest realistic quality, paidParameters:
prompt: Photo description (English)style:natural|studio|cinematic|aerial|macronumberOfImages: Number of images to generate (1-4)aspectRatio:1:1|16:9|9:16|4:3|3:4
Features: Up to 4K resolution, includes automatic SynthID watermark
7. generate_banner - Marketing Banner/SNS Image Generation
Purpose: Marketing banners, SNS images, thumbnails, posters
Model: Nano Banana Pro (
gemini-3-pro-image-preview) - Text + graphic combinationParameters:
prompt: Banner description (English)text: Text to include in the banner (optional)platform:facebook|instagram|twitter|youtube|linkedin|webaspectRatio: Automatic setting per platform
Features: Provides optimized size presets for each platform
8. edit_image - Image Editing/Modification
Purpose: Adding/deleting/modifying elements in existing images
Model: Nano Banana 2 (
gemini-3.1-flash-image-preview) - FreeParameters:
prompt: Editing instructions (English)imagePath: Path to the image file to editaction:modify|add|remove|style_transfer|enhance
Features: Interleaved editing, supports multi-turn conversational modifications
๐ Tech Stack
Runtime: Node.js 18+
MCP SDK: @modelcontextprotocol/sdk
AI API: Google Gemini API (@google/generative-ai)
IDE: Claude Code (CLI + VSCode extension)
๐ฆ Installation
1. Prerequisites
Node.js 18 or higher
Claude Pro/Max plan subscription
Google Gemini API key (ai.google.dev)
2. Clone the Project
git clone https://github.com/YOUR_USERNAME/claude-to-gemini.git
cd claude-to-gemini3. Install Dependencies
npm install4. Register MCP Server
claude mcp add gemini \
--env GEMINI_API_KEY=YOUR_API_KEY_HERE \
-- node /ABSOLUTE_PATH/claude-to-gemini/index.jsNote:
Replace
YOUR_API_KEY_HEREwith your actual Gemini API keyReplace
/ABSOLUTE_PATH/with the actual project path (e.g.,/Users/username/projects/claude-to-gemini/index.js)
5. Verification
claude mcp listOutput example:
gemini - node /Users/username/projects/claude-to-gemini/index.js๐ Usage
Start Claude Code
claudeBasic Usage (Flash model, free)
ask_gemini ๋๊ตฌ๋ฅผ ์ฌ์ฉํด์ "์ด ํ๋ก์ ํธ ์ ์ฒด ๊ตฌ์กฐ๋ฅผ ๋ถ์ํด์ค" ๋ฌผ์ด๋ด์คPro Model Usage (Paid, high performance)
ask_gemini ๋๊ตฌ๋ฅผ ์ฌ์ฉํด์ model์ "pro"๋ก ์ค์ ํ๊ณ "๋ณต์กํ ์ํคํ
์ฒ ์ค๊ณํด์ค" ๋ฌผ์ด๋ด์คCodebase Analysis
gemini_analyze_codebase ๋๊ตฌ๋ก ๋ณด์ ์ทจ์ฝ์ ์ ์ฐพ์์คLogo Generation
generate_logo ๋๊ตฌ๋ก brandName์ "CafeKiosk"๋ก, style์ "modern"์ผ๋ก ์ค์ ํ๊ณ
"A minimalist coffee cup logo with geometric shapes" ๋ก๊ณ ๋ง๋ค์ด์คIllustration Generation (Free)
generate_illustration ๋๊ตฌ๋ก style์ "watercolor"๋ก ์ค์ ํ๊ณ
"A cozy cafe interior with warm lighting" ์ฝํ ์์ฑํด์คInfographic Generation
generate_infographic ๋๊ตฌ๋ก type์ "flowchart"๋ก ์ค์ ํ๊ณ
"User authentication flow: login, verify, 2FA, dashboard" ๋ค์ด์ด๊ทธ๋จ ๋ง๋ค์ด์คRealistic Photo Generation (Paid - Imagen 4)
generate_photo ๋๊ตฌ๋ก style์ "studio"๋ก, numberOfImages๋ฅผ 4๋ก ์ค์ ํ๊ณ
"Professional food photography of a latte with beautiful latte art" ์ด๋ฏธ์ง 4๊ฐ ์์ฑํด์คMarketing Banner Generation
generate_banner ๋๊ตฌ๋ก platform์ "instagram"์ผ๋ก ์ค์ ํ๊ณ
text๋ฅผ "Grand Opening 50% OFF"๋ก
"Bright modern cafe promotion banner with coffee beans" ๋ฐฐ๋ ๋ง๋ค์ด์คImage Editing (Free)
edit_image ๋๊ตฌ๋ก action์ "remove"๋ก, imagePath๋ฅผ "./photo.png"์ผ๋ก ์ค์ ํ๊ณ
"Remove the background person and keep only the coffee cup" ํธ์งํด์ค๐ก Use Cases
Scenario 1: Designing New Project Architecture
ask_gemini ๋๊ตฌ๋ก React + Express + PostgreSQL
์ ์์๊ฑฐ๋ ์ฑ์ ์ ์ฒด ์ํคํ
์ฒ๋ฅผ ์ค๊ณํด์คScenario 2: Legacy Code Analysis
gemini_analyze_codebase ๋๊ตฌ๋ก
focus๋ฅผ 'duplications'๋ก ์ค์ ํด์ ์ค๋ณต ์ฝ๋๋ฅผ ์ฐพ์์คScenario 3: Large-scale Refactoring
ask_gemini ๋๊ตฌ๋ก ์ด ํ๋ก์ ํธ ์ ์ฒด๋ฅผ ์ฝ๊ณ
๋ชจ๋ํ ์ํคํ
์ฒ๋ก ๋ง์ด๊ทธ๋ ์ด์
๊ณํ์ ์ธ์์ค๐ Practical Guide
How to use it in practice?
For more detailed practical usage, refer to the ๐ Practical Usage Guide (USECASES.md)!
Key Contents:
๐ Junior Code Review (Daily morning routine)
๐๏ธ Large-scale Refactoring (1200-line migration)
๐ Project Onboarding (Grasp core concepts within 1 hour)
๐จ Architecture Design (Monorepo structure)
๐ผ๏ธ Specialized Image Generation (Logo, illustration, infographic, photo, banner, editing)
๐ก Tips and Tricks (Cost optimization, model selection)
๐ Model Comparison
Text/Code Generation Models
Model | Context | Cost | Speed | Recommended Use |
Gemini 2.5 Flash | 1M tokens | Free | Fast | General analysis, most tasks |
Gemini 3.1 Pro | 1M tokens | Paid | Fast | Highest performance, complex reasoning |
Image Generation Models
Model | Tool | Purpose | Cost | Features |
Nano Banana Pro ( |
| Logo, infographic, banner | Paid | Professional asset creation, text rendering, thinking mode |
Nano Banana 2 ( |
| Illustration, image editing | Free | Fast generation, conversational editing, various styles |
Imagen 4 ( |
| Realistic photo, product mockup | Paid | Up to 4K, photorealistic, includes SynthID |
โ ๏ธ Security Precautions
API Key Protection
Strictly Prohibited:
โ Uploading API keys to GitHub
โ Hardcoding API keys in code
โ Sharing API keys in public places
Recommendations:
โ Manage only via environment variables
โ Include
.claude.jsonin.gitignoreโ Reissue immediately if API key is leaked
Required .gitignore Content
node_modules/
.claude.json
.env
*.key๐ค How to Contribute
Fork the Project
Create your Feature Branch (
git checkout -b feature/AmazingFeature)Commit your Changes (
git commit -m 'Add some AmazingFeature')Push to the Branch (
git push origin feature/AmazingFeature)Open a Pull Request
๐ License
MIT License - See the LICENSE file for details
๐ References
๐ง Contact
Project-related inquiries: GitHub Issues
Made with โค๏ธ by [Your Name]
Available Tools
4 toolsask_geminiA
Use Gemini for large context analysis (1M tokens), architecture design, or whole codebase review. Best for tasks requiring understanding of entire projects.
Inputs: prompt (required), context, model.
gemini_analyze_codebaseC
Specialized tool for analyzing entire codebases. Gemini will find patterns, duplications, architectural issues, and suggest improvements.
Inputs: codebase (required), focus.
generate_image_geminiB
Generate images using Gemini 2.5 Flash Image (Nano Banana). Best for contextual understanding, image editing, multi-image composition, and iterative refinement. Free tier available.
Inputs: prompt (required), numberOfImages.
generate_image_imagenB
Generate images using Imagen 4. Best for photorealistic quality, high-resolution outputs, and professional branding. Paid service.
Inputs: prompt (required), numberOfImages.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 4 tools
The tools have overlapping purposes that could cause confusion. 'ask_gemini' and 'gemini_analyze_codebase' both target Gemini for analysis tasks, with the latter being a specialized subset of the former. The two image generation tools are clearly distinct in their use cases (Gemini for contextual/iterative work, Imagen for photorealism), but the analysis tools are not well-differentiated.
Naming conventions are inconsistent. 'ask_gemini' uses a verb-object pattern, 'gemini_analyze_codebase' uses a noun-verb-object pattern with underscores, and both image tools use 'generate_image_' prefix but with different suffixes ('gemini' vs 'imagen'). This mixed style lacks a predictable pattern.
Four tools is a reasonable count for a server bridging Claude and Gemini/Imagen services. It covers analysis and image generation without being overly sparse or bloated. However, the scope feels slightly thin given the potential breadth of interactions between these AI systems.
The server covers text analysis and image generation but has notable gaps. There are no tools for conversational interactions, file processing, or multimodal tasks beyond image generation. The domain appears to be 'Claude-to-Gemini integration,' but the surface lacks tools for common workflows like chat, document analysis, or combined text-image tasks.
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Claude Code / MCP skills for the dev pipeline: discover, spec, design, build, ship, operate.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseAqualityDmaintenanceIntegrates Google's Gemini AI models into Claude Code and other MCP clients to provide second opinions, code comparisons, and token counting. It supports streaming responses and multi-turn conversations directly within your existing AI development workflow.3Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables Claude Code to escalate complex code-analysis tasks to Google's Gemini AI, supporting multi-turn conversations, execution-flow tracing, cross-system impact analysis, performance bottleneck detection, and hypothesis testing.-
- FlicenseNot gradedqualityAmaintenanceEnables Claude Code to escalate complex code analysis to Google's Gemini AI for multi-model workflows, including AI-to-AI conversational debugging, execution tracing, cross-system impact analysis, performance bottleneck detection, and hypothesis testing over large codebases and traces.-
- AlicenseNot gradedqualityAmaintenanceEnables Claude Code to escalate complex code analysis to Google's Gemini AI, supporting conversational AI-to-AI debugging, execution tracing, cross-system impact analysis, performance bottleneck detection, and hypothesis testing.MIT