Skip to main content
Glama

Gemini MCP Tool

GitHub Fork License: MIT

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: Claude + Google Gemini

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:

  1. Node.js (v20.12.0 or higher)

  2. Google Gemini CLI installed and configured

Installation

Install the published package from npm:

npm install -g @jacobcxdev/gemini-mcp-tool

Register the published package with Claude Code:

claude mcp remove gemini-cli -s user
claude mcp add gemini-cli -s user -- gemini-mcp

Verify Installation

Before configuring MCP, verify the Gemini CLI OAuth path works:

gemini -p ping

Type /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.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • Linux: ~/.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 verify

Then test through Claude Code:

  1. Run /mcp and confirm gemini-cli is connected.

  2. Call mcp__gemini-cli__ping.

  3. Call mcp__gemini-cli__ask-gemini several times with short prompts.

  4. Run /mcp again 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-cli and 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 does

  • use gemini to summarize @. the current directory

  • analyze @package.json and tell me about dependencies

General Questions (without files)

  • ask gemini to search for the latest tech news

  • use gemini to explain div centering

  • ask 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 data

  • ask gemini to safely test @script.py and explain what it does

  • use gemini sandbox to install numpy and create a data visualization

  • test 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 to gemini-2.5-pro.

    • sandbox (optional): Set to true to 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 data or /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 tools
ask-geminiD

model selection [-m], sandbox [-s], and changeMode:boolean for providing edits

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesAnalysis request. Use @ syntax to include files (e.g., '@largefile.js explain what this does') or ask general questions
modelNoOptional model to use (e.g., 'gemini-2.5-flash'). If not specified, uses the default model (gemini-2.5-pro).
sandboxYesUse sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment
changeModeYesEnable structured change mode - formats prompts to prevent tool errors and returns structured edit suggestions that Claude can apply directly
noFallbackYesDisable automatic fallback from gemini-2.5-pro to gemini-2.5-flash when Pro quota is exceeded
chunkIndexNoWhich chunk to return (1-based)
chunkCacheKeyNoOptional cache key for continuation

TDQS

D1.9/5.0
Behavior2/5

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.

Conciseness2/5

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.

Completeness1/5

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.

Parameters2/5

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.

Purpose2/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrimary brainstorming challenge or question to explore
modelNoOptional model to use (e.g., 'gemini-2.5-flash'). If not specified, uses the default model (gemini-2.5-pro).
methodologyYesBrainstorming framework: 'divergent' (generate many ideas), 'convergent' (refine existing), 'scamper' (systematic triggers), 'design-thinking' (human-centered), 'lateral' (unexpected connections), 'auto' (AI selects best)auto
domainNoDomain context for specialized brainstorming (e.g., 'software', 'business', 'creative', 'research', 'product', 'marketing')
constraintsNoKnown limitations, requirements, or boundaries (budget, time, technical, legal, etc.)
existingContextNoBackground information, previous attempts, or current state to build upon
ideaCountYesTarget number of ideas to generate (default: 10-15)
includeAnalysisYesInclude feasibility, impact, and implementation analysis for generated ideas

TDQS

A3.9/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
cacheKeyYesThe cache key provided in the initial changeMode response
chunkIndexYesWhich chunk to retrieve (1-based index)

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.1/5.0
Behavior1/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose2/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesMessage to echo

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
durationYesDuration in milliseconds (minimum 10ms)

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

B3/5.0
Disambiguation5/5

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

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.

Tool Count5/5

Six tools is well-scoped for a Gemini assistant server, covering core interactions, creative generation, chunk retrieval, and utility functions like help and ping.

Completeness4/5

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

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

Latest Blog Posts

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