MCP Image Server
Use this MCP server to let an AI assistant fetch, load, and inspect images from URLs or local files and return them in an LLM-displayable form.
Calls the read-only
fetch_imagestool with a list of image sources (one item for a single image).Fetches HTTP(S) URLs, following redirects, and local paths including
~/...andfile://URIs.Detects real image format, so wrong extensions and
application/octet-streamresponses can still work.Reads JPEG, PNG, GIF, WebP, BMP, TIFF, ICO, PPM, TGA and AVIF; returns small JPEG/PNG/GIF/WebP as-is and converts other supported formats to PNG/JPEG. Refuses unsafe/unsupported formats such as EPS.
Downscales to 1568px on the long edge and recompresses to share a ~700KB budget per call (~930KB base64), aiming under the ~1MB tool-result limit.
Preserves transparency where possible, applies EXIF rotation, and handles palette, 1-bit and 16-bit images.
Optionally renders SVG icons with Cairo, with isolation/size/time/memory limits.
Processes up to 20 sources in parallel and returns one entry per source in order, with per-source error text on failure.
Enforces limits: 50MB per file/download, 30s download, 40MP decoded image, and SVG-specific constraints.
Supports configuration via environment variables and deployment via stdio, uv/uvx, or Docker.
Referenced in example URLs for image fetching, demonstrating compatibility with Brave search image results.
Provides a donation link to support the developers through the Buy Me A Coffee platform.
Integrates with Windsurf (a Codeium component) through configuration in the Windsurf mcp_config.json file.
Supports processing images from numpy arrays, allowing direct integration with numpy-based image processing workflows.
Built on Python 3.10+ with support for virtual environments and package management through uv.
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., "@MCP Image Serverfetch these images: https://example.com/photo1.jpg, C:\Users\me\Pictures\vacation.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.
MCP Server - Image
A Model Context Protocol (MCP) server that lets an AI assistant look at images. Its fetch_images tool loads images from URLs or local file paths and returns them in a form LLM clients can display, downscaling and recompressing them when needed so they fit client limits.
Support Us
If you find this project helpful and would like to support future projects, consider buying us a coffee! Your support helps us continue building innovative AI solutions.
Your contributions go a long way in fueling our passion for creating intelligent and user-friendly applications.
Related MCP server: Image Toolkit MCP Server
Table of Contents
Features
Fetch images from
http(s)URLs (redirects followed) and local paths, including~/...andfile://URIsDetects the real format from the file contents, so wrong extensions and
application/octet-streamresponses (e.g. Telegram's file API) still workReads JPEG, PNG, GIF, WebP, BMP, TIFF, ICO, PPM, TGA and AVIF; returns JPEG, PNG, GIF and WebP as-is when they are small enough and converts the rest to PNG or JPEG. Other formats are refused (EPS, for instance, would run Ghostscript)
Downscales to 1568px on the longer edge; all images in one call share a ~700 KB budget (about 930 KB once base64-encoded), under the ~1 MB tool-result limit Claude Desktop is reported to enforce
Keeps transparency (PNG) when possible, applies EXIF rotation, and converts palette, 1-bit and 16-bit images without losing their tones
Optional SVG support: small icons are rendered large enough to read, and an SVG cannot pull in other local files or URLs
Processes up to 20 sources per call in parallel; a failed source returns a message saying why, in its position in the list
Prerequisites
Python 3.11+
uv (recommended)
For SVG support only: the native Cairo library
Debian/Ubuntu:
sudo apt install libcairo2macOS:
brew install cairo(on Apple Silicon, also setDYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/libfor the server)Windows: install the GTK3 runtime. Its default folder (
C:\Program Files\GTK3-Runtime Win64\bin) is found automatically; for another location, or another app that bundleslibcairo-2.dll, setCAIROCFFI_DLL_DIRECTORIESto that folder
Installation
git clone https://github.com/IA-Programming/mcp-images.git
cd mcp-images
uv sync # core
uv sync --extra svg # or: with SVG supportRunning the Server
The server speaks MCP over stdio, so normally your MCP client starts it (see below). To run it by hand:
uv run mcp-imageWithout cloning, straight from GitHub:
uvx --from git+https://github.com/IA-Programming/mcp-images mcp-imageWith SVG support:
uvx --from "mcp-image[svg] @ git+https://github.com/IA-Programming/mcp-images" mcp-imageWith Docker (SVG support included):
docker build -t mcp-image .
docker run -i --rm -v "$HOME/Pictures:/images:ro" mcp-imageInside the container, local paths refer to the mounted folder, e.g. /images/photo.jpg.
The tool can read any file the server process can read and fetch any URL it can reach, including hosts on your local network. Running it in Docker with read-only mounts limits it to the folders you choose.
Client Configuration
Replace /path/to/mcp-images with where you cloned the repository. Drop "--extra", "svg" if you did not install Cairo.
Claude Code
This repository ships a .mcp.json, so Claude Code sessions opened in it pick the server up automatically. To add it to another project:
claude mcp add image -- uv run --directory /path/to/mcp-images --extra svg mcp-imageClaude Desktop, Cursor, Windsurf
Add to claude_desktop_config.json, Cursor's Settings → MCP, or ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"image": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-images", "--extra", "svg", "mcp-image"]
}
}
}VS Code
Add to your user or workspace mcp.json:
{
"servers": {
"image": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-images", "--extra", "svg", "mcp-image"]
}
}
}Available Tools
fetch_images (read-only): fetch images from URLs or local file paths.
Parameters:
image_sources(required): list of URLs or file paths. For one image, pass a one-element list.
Returns one entry per source, in the same order: the image, or a text message explaining why that source failed (for example Error processing /tmp/a.png: file not found: /tmp/a.png).
Limits per call: 20 sources, 50 MB per file or download, 30 seconds per download, and 40 megapixels per decoded image (large JPEGs are decoded at a reduced scale, so camera photos are fine). SVGs are rendered in a separate process and must declare at most 40 megapixels, be at most 10 MB (after decompressing gzip), and render within 10 seconds; they can only embed PNG, JPEG, GIF, WebP or BMP images as data: URLs. On Linux the renderer is also limited to 1.5 GB of memory, and on Linux and macOS to 15 seconds of CPU time even if the server exits mid-render. Windows has neither limit: there the 10-second timeout only applies while the server is running, so a renderer can outlive a server that is killed mid-render.
Usage Examples
"Fetch these images: [list of URLs or file paths]"
"Look at ~/Desktop/screenshot.png and tell me what's wrong with the layout"
[
"https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Chocolate_%28blue_background%29.jpg/330px-Chocolate_%28blue_background%29.jpg",
"https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg",
"C:\\Users\\username\\Pictures\\image1.jpg",
"~/Pictures/image2.png"
]Configuration
Optional environment variables:
Variable | Default | Description |
|
| Longest edge, in pixels, of returned images |
|
| Size budget shared by all images in one call, before base64 encoding |
|
| Level of the logs written to stderr ( |
| unset | Folder for a detailed debug log file; no file is written when unset |
| GTK3 runtime folder, if installed | Windows only, read by cairocffi: folders (separated by |
Testing and Debugging
Run the test suite:
uv sync --all-extras
uv run pytestTry the tool interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector uv run mcp-imageOr from the command line:
npx @modelcontextprotocol/inspector --cli uv run mcp-image --method tools/call --tool-name fetch_images --tool-arg 'image_sources=["/path/to/image.png"]'Or with the bundled stdio smoke test, which exits non-zero unless every source comes back as an image:
uv run python tests/stdio_smoke.py /path/to/image.png -- uv run mcp-imageLogs:
stderr shows one line per processed source and a summary per call; most clients show this in their MCP server logs.
With
MCP_IMAGE_LOG_DIRset, a detailed debug log (formats, sizes, compression steps) is also written there, in a file named after the date the server started.URLs are logged without credentials, query strings or Telegram bot tokens.
Contributing
Contributions are welcome! Please run uv run pytest before submitting a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
1 toolfetch_imagesA
Fetch and process images from URLs or local file paths, returning them in a format suitable for LLMs.
This tool accepts a list of image sources which can be either:
1. URLs pointing to web-hosted images (http:// or https://)
2. Local file paths pointing to images stored on the local filesystem (e.g., "C:/images/photo1.jpg")
For a single image, provide a one-element list. The function will process images in parallel
when multiple sources are provided. Images that exceed the size limit (1MB) will be automatically
compressed while maintaining aspect ratio and reasonable quality.
Args:
image_sources: A list of image URLs or local file paths. For a single image, provide a one-element list.
Returns:
A list of Image objects or None values (if processing failed) in the same order as the input sources.
| Name | Required | Description | Default |
|---|---|---|---|
| image_sources | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and discloses key behavioral traits: parallel processing for multiple images, automatic compression for images over 1MB with aspect ratio and quality preservation, and failure handling (returns None for failed processing). It doesn't cover aspects like rate limits or authentication needs, but provides substantial operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with the core purpose, followed by detailed input specifications, processing behavior, and return values. Every sentence adds value without redundancy, and it's appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is largely complete: it covers purpose, input semantics, processing behavior, and return format. However, it lacks details on the 'Image objects' structure (e.g., format, metadata) and any error specifics, which would enhance completeness for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, so the description must compensate fully. It clearly explains the single parameter 'image_sources' as a list of URLs or file paths, specifies format examples (http/https URLs, local paths like 'C:/images/photo1.jpg'), and clarifies handling for single images (one-element list). This adds comprehensive meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('fetch and process images') and resources ('from URLs or local file paths'), and distinguishes its output format ('suitable for LLMs'). With no sibling tools, it fully defines its scope without redundancy.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by specifying input types (URLs or file paths) and handling of single vs. multiple images, but lacks explicit guidance on when to use this tool versus alternatives (e.g., other image tools or direct file handling). With no siblings, this is less critical but still a gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
fetch_images
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'fetch_images' has a clearly defined and distinct purpose that cannot be confused with any other tool in this server.
The single tool name 'fetch_images' follows a clear verb_noun pattern, and with only one tool, there is perfect consistency. No naming conventions can conflict when only one tool exists.
A single tool is generally too few for most server purposes, creating a thin surface that limits functionality. While this tool handles image fetching and processing well, the server's scope as an 'Image Server' suggests potential gaps that would require additional tools for comprehensive image operations.
For an 'Image Server' domain, having only a fetch/processing tool leaves significant gaps. There are no tools for image manipulation (resize, crop, filter), analysis (object detection, metadata extraction), or management (list, delete, organize images), making the surface severely incomplete for typical image-related workflows.
Maintenance
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
MCP server exposing the YourImageShare upload API (upload/list/delete) as tools for AI agents.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityDmaintenanceModel Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.1910 npm41MIT
- AlicenseNot gradedqualityFmaintenanceA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.18MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that extracts images from URLs or base64 data and converts them into a format suitable for LLM analysis, allowing AI models to process and understand visual content.3633 npm21MIT
- FlicenseAqualityFmaintenanceA Model Context Protocol server that enables Claude to display and interact with images from the local filesystem, allowing users to view images directly in conversations and retrieve image metadata.35-