
MCP Gemini
io.github.crunchtools由 GitHub 帳號 crunchtools 發布v0.3.0更新於 Oct 24, 2026
MCP server for Google Gemini AI - text, image, video, research, and more
概覽
本機 MCP 伺服器,為助理提供 Google Gemini 工具,可進行文字問答、圖片與影片生成、文件與網址分析、研究、語音合成與程式碼執行。
- 可以做什麼
- 用 Gemini 進行問答、腦力激盪、摘要,以及文字與程式碼分析,可選擇啟用 Google 搜尋接地
- 生成與編輯圖片、用 Veo 生成影片,並進行多輪圖片編輯工作階段
- 分析本機圖片、PDF 與 DOCX 等文件、網址和 YouTube 影片,包含表格擷取
- 執行多步驟深度網路研究、追問後續問題並查看任務狀態
- 文字轉語音、產生多角色對話音訊並列出可用聲音
- 建立、查詢、列出與刪除內容快取,取得結構化 JSON 輸出、計算 token 數並透過 Gemini 執行 Python 程式碼
- 適用情境
- 適合需要讓助理呼叫 Google Gemini 模型進行多模態工作的情境,例如摘要 PDF 或 YouTube 影片、生成或編輯圖片與影片、進行帶搜尋接地的網路研究、產生語音,而不必自行撰寫 API 整合。
- 執行需求
- 以 PyPI 套件 mcp-gemini-crunchtools 透過 stdio 在本機執行(uvx 或 pip),也可使用容器映像。需要 Google Gemini API 金鑰,透過環境變數 GEMINI_API_KEY 提供,可在 Google AI Studio 建立。可選設定 GEMINI_OUTPUT_DIR 存放生成的媒體檔案;容器方式需掛載輸出目錄。需要連線至 Google API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 MCP Gemini,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MCP Gemini CrunchTools
A secure MCP (Model Context Protocol) server for Google Gemini AI - text, image, video, research, and more.
Overview
This MCP server is designed to be:
- Secure by default - STRIDE threat model (see SECURITY.md), Pydantic input validation, and the API key held as a
SecretStrto prevent accidental logging - No third-party services - Runs locally via stdio, your API key never leaves your machine
- Cross-platform - Works on Linux, macOS, and Windows
- Automatically updated - GitHub Actions monitor for CVEs and update dependencies
- Containerized - Available at
quay.io/crunchtools/mcp-geminibuilt on Hummingbird Python base image
Naming Convention
Why Hummingbird?
The container image is built on the Hummingbird Python base image from Project Hummingbird, which provides:
- Minimal CVE exposure - Hummingbird images are built with a minimal package set, dramatically reducing the attack surface compared to general-purpose images
- Regular updates - Security patches are applied promptly, keeping CVE counts low
- Optimized for Python - Pre-configured Python environment with uv package manager for fast, reproducible builds
- Production-ready - Designed for production workloads with proper signal handling and non-root user defaults
This means your MCP server runs in a hardened environment with fewer vulnerabilities than typical Python container images.
Features
Query Tools (5 tools)
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 formats
Image Generation (4 tools)
gemini_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 models
Image Editing (4 tools)
gemini_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 sessions
Image Analysis (1 tool)
gemini_analyze_image- Analyze and describe local image files
Search Tools (1 tool)
gemini_search- Web search using Gemini with Google Search grounding
Document Tools (3 tools)
gemini_analyze_document- Analyze PDFs, DOCX, TXT, etc.gemini_summarize_pdf- Summarize PDF documentsgemini_extract_tables- Extract tables from documents
URL Tools (3 tools)
gemini_analyze_url- Analyze one or more URLsgemini_compare_urls- Compare two URLsgemini_extract_from_url- Extract specific data from a URL
Video Tools (2 tools)
gemini_generate_video- Generate videos using Veogemini_check_video- Check video generation status
YouTube Tools (2 tools)
gemini_youtube- Analyze YouTube videosgemini_youtube_summary- Summarize YouTube videos
Voice Tools (3 tools)
gemini_speak- Convert text to speechgemini_dialogue- Generate multi-voice dialogue audiogemini_list_voices- List available voices
Research Tools (3 tools)
gemini_deep_research- Perform multi-step web researchgemini_check_research- Check research operation statusgemini_research_followup- Ask follow-up questions
Cache Tools (4 tools)
gemini_create_cache- Create content cache for repeated queriesgemini_query_cache- Query cached contentgemini_list_caches- List all active cachesgemini_delete_cache- Delete a cache
Structured Output Tools (2 tools)
gemini_structured- Get structured JSON outputgemini_extract- Extract structured data from text
Token Tools (1 tool)
gemini_count_tokens- Count tokens in content
Code Execution Tools (1 tool)
gemini_run_code- Execute Python code via Gemini
Total: 39 tools
Installation
With uvx (Recommended)
With pip
With Container
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.
Configuration
Creating a Google Gemini API Key
-
Navigate to Google AI Studio
- Go to https://aistudio.google.com/apikey
- Sign in with your Google account
-
Create API Key
- Click "Get API key" or "Create API key"
- Select a Google Cloud project or create a new one
- Click "Create API key in new project" (or select existing project)
-
Copy Your API Key
- IMPORTANT: Copy the API key immediately - store it securely!
- The key starts with
AI...(e.g.,AIzaSy...)
Add to Claude Code
Or for the container version:
Optional: Set Output Directory (non-container)
For generated images, audio, and videos when running without a container:
Usage Examples
Query with Google Search
Generate an Image
Analyze a PDF Document
Summarize a YouTube Video
Deep Research
Code Analysis
Security
This server was designed with security as a primary concern. See SECURITY.md for:
- Threat model and attack vectors
- Defense in depth architecture
- API key handling best practices
- Input validation rules
- Audit logging
Key Security Features
-
API Key Protection
- Stored as SecretStr (never accidentally logged)
- Environment variable only (never in files or args)
- Sanitized from all error messages
-
Input Validation
- Pydantic models for all inputs
- File path validation
- URL validation
- Strict format validation
-
API Hardening
- Hardcoded API base URL (prevents SSRF)
- TLS certificate validation
- Request timeouts
- Response size limits
-
Automated CVE Scanning
- GitHub Actions scan dependencies weekly
- Automatic PRs for security updates
- Dependabot alerts enabled
Development
Setup
Run Tests
Lint and Type Check
Build Container
License
AGPL-3.0-or-later
Contributing
Contributions welcome! Please read SECURITY.md before submitting security-related changes.
Links
來源:README.md,提交 d75d79a
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分