Skip to main content
Glama

Gemini MCP (gemini-mcp)

A local Model Context Protocol (MCP) server that automates gemini.google.com using an authenticated browser profile via Playwright CDP.

Built specifically to unlock web-exclusive capabilities—including 4 Argon, 3.1 Pro, and Thinking Level depth controls—directly inside agentic workflows (Claude Desktop, Cursor, Hermes Agent, etc.).


Features

  • Model Switching:

    • 4 Argon (Complex tasks / Deep reasoning) — Requires Gemini Advanced / Google One AI Premium (Pro) plan

    • 3.1 Pro (Advanced reasoning)

    • 3.8 Flash (All-around everyday tasks)

    • 3.5 Flash-Lite (Fastest responses)

NOTE

Google Plan Requirement for 4 Argon: To unlock and use 4 Argon, your signed-in Google account must have an active Google One AI Premium / Gemini Advanced (Pro) subscription. Free-tier Google accounts will only have access to 3.8 Flash and 3.5 Flash-Lite.

  • Thinking Depth:

    • Low (Quick & concise)

    • Medium (Balanced depth)

    • High (Extra thorough reasoning)

  • Local File Uploads: Upload images, documents, and code files directly via gemini_upload_and_ask.

  • Usage & Quota Monitoring: Check live consumption %, weekly limits, and reset timestamps via gemini_usage.

  • Browser Profile Isolation: Defaults to a dedicated secondary profile (Profile 1) to ensure your main personal profile remains untouched.

  • Headless & Headed Support: Automatically detects running CDP instances (default: 9333), launches headless via xvfb-run on Linux servers, or opens normally on desktop environments (Linux, macOS, Windows).


Related MCP server: Browser MCP

Exposed Tools

Tool

Description

gemini_status

Returns connection state, signed-in Google account, active model, and thinking level.

gemini_usage

Checks real-time quota usage limits from gemini.google.com/usage: plan tier, current usage %, reset time, and weekly limit.

gemini_chat

Sends a prompt to Gemini with optional model selection, thinking level, and chat reset. Waits for streaming to complete.

gemini_switch_model

Changes the active model or adjusts thinking level without sending a message.

gemini_new_chat

Resets the session and opens a fresh conversation.

gemini_upload_and_ask

Uploads local file paths (images/docs/code) and submits a prompt about them.


Prerequisites

  1. Google Account with Pro Plan: To access 4 Argon, your account must be subscribed to Gemini Advanced / Google One AI Premium (Pro).

  2. Node.js: v18.0.0 or higher.

  3. Browser: Brave Browser (recommended) or Google Chrome.

  4. (Optional - Linux Headless): If running on a headless Linux server without a display:

    sudo apt update && sudo apt install -y xvfb

Quick Start

1. Clone & Build

git clone https://github.com/ferrianes/gemini-mcp.git
cd gemini-mcp
npm install
npm run build

2. One-Time Google Authentication

Before running the MCP server, sign in to your Google Account on the designated browser profile once:

On Linux:

brave-browser --profile-directory="Profile 1" "https://gemini.google.com/app?hl=en"

On macOS:

open -a "Brave Browser" --args --profile-directory="Profile 1" "https://gemini.google.com/app?hl=en"
  1. Log in to your Google account (with Gemini Advanced / Google One Pro access).

  2. Complete 2FA / Passkey verification.

  3. Once the Gemini chat interface loads, close the browser window. The session cookies will be saved in that profile.


MCP Configuration

Add gemini-mcp to your MCP client configuration (Claude Desktop, Cursor, Hermes Agent, etc.):

Option 1: Direct via npx (No manual clone needed)

Using GitHub repository directly:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": [
        "-y",
        "github:ferrianes/gemini-mcp"
      ]
    }
  }
}

Or via npm (if using the published @ferrianes/gemini-mcp package):

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": [
        "-y",
        "@ferrianes/gemini-mcp"
      ]
    }
  }
}

Option 2: Local Script (run.sh)

{
  "mcpServers": {
    "gemini": {
      "command": "/path/to/gemini-mcp/run.sh"
    }
  }
}

Environment Variables

You can customize behavior using the following environment variables:

Variable

Default

Description

GEMINI_MCP_BROWSER

Auto-detected

Path to browser binary (e.g. /usr/bin/brave-browser).

GEMINI_MCP_PROFILE

Profile 1

Chrome/Brave profile folder name to use.

GEMINI_MCP_USER_DATA_DIR

OS Default

Path to the browser user data directory.

GEMINI_MCP_CDP_PORT

9333

Port used for Chrome DevTools Protocol remote debugging.


License

This project is licensed under the MIT License.

Available Tools

6 tools
gemini_chatChat with GeminiA

Send a prompt to Gemini web. Supports switching models ('Argon' / '4 Argon', 'Pro' / '3.1 Pro', 'Flash' / '3.8 Flash', 'Flash-Lite') and setting thinking level ('low', 'medium', 'high'). Waits for response to complete and returns the text.

Inputs: prompt (required), model, new_chat, thinking_level, +1 more.

gemini_new_chatStart New ChatC
Idempotent

Start a fresh chat conversation on Gemini.

Inputs: no named parameters.

gemini_statusGemini Web StatusA
Read-only

Check the Gemini web session (signed-in Google account, active model, thinking level, and available models).

Inputs: no named parameters.

gemini_switch_modelSwitch Model or Thinking LevelA
Idempotent

Switch the active model ('Argon', 'Pro', 'Flash', 'Flash-Lite') or adjust thinking level without sending a chat message.

Inputs: model, thinking_level.

gemini_upload_and_askUpload Files and Ask GeminiB

Upload one or more local files (images, documents, code) to Gemini and ask a question about them.

Inputs: prompt (required), file_paths (required), model, new_chat, +2 more.

gemini_usageGemini Quota & Usage LimitsA
Read-only

Check Gemini quota and usage limits from gemini.google.com/usage, including current usage percentage, reset time, weekly limit, and active plan (Pro / Ultra / Free).

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool has a distinct role: status vs usage are separated by session/model info versus quota/limits, and chat/new_chat/switch_model/upload_and_ask are clearly differentiated. The only mild overlap is between gemini_chat and gemini_upload_and_ask, since both send prompts, but the file-upload capability makes the boundary clear enough.

    Naming Consistency5/5

    All six tools use a consistent gemini_ prefix with snake_case verb/noun naming (gemini_status, gemini_chat, gemini_new_chat, gemini_usage, gemini_switch_model, gemini_upload_and_ask). The pattern is predictable and readable throughout.

    Tool Count5/5

    Six tools is well-scoped for a Gemini web-session wrapper, with each tool earning its place across status, chat, reset, usage, model switching, and file upload. There is no obvious redundancy or bloat.

    Completeness4/5

    The surface covers the core lifecycle: check status, start a new chat, send prompts, switch models, upload files, and inspect usage. Minor gaps exist around conversation history management (listing or deleting past chats), but core workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to drive a real, logged-in Chrome browser for web automation tasks like navigation, clicking, typing, and screenshotting.
      2 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to control a real local browser window for web automation tasks such as clicking, typing, scrolling, and taking screenshots.
      11 npm
      -
    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients like Codex to operate chatgpt.com through a dedicated persistent browser profile, allowing chat creation, project management, prompt submission, file uploads, and response reading without using the ChatGPT API.
      33
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients to drive a real Chromium browser for automation, including navigation, JavaScript execution, CDP commands, network capture, and multi-tab control.
      7
      30 PyPI
      GPL 3.0