Content

<div align="center">
**Seamless Collaboration Between Claude Code and Gemini CLI**
[](https://opensource.org/licenses/MIT) [](https://www.python.org/downloads/) [](https://modelcontextprotocol.io) [](https://x.com/intent/tweet?text=GeminiMCP:%20Claude%20Code%20and%20Gemini%20Seamless%20Collaboration%20https://github.com/GuDaStudio/geminimcp%20%23AI%20%23Coding%20%23MCP) [](https://www.facebook.com/sharer/sharer.php?u=https://github.com/GuDaStudio/geminimcp) [](https://www.reddit.com/submit?title=GeminiMCP:%20Claude%20Code%20and%20Gemini%20Seamless%20Collaboration&url=https://github.com/GuDaStudio/geminimcp) [](https://t.me/share/url?url=https://github.com/GuDaStudio/geminimcp&text=GeminiMCP:%20Claude%20Code%20and%20Gemini%20Seamless%20Collaboration)
⭐ Give us a star on GitHub~ Your support means a lot to us! 🙏😊
[English](./docs/README_EN.md) | 简体中文
</div>
---
## 0. Example of results
**1.** This evaluation uses the **exact same** prompt. The effects of using / not using this project are shown below. As you can see, the front-end webpage using Gemini-MCP is significantly better than the version using only claude code for front-end coding, both in terms of aesthetic layout and animation effects.
<details>
<summary>Click to view prompt details.</summary>
```
Design an extremely beautiful weather card for ultra-high-definition large-screen poster display.
Overall atmosphere: Deep winter snow scene, Chinese ink painting artistic conception, the picture should have the poetic meaning of "stillness" and "distance", as if you can hear the sound of snow falling at a glance.
Background: The distant view is a continuous mountain range, using the brushstrokes of Chinese ink landscape painting, layered, virtual and real, with a sense of atmospheric perspective; there is a thin mist and clouds lingering in the mountains, and several pine trees or a small pavilion can be vaguely seen, adding oriental charm and a sense of story.
Color: Mainly cold cyan, ink gray, and pale, with a little warm light or vermilion seal dotted locally, so that the picture has a little human touch in the cold.
Weather card body:
As the main body of the picture, the layout is slightly to the middle right or slightly to the left, the size is suitable for large-screen reading, leaving enough breathing space and blank space.
Not a frosted glass style, avoid glass state, frosted glass, and strong blur effects.
Use a more advanced card texture: similar to rice paper, fine frosted metal or warm jade, with soft highlights and subtle shadows on one side, and the edges are slightly decorated with traditional Chinese window grilles, moiré patterns or fine line outlines, the overall is minimalist and clean.
Information typesetting is restrained and rhythmic: the city name and current temperature can use Chinese fonts with the temperament of running script/regular script or elegant English fonts that match it, and small fonts are used for date, weather description and air quality, etc., and the Chinese and English mixed arrangement is natural and coordinated.
Snowflake effect (WebGL):
Snowflakes are not simple particle points, but exquisite snowflakes created with WebGL: with a hexagonal symmetrical crystal structure, delicate edges, and shimmering reflections.
Snowflakes are divided into foreground, middle ground, and distant multiple layers of depth, and the size, transparency, and sharpness change with distance to create a strong sense of space.
The falling trajectory has a slight rotation and swing, with slow acceleration and slight random wind direction changes, and the overall movement is elegant and restrained, without being obtrusive.
Some snowflakes skim the edge of the weather card, forming a slight occlusion relationship, strengthening the immersion of "the card in the snow".
Style requirements:
Overall Chinese style modern integration: ink landscape + minimalist UI design.
The picture has high resolution and is suitable for 16:9 large-screen posters.
The composition emphasizes white space and balance, and is full of oriental charm and the tranquility of the passage of time.
Reflect the "highest level" of fineness, texture and atmosphere, rather than ordinary interface screenshots.
```
</details>
**2.** In Claude Code, **using Gemini-MCP**, you can preview it online via [this link](https://codepen.io/Studio-Guda/full/yyOpBVZ)!
https://github.com/user-attachments/assets/1996980b-da6a-43cf-8c02-6c008f54ed18
**3.** Using only Claude Code, you can preview it online via [this link](https://codepen.io/Studio-Guda/full/ogxpvGY)!
https://github.com/user-attachments/assets/18d59123-e972-410e-824a-7462d3d95dd5
---
## 1. Project Introduction
**Gemini-MCP** is an MCP server that encapsulates Google's Gemini CLI tool into a standard MCP protocol interface, allowing Claude Code to call Gemini to perform AI-assisted programming tasks.
🍟 This project provides [prompts](#2-configure-claude-code-prompts-optional) around **Gemini's powerful front-end design** capabilities to enrich your usage scenarios. We highly recommend that you configure it!
---
## 2. Quick Start
### 0. Prerequisites
- Installed and configured [Claude Code](https://docs.claude.com/docs/claude-code)
- Installed and configured [Gemini CLI](https://github.com/google-gemini/gemini-cli)
- Installed [uv tool](https://docs.astral.sh/uv/getting-started/installation/)
**uv Installation method:**
Windows (PowerShell):
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
Linux/macOS:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
> **Note: It is highly recommended that Windows users run this project in WSL!**
### 1. Installation Steps
**1.1** Install GeminiMCP
```bash
claude mcp add gemini -s user --transport stdio -- uvx --from git+https://github.com/GuDaStudio/geminimcp.git geminimcp
```
**1.2** Verify Installation
```bash
claude mcp list
```
> Seeing `gemini: ... - ✓ Connected` indicates successful installation
**1.3** Optional: Configure Auto-Allow
Add `mcp__gemini__gemini` to the allow item in `~/.claude/settings.json`

### 2. Configure Claude Code Prompts (Optional)
In order to enable claude code to better collaborate with gemini, we **strongly recommend that you add the following content to `~/.claude/CLAUDE.md`**
<details>
<summary>Expand to view prompt</summary>
```
## Core Instruction for Gemini MCP
At any moment, you must consider how the current process can collaborate with gemini, and how to call the MCP tool provided by gemini as a guarantee for your **objective and comprehensive analysis**.
Among them, you **must perform** the following steps:
**1** After you **form a preliminary analysis** of user needs,
(1) First, inform gemini of the user's **original needs (word for word, strictly prohibited from paraphrasing)** and your initial ideas;
(2) Conduct **full discussion and debate** with gemini to improve the needs analysis and implementation plan. The end of this step is marked by the **must** ensure a thorough understanding of user needs and **generate a practical action plan**.
**2** Before implementing specific coding tasks, you **must ask gemini for a code implementation prototype** (require gemini to only give a unified diff patch, strictly prohibit making any real modifications to the code). After obtaining the code prototype, you **can only use this as a logical reference and rewrite the code modification again** to form enterprise production-level, highly readable, and highly maintainable code before implementing specific programming modification tasks.
- **Note:** Gemini is very good at front-end code and is proficient in style and UI component design. When front-end code is involved, you must ask it for a code prototype (CSS/React/Vue/HTML and other front-end code). At any moment, you **must use gemini's front-end design (prototype code) as the final front-end code base**.
- For example, when you recognize that the user has given a front-end design requirement, your primary behavior must automatically adjust to forwarding the user's requirement to gemini as is and asking it to provide a code example (at this stage, it is strictly prohibited to make any changes, abbreviations, etc. to the user's requirement). That is, you must obtain the code base from gemini before you can perform the following various behaviors.
## Gemini Tool Invocation Specification
1. Tool Overview
The gemini MCP provides a tool `gemini` for calling the Google Gemini model to perform AI tasks. This tool has extremely strong front-end aesthetics, task planning, and demand understanding capabilities, but has limitations in **context length (Effective 32k)**.
2. Usage and Specifications
**Restrictions that must be followed**:
- **Session Management**: Capture the returned `SESSION_ID` for multi-turn conversations.
- **Backend Avoidance**: Strictly prohibit Gemini from writing complex backend business logic code.
**Good at Scenarios (Gemini must be called first)**:
- **Demand Clarification**: Assist in generating guiding questions at the beginning of the task.
- **Task Planning**: Generate a Step-by-step implementation plan.
- **Front-end Prototype**: Write CSS, HTML, UI component code, and adjust style.
```
</details>
---
## 3. Tool Description
<details>
<summary>Expand to view gemini tool details</summary>
### gemini Tool
| Parameter | Type | Required | Default Value | Description |
|------|------|------|--------|------|
| `PROMPT` | `str` | ✅ | - | Task instruction sent to Gemini |
| `sandbox` | `bool` | ❌ | `False` | Whether to enable sandbox mode |
| `SESSION_ID` | `str` | ❌ | `""` | Session ID (empty to start a new session) |
| `return_all_messages` | `bool` | ❌ | `False` | Whether to return the complete message history |
| `model` | `str` | ❌ | `""` | Specify the model (default uses Gemini CLI configuration) |
### Return Value Structure
**On success:**
```json
{
"success": true,
"SESSION_ID": "session-uuid",
"agent_messages": "Gemini's reply content..."
}
```
**When return_all_messages is enabled, it additionally includes:**
```json
{
"all_messages": [...]
}
```
**On failure:**
```json
{
"success": false,
"error": "Error message description"
}
```
</details>
---
## 4. FAQ
<details>
<summary>Q1: What is the difference between using it directly with Gemini CLI?</summary>
GeminiMCP encapsulates Gemini CLI as an MCP protocol, allowing Claude Code to call it programmatically, supporting session management and structured returns.
</details>
<details>
<summary>Q2: Will sessions conflict?</summary>
No. Each session uses an independent `SESSION_ID`, which is completely isolated.
</details>
---
## 🤝 Contribution Guide
```bash
# Clone the repository
git clone https://github.com/GuDaStudio/geminimcp.git
cd geminimcp
# Install dependencies
uv sync
```
---
## 📄 License
This project uses the [MIT License](LICENSE) open source protocol.
Copyright (c) 2025 [guda.studio](mailto:gudaclaude@gmail.com)
---
<div align="center">
## Give this project a boost with a 🌟~
</div>
[](https://www.star-history.com/#GuDaStudio/geminimcp&type=date&legend=top-left)
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.