Skip to main content
Glama
aliargun

Gemini MCP Server

by aliargun

Servidor MCP Gemini

Implementación del servidor de Protocolo de contexto de modelo (MCP) que permite a Claude Desktop interactuar con los modelos de inteligencia artificial Gemini de Google.

Características

  • Compatibilidad total con el protocolo MCP

  • Transmisión de respuesta en tiempo real

  • Manejo seguro de claves API

  • Parámetros del modelo configurables

  • Implementación de TypeScript

Related MCP server: Gemini MCP Server

Inicio rápido

  1. Obtener la clave API de Gemini

  2. Configurar Claude Desktop

    • Localice su archivo de configuración:

      Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
      Windows: %APPDATA%\Claude\claude_desktop_config.json
      Linux: ~/.config/Claude/claude_desktop_config.json
    • Agregar configuración de Gemini:

      {
        "mcpServers": {
          "gemini": {
            "command": "npx",
            "args": ["-y", "github:aliargun/mcp-server-gemini"],
            "env": {
              "GEMINI_API_KEY": "your_api_key_here"
            }
          }
        }
      }
  3. Reiniciar Claude Desktop

Documentación

Desarrollo local

# Clone repository
git clone https://github.com/aliargun/mcp-server-gemini.git
cd mcp-server-gemini

# Install dependencies
npm install

# Start development server
npm run dev

Contribuyendo

¡Agradecemos sus contribuciones! Consulte nuestra Guía de Contribución .

Problemas comunes

  1. Problemas de conexión

  2. Problemas con la clave API

Seguridad

  • Las claves API se manejan únicamente a través de variables de entorno

  • No se registran ni almacenan datos confidenciales

  • Actualizaciones de seguridad periódicas

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Available Tools

6 tools
analyze_imageC

Analyze images using Gemini vision capabilities

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesQuestion or instruction about the image
imageUrlNoURL of the image to analyze
imageBase64NoBase64-encoded image data (alternative to URL)
modelNoVision-capable Gemini modelgemini-2.5-flash

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Gemini vision capabilities' but doesn't detail what this entails—such as rate limits, authentication needs, output format, or potential costs. For a tool with no annotations, this leaves significant gaps in understanding how it behaves beyond basic functionality.

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?

The description is extremely concise and front-loaded with a single, clear sentence: 'Analyze images using Gemini vision capabilities.' There is no wasted verbiage, and it efficiently communicates the core purpose without unnecessary details.

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 the complexity of a vision analysis tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits, output format, error handling, or integration context. While the schema covers inputs well, the overall context for an AI agent to use this tool effectively is insufficient.

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 description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond what's in the schema, such as explaining the interplay between prompt and image inputs or model selection nuances. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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: 'Analyze images using Gemini vision capabilities.' It specifies the action (analyze) and resource (images) with the technology context (Gemini vision). However, it doesn't explicitly differentiate from sibling tools like generate_text or embed_text, which might also process text or have different vision-related functions.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like generate_text (which might handle text generation) or list_models (which could list available models), nor does it specify contexts or exclusions for image analysis. Usage is implied but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

count_tokensC

Count tokens for a given text with a specific model

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesText to count tokens for
modelNoModel to use for token countinggemini-2.5-flash

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool counts tokens but doesn't describe what a 'token' means in this context, whether there are rate limits, error handling, or output format. For a tool with no annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy for an agent to parse quickly.

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 the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on behavioral traits, usage context, and output expectations. While the schema covers parameters well, the description doesn't compensate for missing annotations or output schema, leaving gaps in overall understanding.

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 description coverage is 100%, so the schema fully documents both parameters ('text' and 'model'). The description adds no additional meaning beyond what's in the schema, such as explaining tokenization nuances or model-specific behaviors. Baseline 3 is appropriate when the schema handles all parameter documentation.

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: 'Count tokens for a given text with a specific model'. It specifies the verb ('count'), resource ('tokens'), and scope ('text' and 'model'). However, it doesn't explicitly differentiate from sibling tools like 'embed_text' or 'generate_text', which might also involve token processing, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where token counting is needed over other operations like text generation or embedding, nor does it reference sibling tools. This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

embed_textC

Generate embeddings for text using Gemini embedding models

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesText to generate embeddings for
modelNoEmbedding model to usetext-embedding-004

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the basic function but lacks details on rate limits, authentication needs, output format (e.g., vector dimensions), error handling, or performance characteristics. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to grasp quickly. Every part of the sentence earns its place by specifying the action, resource, and technology.

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 the complexity (embedding generation with model selection), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what embeddings are, their format, or practical applications, leaving the agent with insufficient context to use the tool effectively beyond basic invocation.

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 description coverage is 100%, so the schema already documents both parameters ('text' and 'model') with descriptions and enum values. The description adds no additional meaning beyond what the schema provides, such as explaining embedding use cases or model differences. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Generate embeddings') and resource ('for text using Gemini embedding models'), making the purpose immediately understandable. It distinguishes from siblings like 'analyze_image' or 'generate_text' by focusing on embeddings. However, it doesn't explicitly differentiate from 'count_tokens' which might be related, keeping it at 4 rather than 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention use cases for embeddings (e.g., semantic search, clustering) or when to choose it over other tools like 'generate_text' for similar text processing tasks. There's no explicit when/when-not or alternative tool references.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_textC

