Skip to main content
Glama
Claude-to-Gemini MCP Server

Claude-to-Gemini MCP Server

by Yoon-jongho

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, fast

    • pro: 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 analysis

    • duplications: Duplicate code detection

    • security: Security vulnerability scan

    • performance: Performance optimization opportunities

    • general: 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 creation

  • Parameters:

    • prompt: Logo description (English)

    • brandName: Brand/text name to include (optional)

    • style: minimal | modern | vintage | playful | corporate

    • colorScheme: 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, free

  • Parameters:

    • prompt: Illustration description (English)

    • style: watercolor | cartoon | vector | oil_painting | sketch | anime | pixel_art

    • mood: cheerful | dark | calm | dramatic (optional)

    • aspectRatio: 1:1 | 16:9 | 9:16 | 4:3 | 3:4

    • numberOfImages: 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 optimization

  • Parameters:

    • prompt: Infographic topic/content (English)

    • data: Data/information to visualize (optional)

    • type: infographic | diagram | flowchart | timeline | comparison | stats

    • aspectRatio: 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, paid

  • Parameters:

    • prompt: Photo description (English)

    • style: natural | studio | cinematic | aerial | macro

    • numberOfImages: 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 combination

  • Parameters:

    • prompt: Banner description (English)

    • text: Text to include in the banner (optional)

    • platform: facebook | instagram | twitter | youtube | linkedin | web

    • aspectRatio: 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) - Free

  • Parameters:

    • prompt: Editing instructions (English)

    • imagePath: Path to the image file to edit

    • action: 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-gemini

3. Install Dependencies

npm install

4. Register MCP Server

claude mcp add gemini \
  --env GEMINI_API_KEY=YOUR_API_KEY_HERE \
  -- node /ABSOLUTE_PATH/claude-to-gemini/index.js

Note:

  • Replace YOUR_API_KEY_HERE with your actual Gemini API key

  • Replace /ABSOLUTE_PATH/ with the actual project path (e.g., /Users/username/projects/claude-to-gemini/index.js)

5. Verification

claude mcp list

Output example:

gemini - node /Users/username/projects/claude-to-gemini/index.js

๐Ÿš€ Usage

Start Claude Code

claude

Basic 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 (gemini-3-pro-image-preview)

generate_logo, generate_infographic, generate_banner

Logo, infographic, banner

Paid

Professional asset creation, text rendering, thinking mode

Nano Banana 2 (gemini-3.1-flash-image-preview)

generate_illustration, edit_image

Illustration, image editing

Free

Fast generation, conversational editing, various styles

Imagen 4 (imagen-4.0-generate-001)

generate_photo

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.json in .gitignore

  • โœ… Reissue immediately if API key is leaked

Required .gitignore Content

node_modules/
.claude.json
.env
*.key

๐Ÿค How to Contribute

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  3. Commit your Changes (git commit -m 'Add some AmazingFeature')

  4. Push to the Branch (git push origin feature/AmazingFeature)

  5. 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 tools
ask_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

    B3.1/5.0

    Scored across 4 tools

    Disambiguation3/5

    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 Consistency2/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers