gemini-image-mcp
Use Gemini vision to analyze images and return text answers without loading raw image bytes into the calling agent’s context.
Analyze a local image file by absolute path or an HTTP(S) image URL.
Ask an optional prompt/question about the image; default behavior is a detailed description.
Override the Gemini model per call.
Read screenshots, diagrams, charts, and UI states via returned text.
The provided schema exposes only single-image analysis; README also documents multi-image comparison and thinking/media-resolution options not present in this schema.
Analyzes images using Google's Gemini vision models, enabling AI agents to understand visual content via text prompts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gemini-image-mcp Describe this UI mockup: /designs/mockup.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gemini-image-mcp
A tiny MCP server that analyzes images with Google's
Gemini vision models. It exposes one tool, analyze_image, that takes a local image path
(or URL) plus an optional prompt and returns Gemini's text answer.
Why: it lets an agent (e.g. Claude Code) read screenshots, diagrams, charts, or UI states by reference — the raw image bytes go to Gemini, and only the text answer comes back, so they never bloat the calling agent's context window.
It talks straight to the Gemini REST API (generativelanguage.googleapis.com) with fetch —
no Google SDK, no gemini-cli, nothing tied to the deprecated consumer CLI.
Setup
npm install
npm run build
cp .env.example .env # then put your key in .envGet an API key at https://aistudio.google.com/apikey.
Configuration
Set via .env (loaded automatically from the repo root) or ambient environment:
Variable | Required | Default | Notes |
| yes | — | Your AI Studio key. Never commit it. |
| no |
| Cheap and fast. Use |
| no | model default | Default |
| no | model default | Default |
| no | off | Set to |
A per-call tool argument overrides the matching env default. An invalid env value is an error rather than being silently ignored.
The key is sent as an x-goog-api-key header (kept out of URLs/logs) and is never written
to a tracked file — .env is gitignored.
Related MCP server: VisionPower
Use with Claude Code
claude mcp add gemini-image -- node /absolute/path/to/gemini-image-mcp/dist/index.jsThe server loads its own .env, so no key needs to live in Claude's config. Restart Claude
Code, then it can call analyze_image with an image path and an optional prompt.
Tool: analyze_image
Argument | Type | Required | Description |
| string | string[] | yes | A single local file path or |
| string | no | What to ask. Defaults to a detailed description (one image) or a comparison (several). |
| string | no | Per-call model override. |
|
| no | How much the model reasons before answering. Omit for the model's default. |
|
| no | How finely images are tokenized. Omit for the model's default. |
Pass several images to compare them (before/after, spot-the-difference, "do these match"). Each is
labelled Image 1, Image 2, … in order, so the prompt can refer to them. All images ride in a single
Gemini request.
Accuracy vs cost
The defaults are tuned for quick, cheap descriptions and lose accuracy on thin lines, small text
and fine spatial detail. For those, pass media_resolution: "high" and thinking: "high", and
consider model: "gemini-4-argon". On a 124-question test of reading thin road markings from
top-down images, gemini-pro-latest with defaults scored 75%; gemini-4-argon with both set
to high scored 93%.
thinking maps to generationConfig.thinkingConfig.thinkingLevel, which needs a Gemini 3 or
later model; supported levels vary by model (for example, gemini-4-argon accepts low,
medium and high but not minimal), and an unsupported one returns the API's error.
media_resolution maps to generationConfig.mediaResolution (MEDIA_RESOLUTION_*). Thought
parts are never included in the returned answer.
Supported inputs: PNG, JPEG, WebP, GIF, BMP, HEIC/HEIF, and PDF.
Smoke test
Verify the key + API + image path end to end, without the MCP layer. The prompt comes
first (pass "" for the default), then one or more images:
npm run smoke -- "What does this image say?" ./test/sample.png
npm run smoke -- "What changed between these?" ./before.png ./after.png
npm run smoke -- --model gemini-4-argon --thinking high --media-resolution high --usage "Read the text." ./test/sample.png--model, --thinking, --media-resolution and --usage mirror the tool arguments and
GEMINI_REPORT_USAGE.
License
MIT
Available Tools
1 toolanalyze_imageAnalyze image with GeminiA
Analyze a local image file (or image URL) with Google's Gemini vision models and return a text answer. Use this to read screenshots, diagrams, charts, or UI states without loading raw image bytes into the calling agent's context.
Inputs: image (required), prompt, model.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap with other tools.
The single tool name 'analyze_image' follows a clear verb_noun pattern and is self-consistent.
A single tool is too few for the apparent scope of image analysis; users would likely expect additional tools for model selection or listing capabilities.
The tool surface is severely limited, lacking any supporting tools such as model listing or status checks, leaving obvious gaps in functionality.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
MCP server for Grok Imagine AI video generation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that analyzes images using OpenRouter's Gemini Flash model, supporting local file paths and URLs.33 npmMIT
- AlicenseAqualityBmaintenanceA portable image-understanding MCP server that lets agents analyze local images, URLs, or base64 images via an OpenAI-compatible vision model.175 npm68MIT
- FlicenseNot gradedqualityDmaintenanceMCP server using Google Gemini to read and describe image content, supporting single or multiple images and custom prompts.-
- AlicenseAqualityDmaintenanceMCP server that analyzes images, reads code and ZIP archives, and provides text context for non-vision models.314 npm2MIT