Gemini Web API

v1.0.0APIsstable

MCP server for Google Gemini — free image generation, editing & chat via browser cookies. No API keys needed.

aiclaudeclaude-codegeminigemini-api
Share:
27
Stars
0
Downloads
0
Weekly
0/5

What is Gemini Web API?

Gemini Web API is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for google gemini — free image generation, editing & chat via browser cookies. no api keys needed.

MCP server for Google Gemini — free image generation, editing & chat via browser cookies. No API keys needed.

This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP server for Google Gemini — free image generation, editin

Use Cases

Free image generation
AI image editing
No API keys needed
AndyShaman

Maintainer

LicenseAGPL-3.0
Languagepython
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gemini-webapi

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Gemini Web API

Gemini Web API MCP is a Python-based server that connects Claude and other MCP clients to Google Gemini's capabilities — including free image generation, image editing, file analysis, and multi-turn chat — using browser cookies instead of a paid API key. It auto-detects your Google account credentials from Chrome, making setup frictionless. Developers and creatives who want to combine Claude's reasoning with Gemini's image generation without per-request API costs will find this server particularly useful.

Prerequisites

  • Python 3.10+ and uv (the fast Python package manager) installed
  • Google Chrome installed and signed into a Google account with Gemini access
  • An MCP-compatible client: Claude Desktop or Claude Code
  • Active Google account with Gemini enabled (free tier is sufficient)
1

Install uv if not already present

uv is used to run the server with all dependencies in an isolated environment without a manual virtualenv setup.

curl -LsSf https://astral.sh/uv/install.sh | sh
2

Add the server to Claude Code

Register the Gemini Web API MCP server with Claude Code using the mcp add-json command. It installs and runs the package on-demand via uv.

claude mcp add-json gemini '{"command":"uv","args":["run","--with","gemini-webapi-mcp @ git+https://github.com/AndyShaman/gemini-webapi-mcp.git","gemini-webapi-mcp"]}'
3

Add to Claude Desktop configuration (alternative)

For Claude Desktop, add the server entry manually to claude_desktop_config.json. Cookies are auto-detected from Chrome by default.

{
  "mcpServers": {
    "gemini": {
      "command": "uv",
      "args": ["run", "--with", "gemini-webapi-mcp @ git+https://github.com/AndyShaman/gemini-webapi-mcp.git", "gemini-webapi-mcp"]
    }
  }
}
4

Configure optional environment variables

Set optional env vars to control language, account selection, or to manually provide cookie values if auto-detection fails.

{
  "mcpServers": {
    "gemini": {
      "command": "uv",
      "args": ["run", "--with", "gemini-webapi-mcp @ git+https://github.com/AndyShaman/gemini-webapi-mcp.git", "gemini-webapi-mcp"],
      "env": {
        "GEMINI_LANGUAGE": "en",
        "GEMINI_ACCOUNT_INDEX": "0"
      }
    }
  }
}
5

Restart Claude and verify

Restart your MCP client. Ask Claude to generate a test image using Gemini to confirm the connection is working.

Gemini Web API Examples

Client configuration

Claude Desktop configuration with optional manual cookie environment variables for accounts where Chrome auto-detection fails.

{
  "mcpServers": {
    "gemini": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "gemini-webapi-mcp @ git+https://github.com/AndyShaman/gemini-webapi-mcp.git",
        "gemini-webapi-mcp"
      ],
      "env": {
        "GEMINI_LANGUAGE": "en",
        "GEMINI_ACCOUNT_INDEX": "0",
        "GEMINI_WM_KEEP": "0"
      }
    }
  }
}

Prompts to try

Example prompts demonstrating image generation, editing, file analysis, and multi-turn chat via Gemini.

- "Generate a watercolor painting of a cat sitting on a windowsill at sunset using Gemini"
- "Now make the background darker and add rain outside the window"
- "Upload /path/to/report.pdf to Gemini and summarize its key findings"
- "Analyze this YouTube video URL and tell me the main topics covered"
- "Start a Gemini chat session and ask it to explain quantum entanglement simply"

Troubleshooting Gemini Web API

Authentication fails with cookie errors

Make sure Chrome is open and you are signed in to Google with Gemini access. If auto-detection keeps failing, manually copy your __Secure-1PSID and __Secure-1PSIDTS cookie values from Chrome DevTools and set them as GEMINI_PSID and GEMINI_PSIDTS environment variables.

Image generation returns an error or blank result

Call the gemini_reset tool to reinitialize the session, then try again. If errors persist, verify your Google account has Gemini image generation enabled (visit gemini.google.com to confirm).

uv command not found after installation

Add uv to your PATH by running 'source ~/.cargo/env' or restarting your terminal. Alternatively install uv with 'pip install uv' as a fallback.

Frequently Asked Questions about Gemini Web API

What is Gemini Web API?

Gemini Web API is a Model Context Protocol (MCP) server that mcp server for google gemini — free image generation, editing & chat via browser cookies. no api keys needed. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Gemini Web API?

Follow the installation instructions on the Gemini Web API GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Gemini Web API?

Gemini Web API works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Gemini Web API free to use?

Yes, Gemini Web API is open source and available under the AGPL-3.0 license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "gemini-webapi": { "command": "npx", "args": ["-y", "gemini-webapi"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Gemini Web API?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides