Gemini MCP Tool
Allows AI assistants to interact with the Google Gemini CLI, enabling large-scale analysis of files and codebases using Gemini's massive token window, natural language questions, and sandboxed code execution.
Click on "Install 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., "@Gemini MCP Toolanalyze @README.md and explain its purpose"
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.
Gemini MCP Tool
This fork focuses on Claude Code stability while preserving the original Gemini CLI OAuth behaviour from jamubc/gemini-mcp-tool.
This is a simple Model Context Protocol (MCP) server that allows AI assistants to interact with the Gemini CLI. It enables the AI to leverage the power of Gemini's massive token window for large analysis, especially with large files and codebases using the @ syntax for direction.
Authentication is handled by the installed gemini CLI. This server does not require GEMINI_API_KEY and does not call the Google GenAI SDK directly.
Ask gemini natural questions, through claude or Brainstorm new ideas in a party of 3!
TLDR:
+ 
Goal: Use Gemini's powerful analysis capabilities directly in Claude Code to save tokens and analyze large files.
Related MCP server: Gemini Code Assist MCP
Prerequisites
Before using this tool, ensure you have:
Node.js (v20.12.0 or higher)
Google Gemini CLI installed and configured
Installation
Install the published package from npm:
npm install -g @jacobcxdev/gemini-mcp-toolRegister the published package with Claude Code:
claude mcp remove gemini-cli -s user
claude mcp add gemini-cli -s user -- gemini-mcpVerify Installation
Before configuring MCP, verify the Gemini CLI OAuth path works:
gemini -p pingType /mcp inside Claude Code to verify the gemini-cli MCP is active.
Configuration
Register the MCP server with your MCP client:
{
"mcpServers": {
"gemini-cli": {
"command": "gemini-mcp"
}
}
}If your client does not resolve globally installed npm binaries, use npx instead:
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"@jacobcxdev/gemini-mcp-tool"
]
}
}
}Configuration File Locations:
Claude Desktop:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/claude/claude_desktop_config.json
After updating the configuration, restart your terminal session.
Stability smoke test
Run this before registering the MCP server:
npm run verifyThen test through Claude Code:
Run
/mcpand confirmgemini-cliis connected.Call
mcp__gemini-cli__ping.Call
mcp__gemini-cli__ask-geminiseveral times with short prompts.Run
/mcpagain and confirm the server stayed connected.
Example Workflow
Natural language: "use gemini to explain index.html", "understand the massive project using gemini", "ask gemini to search for latest news"
Claude Code: Type
/gemini-cliand commands will populate in Claude Code's interface.
Usage Examples
With File References (using @ syntax)
ask gemini to analyze @src/main.js and explain what it doesuse gemini to summarize @. the current directoryanalyze @package.json and tell me about dependencies
General Questions (without files)
ask gemini to search for the latest tech newsuse gemini to explain div centeringask gemini about best practices for React development related to @file_im_confused_about
Using Gemini CLI's Sandbox Mode (-s)
The sandbox mode allows you to safely test code changes, run scripts, or execute potentially risky operations in an isolated environment.
use gemini sandbox to create and run a Python script that processes dataask gemini to safely test @script.py and explain what it doesuse gemini sandbox to install numpy and create a data visualizationtest this code safely: Create a script that makes HTTP requests to an API
Tools (for the AI)
These tools are designed to be used by the AI assistant.
ask-gemini: Asks Google Gemini for its perspective. Can be used for general questions or complex analysis of files.prompt(required): The analysis request. Use the@syntax to include file or directory references (e.g.,@src/main.js explain this code) or ask general questions (e.g.,Please use a web search to find the latest news stories).model(optional): The Gemini model to use. Defaults togemini-2.5-pro.sandbox(optional): Set totrueto run in sandbox mode for safe code execution.
sandbox-test: Safely executes code or commands in Gemini's sandbox environment. Always runs in sandbox mode.prompt(required): Code testing request (e.g.,Create and run a Python script that...or@script.py Run this safely).model(optional): The Gemini model to use.
Ping: A simple test tool that echoes back a message.Help: Shows the Gemini CLI help text.
Slash Commands (for the User)
You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested).
/analyze: Analyzes files or directories using Gemini, or asks general questions.
prompt(required): The analysis prompt. Use@syntax to include files (e.g.,/analyze prompt:@src/ summarize this directory) or ask general questions (e.g.,/analyze prompt:Please use a web search to find the latest news stories).
/sandbox: Safely tests code or scripts in Gemini's sandbox environment.
prompt(required): Code testing request (e.g.,/sandbox prompt:Create and run a Python script that processes CSV dataor/sandbox prompt:@script.py Test this script safely).
/help: Displays the Gemini CLI help information.
/ping: Tests the connection to the server.
message(optional): A message to echo back.
Contributing
Contributions are welcome! Please see our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Disclaimer: This is an unofficial, third-party tool and is not affiliated with, endorsed, or sponsored by Google.
Available Tools
6 toolsask-geminiD
model selection [-m], sandbox [-s], and changeMode:boolean for providing edits
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Analysis request. Use @ syntax to include files (e.g., '@largefile.js explain what this does') or ask general questions | |
| model | No | Optional model to use (e.g., 'gemini-2.5-flash'). If not specified, uses the default model (gemini-2.5-pro). | |
| sandbox | Yes | Use sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment | |
| changeMode | Yes | Enable structured change mode - formats prompts to prevent tool errors and returns structured edit suggestions that Claude can apply directly | |
| noFallback | Yes | Disable automatic fallback from gemini-2.5-pro to gemini-2.5-flash when Pro quota is exceeded | |
| chunkIndex | No | Which chunk to return (1-based) | |
| chunkCacheKey | No | Optional cache key for continuation |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description bears full burden but only mentions model selection and sandbox. It does not disclose that it calls Gemini, potential rate limits, quota fallback, or what the tool returns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Overly terse single sentence that sacrifices clarity for brevity. Does not front-load a clear purpose statement.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 7 parameters, 4 required, and no output schema, the description fails to explain the tool's core function, return values, or error behavior, leaving agents unable to use it confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds minimal value beyond repeating parameter names in shorthand. It does not clarify usage context like how changeMode works.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'model selection [-m], sandbox [-s], and changeMode:boolean for providing edits' is vague and does not clearly state that the tool sends prompts to Gemini for responses. It reads like a list of flags rather than a verb+resource description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus siblings like brainstorm or fetch-chunk. The description lacks context about prerequisites or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brainstormA
Generate novel ideas with dynamic context gathering. --> Creative frameworks (SCAMPER, Design Thinking, etc.), domain context integration, idea clustering, feasibility analysis, and iterative refinement.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Primary brainstorming challenge or question to explore | |
| model | No | Optional model to use (e.g., 'gemini-2.5-flash'). If not specified, uses the default model (gemini-2.5-pro). | |
| methodology | Yes | Brainstorming framework: 'divergent' (generate many ideas), 'convergent' (refine existing), 'scamper' (systematic triggers), 'design-thinking' (human-centered), 'lateral' (unexpected connections), 'auto' (AI selects best) | auto |
| domain | No | Domain context for specialized brainstorming (e.g., 'software', 'business', 'creative', 'research', 'product', 'marketing') | |
| constraints | No | Known limitations, requirements, or boundaries (budget, time, technical, legal, etc.) | |
| existingContext | No | Background information, previous attempts, or current state to build upon | |
| ideaCount | Yes | Target number of ideas to generate (default: 10-15) | |
| includeAnalysis | Yes | Include feasibility, impact, and implementation analysis for generated ideas |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. It mentions dynamic context gathering, creative frameworks, domain integration, idea clustering, feasibility analysis, and iterative refinement, which gives a good sense of the tool's behavior and capabilities. However, it does not disclose potential side effects, permissions, or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one sentence long with a bullet-like list using arrows, efficiently conveying purpose and features. It is front-loaded with the main action ('Generate novel ideas'). Every word adds value, though the structure could be slightly more formal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 8 parameters and no output schema, the description covers key aspects: frameworks, domain context, constraints, idea count, and analysis. It lacks explanation of return format, but the tool's output (ideas with analysis) is implied. Reasonably complete for a brainstorming tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for parameters, so the schema already explains each parameter. The description adds minimal extra meaning beyond the schema, such as hinting at 'feasibility analysis' which aligns with includeAnalysis. Thus, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Generate novel ideas with dynamic context gathering.' It lists specific frameworks and activities like SCAMPER, domain integration, clustering, and analysis, making the scope unambiguous. The sibling tools (ask-gemini, fetch-chunk) are for different tasks, so distinction is clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for brainstorming but provides no guidance on when to use this tool versus alternatives, nor does it specify conditions where it should not be used. It lacks explicit 'when-to-use' or 'when-not-to-use' statements.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fetch-chunkA
Retrieves cached chunks from a changeMode response. Use this to get subsequent chunks after receiving a partial changeMode response.
| Name | Required | Description | Default |
|---|---|---|---|
| cacheKey | Yes | The cache key provided in the initial changeMode response | |
| chunkIndex | Yes | Which chunk to retrieve (1-based index) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It indicates a non-destructive read operation but does not disclose caching behavior, error responses, or what happens with invalid parameters. Adequate but could be more detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise, front-loaded sentences with no wasted words. All information is relevant and efficiently presented.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 params, no output schema, no annotations), the description is functionally complete but lacks details on error conditions and return format. Adequate for basic use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with both parameters well-described. The description adds no additional meaning beyond the schema, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Retrieves' and resource 'cached chunks from a changeMode response'. It distinguishes this tool from siblings like 'ask-gemini' or 'ping' by specifying its unique role in handling partial responses.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use this to get subsequent chunks after receiving a partial changeMode response', providing clear when-to-use guidance. It does not explicitly state when not to use or mention alternatives, but the context is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
HelpC
receive help information
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description should disclose behavior but only states the generic purpose; no details on side effects, permissions, or output are given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short but lacks substance; it is not informative enough despite being concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema or annotations, the description should provide more context (e.g., what help topics are covered), but it does not.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100%, meeting the baseline. The description adds minimal value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'receive help information' is vague and does not specify what kind of help or how it differs from sibling tools like ask-gemini.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives; no context or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pingC
Echo
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Message to echo |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must fully convey behavior. 'Echo' suggests no side effects but doesn't confirm read-only nature, state changes, or rate limits. Insufficient disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise and front-loaded, but the single word could be expanded to a full sentence for clarity without sacrificing brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description does not explain return format, error handling, or connectivity context. Incomplete for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes the 'prompt' parameter with 100% coverage. The description 'Echo' adds no additional meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Echo' clearly implies the tool returns the input, matching the name 'ping'. It's specific enough to convey a simple echo function, though it doesn't distinguish from siblings like 'timeout-test' or 'Help'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. Lacks context for appropriate usage or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
timeout-testB
Test timeout prevention by running for a specified duration
| Name | Required | Description | Default |
|---|---|---|---|
| duration | Yes | Duration in milliseconds (minimum 10ms) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. It only states that the tool runs for a duration, but does not disclose whether it blocks, returns a result, or has side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence that is front-loaded and contains no fluff. Every word is necessary.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity (1 param, no output schema, no annotations), the description is minimally complete. However, it lacks details on return behavior or interpretation of results, which would be helpful for a test tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear description for 'duration' (milliseconds, minimum 10ms). The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: testing timeout prevention by running for a specified duration. It distinguishes from sibling tools like 'ask-gemini' and 'ping' as a dedicated test tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description does not specify preconditions or exclusions, leaving the agent to infer usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
All six tools have clearly distinct purposes: ask-gemini for general interaction/edits, brainstorm for creative ideation, fetch-chunk for retrieving changeMode chunks, Help for information, ping for echo, and timeout-test for testing timeouts. No overlap.
Naming is inconsistent: mix of hyphenated ('ask-gemini', 'fetch-chunk', 'timeout-test'), single words ('brainstorm', 'ping'), and capitalized ('Help'). No uniform pattern (verb-noun vs noun) or case convention.
Six tools is well-scoped for a Gemini assistant server, covering core interactions, creative generation, chunk retrieval, and utility functions like help and ping.
Covers main interaction and creativity needs, but lacks explicit conversation management or model listing tools. Minor gap in changeMode workflow documentation (fetch-chunk assumes prior partial response).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Google Veo AI video generation
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that integrates with Discord to provide AI-powered features.
Related MCP Servers
- AlicenseAqualityFmaintenanceA lightweight MCP server that enables AI coding assistants to interact with Google's Gemini AI through the official CLI.3MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that integrates Google Gemini CLI with Claude Code for AI-powered development assistance, enabling code review, bug analysis, feature planning, and code explanation without requiring an API key.8MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Google Gemini that does not require an API key, combining a CLI backend for Q\&A, research, and analysis with a web UI backend for image and video generation.112MIT
- AlicenseNot gradedqualityDmaintenanceA MCP server wrapper for Google's Gemini CLI that enables AI assistants to perform searches, have conversations, list sessions, and analyze files using Gemini's capabilities.13MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jacobcxdev/gemini-mcp-tool'
If you have feedback or need assistance with the MCP directory API, please join our Discord server