Generate text using Google Gemini with advanced features

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe prompt to send to Gemini
modelNoSpecific Gemini model to usegemini-2.5-flash
systemInstructionNoSystem instruction to guide model behavior
temperatureNoTemperature for generation (0-2)
maxTokensNoMaximum tokens to generate
topKNoTop-k sampling parameter
topPNoTop-p (nucleus) sampling parameter
jsonModeNoEnable JSON mode for structured output
jsonSchemaNoJSON schema for structured output (when jsonMode is true)
groundingNoEnable Google Search grounding for up-to-date information
safetySettingsNoSafety settings for content filtering
conversationIdNoID for maintaining conversation context

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'advanced features' but doesn't specify what these are (e.g., grounding, JSON mode, safety settings). It doesn't disclose rate limits, authentication needs, costs, or what happens on failure. The description is too vague to help an agent understand behavioral traits beyond basic generation.

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 a single, efficient sentence that gets straight to the point. It's appropriately sized for a tool with this complexity. However, it could be more front-loaded by specifying key capabilities (e.g., 'Generate text with options for JSON output, grounding, and safety controls') to immediately convey value.

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?

For a complex tool with 12 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'advanced features' entail, doesn't guide usage relative to siblings, and leaves behavioral aspects unclear. The agent would struggle to use this effectively without relying heavily on the schema alone.

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 description coverage is 100%, so the schema already documents all 12 parameters thoroughly. The description adds no parameter-specific information beyond implying 'advanced features' might relate to some parameters. Baseline is 3 since the schema does heavy lifting, but the description doesn't compensate with additional context about parameter interactions or best practices.

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 verb ('generate') and resource ('text') with the specific technology ('using Google Gemini'). It distinguishes from siblings like analyze_image or embed_text by focusing on text generation. However, it doesn't explicitly differentiate from count_tokens or list_models in terms of when to use each.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'advanced features' but doesn't specify what makes it advanced compared to basic text generation or when to choose it over other siblings like analyze_image for multimodal tasks. There's no mention of prerequisites, limitations, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_helpC

Get help and usage information for the Gemini MCP server

ParametersJSON Schema
NameRequiredDescriptionDefault
topicNoHelp topic to get information aboutoverview

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves help information, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured or unstructured data, or handles errors. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, clear sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action, making it easy to parse. However, it could be slightly more structured by hinting at the parameter usage, but overall it's concise and well-formed.

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 low complexity (one optional parameter with full schema coverage) and lack of output schema, the description is minimally adequate. It states what the tool does but doesn't cover behavioral aspects like response format or error handling, which are important for a help tool. With no annotations, it should provide more context to be fully complete.

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, with the 'topic' parameter fully documented including its enum values and default. The description doesn't add any semantic details beyond what the schema provides, such as explaining what each topic covers or how the help is formatted. Given the high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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: 'Get help and usage information for the Gemini MCP server.' It uses a specific verb ('Get') and identifies the resource ('help and usage information'), though it doesn't explicitly differentiate from sibling tools like 'list_models' which might provide model information. The purpose is unambiguous but lacks sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or compare it to sibling tools like 'list_models' for model info or 'generate_text' for examples. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_modelsB

List all available Gemini models and their capabilities

ParametersJSON Schema
NameRequiredDescriptionDefault
filterNoFilter models by capability

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe key behaviors such as whether it's a read-only operation, if it requires authentication, rate limits, or what the output format looks like (e.g., list structure, pagination). This leaves significant gaps for an agent to understand how to interact with it effectively.

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?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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 low complexity (one optional parameter) and rich schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it doesn't fully compensate by explaining return values or behavioral traits, leaving the agent with incomplete context for proper usage.

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, with a clear enum for the 'filter' parameter. The description mentions 'capabilities', which aligns with the schema's 'filter by capability', but doesn't add meaningful semantics beyond what the schema already provides (e.g., explaining what each enum value means in context). This meets the baseline for high schema coverage.

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 verb ('List') and resource ('all available Gemini models and their capabilities'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_help' or 'analyze_image', which might also involve model information, so it doesn't reach the highest score.

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. For example, it doesn't specify if this should be used for discovery before calling 'generate_text' or how it relates to 'get_help'. The description lacks context about usage scenarios or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updates
    • First observedanalyze_image
    • First observedcount_tokens
    • First observedembed_text
    • First observedgenerate_text
    • First observedget_help
    • First observedlist_models

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: image analysis, token counting, text embedding, text generation, help retrieval, and model listing. The descriptions reinforce these distinct functions, making tool selection unambiguous for an agent.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (e.g., analyze_image, count_tokens, embed_text), using snake_case throughout. This predictable naming scheme enhances readability and usability for agents.

Tool Count5/5

With 6 tools, the server is well-scoped for its purpose of providing Gemini AI capabilities. Each tool serves a specific, essential function (e.g., core generation, analysis, and utility tasks), with no redundant or trivial additions.

Completeness4/5

The tool set covers key Gemini functionalities like text generation, image analysis, embeddings, and model listing, with a helpful utility tool. A minor gap is the lack of tools for managing conversations or multi-turn interactions, but core workflows are well-supported.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A server implementing the Model Context Protocol that enables AI assistants like Claude to interact with Google's Gemini API for text generation, text analysis, and chat conversations.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server implementation for the Google Gemini language model. This server allows Claude Desktop users to access the powerful reasoning capabilities of Gemini-2.0-flash-thinking-exp-01-21 model.
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that enables Claude Desktop and other MCP-compatible clients to leverage Google's Gemini AI models with features like thinking models, Google Search grounding, JSON mode, and vision support.
    6
    44 npm
    14
    MIT