Skip to main content
Glama
cybaea

Gemini Agent MCP Server

by cybaea

Gemini Agent MCP Server

An advanced Model Context Protocol (MCP) server that provides three purpose-built agent tools — web search, URL analysis, and code execution — via Gemini Flash models on Vertex AI.

Unlike a standard search tool, this server separates each capability into its own MCP tool, so your AI client (goose, Claude Desktop, etc.) can orchestrate real-time Google Search, deep URL analysis, and Python code execution across multiple requests to solve complex, multi-step research and data tasks.

Features

  • Search Grounding: Uses Google Search to find up-to-the-minute information.

  • URL Context: Automatically fetches and parses the content of specific web pages for deep analysis.

  • Code Execution: Writes and executes Python code on-the-fly to perform calculations, data manipulation, or logical reasoning.

  • Thinking Mode: Uses Gemini's internal reasoning to plan and refine its approach before answering — a 512-token thinking budget by default, overridable with GEMINI_THINKING_LEVEL or GEMINI_THINKING_BUDGET.

Related MCP server: Gemini Research MCP Server

Prerequisites

  1. Google Cloud Project: You must have a Google Cloud project with the Vertex AI API enabled.

  2. Authentication: You must have gcloud CLI installed and authenticated:

    gcloud auth application-default login
  3. Permissions: Your account needs the Vertex AI User role on the project.

Configuration

The server requires the following environment variables:

Variable

Description

Default

GCP_PROJECT_ID

Your Google Cloud Project ID (Required)

-

GCP_LOCATION

Vertex AI location

global

GEMINI_MODEL

Gemini model ID to call; must be available for the project and location on Vertex AI

gemini-3.8-flash

GEMINI_THINKING_LEVEL

Overrides thinking depth (low, medium, high, or minimal); takes precedence over the budget. Note: support varies by model — gemini-3.8-flash rejects minimal

unset

GEMINI_THINKING_BUDGET

Thinking budget in tokens

512

Note: GOOGLE_CLOUD_PROJECT can also be used instead of GCP_PROJECT_ID, and GOOGLE_CLOUD_LOCATION instead of GCP_LOCATION.

Installation & Usage

1. Build the project

npm install
npm run build

2. Integration with Goose

Add the following to your ~/.config/goose/profiles.yaml (or manage via the Goose UI):

  gemini-agent:
    cmd: node
    args:
      - /path/to/gemini-agent-mcp/build/index.js
    envs:
      GCP_PROJECT_ID: "your-project-id"
      GCP_LOCATION: "global"

3. Integration with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "gemini-agent": {
      "command": "node",
      "args": ["/path/to/gemini-agent-mcp/build/index.js"],
      "env": {
        "GCP_PROJECT_ID": "your-project-id",
        "GCP_LOCATION": "global",
        "PATH": "/usr/local/bin:/usr/bin:/bin" 
      }
    }
  }
}

Tools

The server exposes three purpose-built tools. Because the underlying model rejects requests that combine multiple tools ("Multiple tools are supported only when they are all search tools"), each tool makes a single-tool Gemini call; orchestration across capabilities happens at the client level.

Search the web using Google Search grounding and get an AI-synthesized answer with up-to-the-minute information.

  • Arguments: query (string, required)

  • Use for: current events, recent releases, news, or any question where search results would improve the answer.

gemini_url_context

Fetches and deeply analyzes the content of specific web page URLs.

  • Arguments: urls (array of URLs, required), instruction (string, optional — what to learn from the page(s))

  • Use for: when you have a concrete URL and want to extract, summarize, or answer questions about its content.

gemini_code_execution

Writes and executes Python code in a Gemini sandbox to solve computational problems.

  • Arguments: task (string, required — described in plain language)

  • Use for: math, data analysis, statistics, data transformation, simulations, or logical reasoning.

ask_gemini_agent (legacy)

The original all-in-one tool, kept for backward compatibility with existing client configurations. Because the configured model cannot combine tools in one request, it now performs a single search-grounded call — prefer the three purpose-built tools above.

Limitations

  • Model: Defaults to gemini-3.8-flash (current Gemini Flash model on Vertex AI, global location). Override with GEMINI_MODEL to any model available for your project and GCP_LOCATION. Note: Developer-API aliases such as gemini-flash-latest do not exist as Vertex AI publisher models and fail with 404 — see the model documentation.

  • One Tool Per Request: The model supports search, URL context, and code execution individually, but the API rejects combining them in a single request; the server automatically falls back to a single tool (search first) if the combined request is rejected.

  • Python-only Code Execution: The code execution environment is restricted to standard Python libraries provided by the Gemini sandbox.

  • Stdio Transport: This server currently only supports standard I/O communication.

Testing

npm run test:integration runs an end-to-end smoke test over stdio: it launches the built server with GEMINI_MODEL unset (exercising the built-in default model), verifies all four tools are registered, and issues one live search-grounded request. It requires Google Application Default Credentials ("gcloud auth application-default login") and network access.

npm run build
npm run test:integration

License

MIT

Available Tools

1 tool
ask_gemini_agentA

An AI agent capable of searching the web (search grounding), analyzing specific URLs, and writing/executing Python code to solve complex problems, perform data analysis, or answer research questions.

NameRequiredDescriptionDefault
queryYesThe task, question, or research topic for the agent to resolve

TDQS

A4.4/5.0
Behavior4/5

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

The description openly lists the agent's capabilities (web search, URL analysis, code execution). Without annotations, it carries the full burden and does so fairly well, though it omits potential limitations or failure modes.

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 sentence that efficiently conveys the tool's purpose. It is concise but not overly terse; however, it could be broken into shorter sentences for clarity.

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 the single parameter and no output schema or sibling tools, the description provides sufficient context to understand when and how to use the tool. It covers the agent's main capabilities.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter 'query' is well-described in the schema as 'the task, question, or research topic.' The tool description reinforces this by explaining the agent's actions, adding context beyond the schema.

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 agent's capabilities: web search, URL analysis, and Python code execution. It specifies the resource (Gemini agent) and actions, making the purpose unambiguous.

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?

The description provides clear context on when to use the tool ('complex problems, data analysis, research questions'). However, it does not explicitly state when not to use it or list alternatives, though no sibling tools exist.

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. 1 tool updatev2.0.0
    • First observedask_gemini_agent

TDQS

A4.3/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no risk of confusion between tools; the single tool's purpose is clearly described.

Naming Consistency5/5

The single tool name follows a clear verb_noun pattern and is consistently styled, so no inconsistency arises.

Tool Count3/5

One tool is borderline for a server that aims to provide web search, URL analysis, and code execution; typically such capabilities yield at least 3-5 tools.

Completeness3/5

The tool covers a broad range of tasks, but bundling them into one tool may hide missing operations; a more modular surface would be expected for a domain like this.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that utilizes LangGraph and Google Gemini to conduct comprehensive research through multi-iteration deep searches and quick results. It provides high-quality analysis with automated citations and grounding metadata for thorough investigations.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that lets AI assistants use Google's Gemini models. Generate text, analyze images, review code, and more — with support for multi-turn conversations and web-grounded answers.
    116 npm
    1
    MIT