gemini-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GEMINI_DEBUG | No | Set to 1 to include stack traces in errors. | 0 |
| GEMINI_API_KEY | Yes | Your Gemini API key from Google AI Studio (required). | |
| GEMINI_MCP_HOME | No | Location of models.json and data/ (usage log, update report). Defaults to the repository folder, or ~/.gemini-mcp when pip-installed. | |
| GEMINI_AUTO_CHECK | No | Set to 0 to disable the daily background update check. | 1 |
| GEMINI_OUTPUT_DIR | No | Where files are saved (images/, videos/, audio/, music/, transcripts/, agent/...). | ~/Documents/gemini-mcp/outputs |
| GEMINI_TEXT_MODEL | No | Override the default text model (see list_capabilities). | |
| GEMINI_IMAGE_MODEL | No | Override the default image model (see list_capabilities). | |
| GEMINI_AGENT_MAX_TOKENS | No | Hard ceiling for any agent budget. | 300000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
GEMINI-MCP v6.0.0 - QUICK GUIDE Defaults (see list_capabilities): text gemini-4-hydrogen, image gemini-nano-banana-2.1, video gemini-omni-1.2-flash, tts gemini-3.8-flash-tts, music lyria-3-clip-preview (fallback lyria-3.5), transcribe gemini-3.5-transcribe, agent antigravity-preview-09-2026. SDK: google-genai, client.interactions.create(...). gemini-2.x / 1.5 are legacy. RULES
For new API features use docs_search then docs_read; for model news use check_updates.
Image, video, music, speech, Deep Research and agents cost money: confirm before batches, prototype with cheaper models.
Long jobs return job_id -> check_job. The same request within 10 min is NOT re-run (force_new=true overrides).
Generations return interaction_id: pass it as previous_interaction_id to edit/extend.
For images with exact text use gemini-3-pro-image and verify with decide.
Agents need an explicit max_total_tokens budget; poll with agent_status, fetch files with agent_files.
Outputs go under OUTPUT_DIR: images/ videos/ audio/ music/ transcripts/ vectors/ agent/.
Errors return {"ok": false, "error": ...}; tell the user plainly. Usage: usage_report.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gemini_chatA | Generate text with Gemini or analyze files (images, audio, video, PDF, Office, CSV, text). model: default in list_capabilities; e.g. gemini-4-carbon (smartest), gemini-4-neon, gemini-4-argon, gemini-4-hydrogen, gemini-3.8-flash, gemini-3.5-flash-lite (cheapest). files: absolute paths of files to analyze. google_search / url_context / code_execution / google_maps: built-in tools. json_schema: return structured JSON matching this schema. previous_interaction_id: continue a conversation from an earlier interaction_id. thinking_level: minimal, low, medium, high or xhigh (depth = cost/latency). max_output_tokens: output cap. tools: raw tool definitions appended to the built-ins. |
| generate_imageA | Generate an image with Nano Banana, or edit/combine reference images. Saves a JPEG. prompt: detailed description (English works best); put any in-image text in quotes. aspect_ratio: 4:5 (default), 1:1, 9:16, 16:9, 3:4, 4:3, 2:3, 3:2, 5:4, 21:9, 1:4, 4:1, 1:8, 8:1. image_size: 512, 1K, 2K (default) or 4K. model: gemini-nano-banana-2.1 (default), gemini-3-pro-image (best text), gemini-3.1-flash-lite-image. reference_images: up to 14 local images to edit or take style/subjects from. previous_interaction_id: edit the image from an earlier call ("same scene, warmer light") - the most reliable way to keep a character/product consistent. google_search: ground the image in current facts. force_new: regenerate even if the identical request ran recently (billed again). |
| generate_videoA | Generate, edit or extend a video with native audio (Gemini Omni Flash). Runs in the background. prompt: scene, camera, light, mood, dialogue/sound. For edits/extensions describe only the change. aspect_ratio: 9:16 (default when generating) or 16:9. duration_seconds: 3-15 when generating (default 8); 3-10 added seconds when extending. resolution: 360p, 720p (default), 1080p or 4k (both upscaled). reference_images: up to 6 reference/first-frame images (2 + task=image_to_video for first+last frame). video_files: one local video (<=15 s) to edit/extend (not available in EEA/CH/UK). previous_interaction_id: interaction_id of a video made here; edit/extend without re-uploading. Extensions are appended to the end, total <= 30 s. task: only if natural language is ambiguous: text_to_video, image_to_video, reference_to_video, edit, extend, upscale. delivery: inline or uri (auto uri for 1080p/4k). force_new: regenerate even if the identical request ran recently (billed again). |
| text_to_speechA | Read text aloud and save a WAV (130+ languages). text: exact text. For multi-speaker, each line is "Name: text". voice: prebuilt voice (Kore, Puck, Charon, Fenrir, Aoede, Leda, Orus, Zephyr...; see list_voices) or a custom voice id (voice_...). style: delivery direction, e.g. "warm, reassuring, unhurried". language: BCP-47 code (e.g. en-US, tr-TR); auto-detected if empty. speakers: [{"speaker": "Ana", "voice": "Kore"}, {"speaker": "Ben", "voice": "Puck"}]. |
| list_voicesA | List TTS voices (your custom voices first, then prebuilt). Free. search: name/description query. gender: female, male, neutral. language_code: BCP-47 (e.g. tr-TR). |
| design_voiceA | Create a PERSISTENT custom voice from a text description; use the returned id as description: e.g. "woman in her 40s, warm and trustworthy, slow pace". display_name: voice name. base_voice: prebuilt voice to start from. language_code: e.g. en-US. |
| transcribe_audioA | Transcribe speech in an audio file (language auto-detected). path: audio file (mp3, wav, m4a, aac, ogg, flac, opus). For video use gemini_chat. word_timestamps: word-level timings (for subtitles). diarization: separate up to 8 speakers. language_codes: hints, e.g. ["en-US"]. custom_vocabulary: brand/proper names (<=1000 terms). verbatim: keep filler words. save: write the transcript to a .txt and return only its path. |
| generate_musicA | Generate music with Lyria (background tracks, jingles, full songs). Lyrics follow the prompt language. prompt: genre, tempo, instruments, mood; say "instrumental" for no vocals. lyria-3.5 accepts [verse]/[chorus] tags and timestamps for custom lyrics and structure. model: lyria-3-clip-preview (30 s) or lyria-3.5 (full song). If unavailable (404) the next fallback is tried automatically; the model used is reported. duration_seconds: target length (lyria-3.5 only). wav: WAV instead of MP3 (lyria-3.5 only). reference_images: up to 10 images to inspire the music. |
| check_jobB | Get the result of a background job (image, video, music, speech, api_call). wait_seconds: how long to wait in this call (0-55). |
| api_callA | Raw Interactions API gateway: send ANY request the SDK supports; media outputs are saved. Use it for brand-new models/features before a dedicated tool exists (see docs_search for schemas). model or agent: one is required. input: text or a content list ([{"type":"text","text":"..."}]). files: local files appended to the input. response_format / generation_config / tools / environment / agent_config: passed through as-is. beta: use the v1beta client (default). |
| agent_runA | Start the Antigravity managed agent: an autonomous agent in a Google-hosted Linux sandbox that can write and run code, edit files and browse. Runs in the background; BILLED per token, and the agent may itself call other Gemini APIs with your key - always confirm the budget with the user first. task: what to do and what to deliver (e.g. "analyze sales.csv, write report.txt and chart.png"). max_total_tokens: REQUIRED hard budget for the run (capped by GEMINI_AGENT_MAX_TOKENS, default 300000). If the budget runs out the status is "incomplete"; resume with previous_interaction_id + environment_id. model: reasoning model for the agent (e.g. gemini-3.8-flash, gemini-4-hydrogen); default is the agent's. files: local files uploaded into the sandbox (<=10 MB total). repository: a repository source to mount, e.g. "github.com/owner/repo". sources: raw source objects ({"type": "gcs"|"inline"|"repository", "source", "target", ...}). network: "disabled" to cut off internet access. environment_id / previous_interaction_id: continue in an existing sandbox / conversation. Then: agent_status(interaction_id) for progress, agent_files(environment_id) for outputs. |
| agent_statusB | Check an agent run (agent_run) - returns status, final answer when done, usage and environment_id. Long answers are saved to a file. wait_seconds: max wait in this call (0-55). |
| agent_cancelB | Stop a running agent or Deep Research task (stops further billing). |
| agent_filesA | List files in an agent sandbox and optionally download them to OUTPUT_DIR/agent/<environment_id>/. path: folder or file inside the workspace ("" = root). recursive: include subfolders. download: save the listed files locally (at most max_files, <=200). |
| deep_research_startA | Start the Deep Research agent in the background (multi-source web research; minutes; billed). query: research question and desired report format. maximum: most thorough (slower, pricier). Poll with deep_research_result(interaction_id). |
| deep_research_resultA | Check a Deep Research task; returns the report when complete. wait_seconds: max wait in this call (0-55). save: always write the report to a file (long reports are saved automatically and a preview is returned). |
| decideA | Decisions API: calibrated probability of "yes" for each yes/no question. Cheap and fast. Great as a QA gate, e.g. "Is the in-image text spelled correctly?" or, with a reference and a generated image, "Is it the same product in both images?" (hallucination/consistency check). content: text or instructions to evaluate. questions: list of yes/no questions. files: optional files to include. model: default gemini-decision-1. |
| embed_textsB | Embed texts. Compact by default: dimensions + a similarity matrix (up to 12 texts). return_vectors: include raw vectors (large). save_vectors: write vectors to a JSON file. |
| usage_reportB | Summarize recent usage per tool and model (requests, successes, seconds, tokens). No money amounts: your Google Cloud billing is the source of truth. |
| check_updatesA | Scan the official changelog for new models and deprecations affecting your defaults, probe model access (free models.get calls) and check for a newer gemini-mcp release. Changes nothing; the report is saved to data/update_report.json. Use set_default_model to adopt a model. days: how far back to scan. probe: probe model availability for this API key. |
| set_default_modelA | Persistently change a default model (models.json; no restart needed). kind: text, image, video, tts, music, transcribe, embedding, decision, research, research_max, agent. model: new model id. If the free probe says not_found, pass force=true. |
| list_capabilitiesB | Default models, options, output folder and the last update-check summary. |
| docs_searchA | Search the official Gemini API docs (guides, API reference, SDK sources). language: python, javascript, go, java or dotnet (python saves tokens). scope: guide, sdk, api-reference, type-reference, migration or deprecated. api: interactions (new) or generate-content (classic). limit: 1-50. Read a hit in full with docs_read(chunk_id). |
| docs_readA | Read a docs section by chunk_id from docs_search. context: neighbouring sections to add (0-5). |
| gemini_guideC | Current Gemini models, SDK notes and this server's usage rules. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 25 tools
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.
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.
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.
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.