
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 分