Skip to main content
Glama
README.md
# gemini-mcp

**Every Gemini API capability as tools for Claude and any other MCP client:** text, images (Nano Banana), video with native audio (Gemini Omni), speech and custom voices, music (Lyria), transcription, embeddings, decisions, Deep Research and the Antigravity managed agent.

[Türkçe README](README.tr.md) · License: Apache-2.0

```
You:    "Make a 9:16 product video of this bicycle, then extend it by 5 seconds"
Claude: generate_video(...) → videos/bicycle.mp4 → generate_video(previous_interaction_id=..., ...) → done
```

## New to this? Start here

**What is it, in plain words?** Claude is great at writing and thinking, but it cannot draw pictures, make videos or speak out loud by itself. Google's Gemini can. This project is a small "bridge" program that lets Claude use Gemini's skills. Once it is installed, you just ask Claude in normal language, for example *"make a square picture of a cozy coffee shop"*, and the finished file appears in a folder on your computer.

**What can I ask for?**
- Pictures and picture edits ("make the background white", "put this logo on a mug")
- Short videos with sound, and making them longer
- Turning text into speech, with many voices and languages
- Background music or full songs
- Writing out what is said in a recording
- Long web research reports

**What do I need?**
1. A computer with **Python** installed. On Windows, get it from [python.org](https://www.python.org/downloads/) and tick **"Add Python to PATH"** during setup.
2. The **Claude Desktop** app.
3. A free **Gemini API key** from [Google AI Studio](https://aistudio.google.com/apikey). It is a long password-like code. Keep it secret.

**Setup in 5 steps (about 10 minutes)**
1. On this page, click the green **Code** button, then **Download ZIP**, and unzip it, for example to `Documents\gemini-mcp`.
2. Open that folder, type `cmd` in the address bar, press Enter, then run `pip install -r requirements.txt`.
3. In Claude Desktop open **Settings → Developer → Edit Config** and paste the block from [Install](#install) below. Put in the real path to `server.py` and your key.
4. Fully quit Claude Desktop (also from the system tray) and open it again.
5. Ask Claude: *"Use gemini-mcp to list your capabilities."* If you get an answer, you are done.

**Does it cost money?** Making pictures, videos, music, speech and research reports is charged by Google to your key's billing account. Text questions are cheap. Claude asks before expensive jobs, and you can ask *"show my usage report"* at any time. Google AI Studio shows your real bill.

**Something wrong?** The most common causes are a wrong path in the config, a missing key, or Claude not being fully restarted. Ask Claude *"what error did gemini-mcp return?"*. Errors are written in plain sentences.

## Why this server

- **Complete:** 25 tools covering the whole current Gemini lineup (Gemini 4, Nano Banana 2.1, Omni 1.2 Flash, TTS 3.8, Lyria 3.5, Transcribe 3.5, Decision 1, Deep Research, Antigravity).
- **Future-proof:** `api_call` sends any Interactions API request, so a model released tomorrow works today. `check_updates` scans the official changelog for new and deprecated models, probes access for free, and reports newer releases of this server. `set_default_model` switches models without editing code.
- **Cost-safe:**
  - The same paid request within 10 minutes is never billed twice; `force_new` overrides this.
  - Agents require an explicit token budget, with a hard ceiling on top.
  - `usage_report` shows where your tokens went.
- **Token-light:** tools return file paths and short summaries instead of large blobs, and long reports are saved to disk with a preview.
- **Non-blocking:** long jobs run in the background. A tool waits up to about 45 s, then returns a `job_id`.

## Tools

| Area | Tools |
|---|---|
| Text & files | `gemini_chat` (Search, URL context, code execution, Maps, JSON schema, thinking level, multi-turn) |
| Images | `generate_image` (generate, edit, up to 14 references, multi-turn edits, search grounding, 512 to 4K) |
| Video | `generate_video` (text/image to video, first and last frame, edit, extend up to 30 s, 360p to 4K) |
| Speech | `text_to_speech` (multi-speaker, style, 130+ languages), `list_voices`, `design_voice` |
| Transcription | `transcribe_audio` (word timestamps, diarization, custom vocabulary) |
| Music | `generate_music` (30 s clips or full songs, WAV, automatic model fallback) |
| Agents | `agent_run`, `agent_status`, `agent_cancel`, `agent_files` (Antigravity sandbox) |
| Research | `deep_research_start`, `deep_research_result` |
| Judging & search | `decide` (calibrated yes/no, ideal as a QA gate), `embed_texts` |
| Jobs & raw | `check_job`, `api_call` |
| Maintenance | `check_updates`, `set_default_model`, `usage_report`, `list_capabilities` |
| Docs | `docs_search`, `docs_read`, `gemini_guide` (official Gemini docs) |

## Install

Requirements: Python 3.11+ and a Gemini API key from [Google AI Studio](https://aistudio.google.com/apikey).

```bash
git clone https://github.com/ygtcyln/gemini-mcp.git
cd gemini-mcp
pip install -r requirements.txt        # or: pip install .
```

### Claude Desktop

Add this to `claude_desktop_config.json` (Settings → Developer → Edit Config), then fully quit and reopen Claude:

```json
{
  "mcpServers": {
    "gemini-mcp": {
      "command": "python",
      "args": ["/absolute/path/to/gemini-mcp/server.py"],
      "env": { "GEMINI_API_KEY": "your-key" }
    }
  }
}
```

If you installed it with `pip install .`, use `"command": "gemini-mcp"` with no `args`.

### Claude Code

```bash
claude mcp add gemini-mcp -e GEMINI_API_KEY=your-key -- python /absolute/path/to/gemini-mcp/server.py
```

## Configuration

| Variable | Default | Meaning |
|---|---|---|
| `GEMINI_API_KEY` | (required) | Your API key |
| `GEMINI_OUTPUT_DIR` | `~/Documents/gemini-mcp/outputs` | Where files are saved (`images/`, `videos/`, `audio/`, `music/`, `transcripts/`, `agent/`...) |
| `GEMINI_MCP_HOME` | the repository folder, or `~/.gemini-mcp` when pip-installed | Location of `models.json` and `data/` (usage log, update report) |
| `GEMINI_AGENT_MAX_TOKENS` | `300000` | Hard ceiling for any agent budget |
| `GEMINI_AUTO_CHECK` | `1` | Set to `0` to disable the daily background update check |
| `GEMINI_DEBUG` | `0` | Set to `1` to include stack traces in errors |
| `GEMINI_TEXT_MODEL`, `GEMINI_IMAGE_MODEL`, ... | see `list_capabilities` | Override a default model |

## Keeping up to date

- **Models:** ask your assistant to *"run check_updates"*. It lists new model IDs, deprecations that affect your defaults, and access probes, and it also runs automatically once a day. To adopt a model, call `set_default_model("text", "gemini-4-neon")`.
- **The server itself:** `check_updates` also compares your version with the latest GitHub release. To update, run `git pull` (or `pip install -U .`) and restart your client.

## Costs and safety

- Images, video, music, speech, Deep Research and agents are **billed by Google** to your key. Your assistant should confirm before running batches.
- `agent_run` needs `max_total_tokens`. The agent works in a Google-hosted sandbox and **may call other Gemini APIs with your key**. Start small (for example 20000 tokens), and use `agent_cancel` to stop a run.
- Your API key only lives in your MCP client's config or `.env`. It is never written to outputs or logs. `.gitignore` excludes `.env`, `models.json`, `data/` and outputs.

## Development

```bash
pip install -e ".[dev]"
ruff check . && pytest -q      # fully offline: the Gemini client is faked
```

Contributions are welcome. Please keep tool responses compact and add a test for each new tool.

## Support and contributions

This project is shared as-is, free to use under Apache-2.0. Bug reports with clear steps to reproduce are welcome in Issues. Feature requests, custom work and private support are not offered. Pull requests are limited to collaborators. Never post your API key in an issue.

## License

Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). This is an independent project, not affiliated with Google. "Gemini" is a trademark of Google LLC.

TDQS

B3.4/5.0

Scored across 25 tools

Disambiguation4/5

Most tools target a clearly distinct modality or lifecycle stage (image, video, TTS, music, transcription, embeddings, agents, research), so an agent can usually choose correctly. Minor overlap exists between generic paths like api_call, gemini_chat, and check_job versus the dedicated status/result tools for agents and Deep Research, but descriptions largely resolve it.

Naming Consistency3/5

All names use snake_case, which is readable, but the convention mixes verb_noun (generate_image, list_voices, transcribe_audio) with noun_verb or domain-prefixed names (docs_search, agent_status, deep_research_result, api_call). The grouping is understandable, but there is no single predictable pattern across the whole set.

Tool Count3/5

At 25 tools the surface is heavy, sitting at the upper boundary of the 16-25 'borderline' range. The breadth of Gemini modalities and agent workflows justifies many tools, but some lifecycle pairs (start/result, status/cancel/files) could potentially be consolidated.

Completeness4/5

Coverage is broad: text, image, video, TTS, music, transcription, embeddings, decisions, Deep Research, managed agents, docs, defaults, updates, and usage reporting are all represented. Remaining gaps are minor, such as no explicit cancel operation for media generation jobs and no custom-voice deletion.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues