Connects Claude to Google's Gemini AI with 39 tools spanning text generation, image creation via Imagen 4, video generation with Veo, document analysis, YouTube summarization, text-to-speech, and multi-step web research. You get structured output extraction, content caching for repeated queries, code execution, and Google Search grounding for queries. Notable for image editing sessions where you can iteratively refine generated images across multiple turns. Runs locally via stdio so your API key stays on your machine. Reach for this when you want Claude to tap Gemini's multimodal capabilities, especially for tasks like analyzing PDFs, generating videos, or running deep research operations that span multiple web sources.
Public tool metadata for what this MCP can expose to an agent.
GEMINI_COUNT_TOKENSCounts the number of tokens in text using Gemini tokenization. Useful for estimating costs, checking input limits, and optimizing prompts before making API calls.2 paramsCounts the number of tokens in text using Gemini tokenization. Useful for estimating costs, checking input limits, and optimizing prompts before making API calls.
textstringmodelstringGEMINI_EMBED_CONTENTGenerates text embeddings using Gemini embedding models. Converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.4 paramsGenerates text embeddings using Gemini embedding models. Converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.
textstringmodelstringtitlestringtask_typestringGEMINI_GENERATE_CONTENTGenerates text content from prompts using Gemini models. Supports various models like Gemini Flash and Pro with configurable temperature, token limits, and safety settings for diverse text generation tasks.9 paramsGenerates text content from prompts using Gemini models. Supports various models like Gemini Flash and Pro with configurable temperature, token limits, and safety settings for diverse text generation tasks.
modelstringtop_kintegertop_pnumberpromptstringtemperaturenumberstop_sequencesarraysafety_settingsarraymax_output_tokensintegersystem_instructionstringGEMINI_GENERATE_IMAGEGenerates images from text prompts using Gemini 2.5 Flash Image Preview model (Nano Banana). Supports creative image generation with customizable parameters like aspect ratio, safety settings, and optional local file saving. Generated images are automatically uploaded to S3 an...9 paramsGenerates images from text prompts using Gemini 2.5 Flash Image Preview model (Nano Banana). Supports creative image generation with customizable parameters like aspect ratio, safety settings, and optional local file saving. Generated images are automatically uploaded to S3 an...
modelstringtop_kintegertop_pnumberpromptstringsave_pathstringtemperaturenumbersafety_settingsarraymax_output_tokensintegersystem_instructionstringGEMINI_GENERATE_VIDEOSGenerates videos from text prompts using Google's Veo models. Creates high-quality video content. Returns operation ID for tracking progress. After this, call GEMINI_WAIT_FOR_VIDEO to download the video using the operation ID.4 paramsGenerates videos from text prompts using Google's Veo models. Creates high-quality video content. Returns operation ID for tracking progress. After this, call GEMINI_WAIT_FOR_VIDEO to download the video using the operation ID.
modelstringextrasobjectpromptstringperson_generationstringGEMINI_GET_VIDEOS_OPERATIONChecks the status of a Veo video generation operation. Use the operation name from GenerateVideos to track progress and get the download URL when complete.1 paramsChecks the status of a Veo video generation operation. Use the operation name from GenerateVideos to track progress and get the download URL when complete.
operation_namestringGEMINI_LIST_MODELSLists available Gemini and Veo models with their capabilities and limits. Useful for discovering supported models and their features before making generation requests.1 paramsLists available Gemini and Veo models with their capabilities and limits. Useful for discovering supported models and their features before making generation requests.
filter_prefixstringGEMINI_WAIT_FOR_VIDEOPolls a Veo video generation operation until completion, then downloads and returns the video as a FileDownloadable with public URL.1 paramsPolls a Veo video generation operation until completion, then downloads and returns the video as a FileDownloadable with public URL.
operation_namestringA secure MCP (Model Context Protocol) server for Google Gemini AI - text, image, video, research, and more.
This MCP server is designed to be:
quay.io/crunchtools/mcp-gemini built on Hummingbird Python base image| Component | Name |
|---|---|
| GitHub repo | crunchtools/mcp-gemini |
| Container | quay.io/crunchtools/mcp-gemini |
| Python package (PyPI) | mcp-gemini-crunchtools |
| CLI command | mcp-gemini-crunchtools |
| Module import | mcp_gemini_crunchtools |
The container image is built on the Hummingbird Python base image from Project Hummingbird, which provides:
This means your MCP server runs in a hardened environment with fewer vulnerabilities than typical Python container images.
gemini_query - Query Gemini with optional Google Search groundinggemini_brainstorm - Generate creative ideas on a topicgemini_analyze_code - Analyze code for security, performance, bugsgemini_analyze_text - Analyze text for sentiment, tone, contentgemini_summarize - Summarize content in various formatsgemini_generate_image - Generate images from text prompts (native Gemini)gemini_generate_image_with_input - Edit/modify existing imagesgemini_image_prompt - Craft effective image generation promptsgemini_imagen_generate - Generate images using Google Imagen 4 modelsgemini_start_image_edit - Start a multi-turn image editing sessiongemini_continue_image_edit - Continue editing in an active sessiongemini_end_image_edit - End an image editing sessiongemini_list_image_sessions - List all active editing sessionsgemini_analyze_image - Analyze and describe local image filesgemini_search - Web search using Gemini with Google Search groundinggemini_analyze_document - Analyze PDFs, DOCX, TXT, etc.gemini_summarize_pdf - Summarize PDF documentsgemini_extract_tables - Extract tables from documentsgemini_analyze_url - Analyze one or more URLsgemini_compare_urls - Compare two URLsgemini_extract_from_url - Extract specific data from a URLgemini_generate_video - Generate videos using Veogemini_check_video - Check video generation statusgemini_youtube - Analyze YouTube videosgemini_youtube_summary - Summarize YouTube videosgemini_speak - Convert text to speechgemini_dialogue - Generate multi-voice dialogue audiogemini_list_voices - List available voicesgemini_deep_research - Perform multi-step web researchgemini_check_research - Check research operation statusgemini_research_followup - Ask follow-up questionsgemini_create_cache - Create content cache for repeated queriesgemini_query_cache - Query cached contentgemini_list_caches - List all active cachesgemini_delete_cache - Delete a cachegemini_structured - Get structured JSON outputgemini_extract - Extract structured data from textgemini_count_tokens - Count tokens in contentgemini_run_code - Execute Python code via GeminiTotal: 39 tools
uvx mcp-gemini-crunchtools
pip install mcp-gemini-crunchtools
# Create a shared output directory (required before first run)
mkdir -p ~/.local/share/mcp-uploads-downloads
podman run -v ~/.local/share/mcp-uploads-downloads:/output:z \
-e GEMINI_API_KEY=your_key \
-e GEMINI_OUTPUT_DIR=/output \
quay.io/crunchtools/mcp-gemini
SELinux note: Use
:z(lowercase, shared) instead of:Z(uppercase, private). MCP servers run as long-lived stdio processes. With:Z, files copied into the directory after container start won't have the container's private MCS label and will be invisible inside the container. The:zflag sets a sharedcontainer_file_tcontext that all containers and the host can read/write.Tip: Use the same shared directory (
~/.local/share/mcp-uploads-downloads/) across multiple MCP container servers (e.g., mcp-gemini and mcp-wordpress) so generated images are immediately available for WordPress upload without copying.
Navigate to Google AI Studio
Create API Key
Copy Your API Key
AI... (e.g., AIzaSy...)claude mcp add mcp-gemini-crunchtools \
--env GEMINI_API_KEY=your_api_key_here \
-- uvx mcp-gemini-crunchtools
Or for the container version:
# Create a shared output directory (required before first run)
mkdir -p ~/.local/share/mcp-uploads-downloads
claude mcp add mcp-gemini-crunchtools \
--env GEMINI_API_KEY=your_api_key_here \
--env GEMINI_OUTPUT_DIR=/output \
-- podman run -i --rm \
-v ~/.local/share/mcp-uploads-downloads:/output:z \
-e GEMINI_API_KEY \
-e GEMINI_OUTPUT_DIR=/output \
quay.io/crunchtools/mcp-gemini
For generated images, audio, and videos when running without a container:
claude mcp add mcp-gemini-crunchtools \
--env GEMINI_API_KEY=your_api_key_here \
--env GEMINI_OUTPUT_DIR=$HOME/.local/share/mcp-uploads-downloads \
-- uvx mcp-gemini-crunchtools
User: What are the latest developments in quantum computing?
Assistant: [calls gemini_query with use_google_search=true]
User: Generate a photorealistic image of a sunset over mountains
Assistant: [calls gemini_generate_image with prompt and style]
User: Analyze this research paper at /path/to/paper.pdf
Assistant: [calls gemini_analyze_document with file_path]
User: Summarize this YouTube video: https://youtube.com/watch?v=...
Assistant: [calls gemini_youtube_summary with url]
User: Research the environmental impact of electric vehicles
Assistant: [calls gemini_deep_research then gemini_check_research]
User: Analyze this Python code for security issues
Assistant: [calls gemini_analyze_code with focus="security"]
This server was designed with security as a primary concern. See SECURITY.md for:
API Key Protection
Input Validation
API Hardening
Automated CVE Scanning
git clone https://github.com/crunchtools/mcp-gemini.git
cd mcp-gemini
uv sync
uv run pytest
uv run ruff check src tests
uv run mypy src
podman build -t mcp-gemini .
AGPL-3.0-or-later
Contributions welcome! Please read SECURITY.md before submitting security-related changes.
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent