picture-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
picture-mcp: The Hard Way
Build an MCP server that does everyday image jobs for an AI agent: look at a photo, shrink it to a size budget, strip the GPS before it is posted, and return a thumbnail so the agent can see what it just made. Pillow and nothing else. Every line explained, every claim checked by running real code on real images.
At the end you will have built a minimal version of picture-mcp yourself, and you will know the parts most image tutorials skip: the arithmetic of resizing, why alpha breaks JPEG conversion, how to search for a file size, what EXIF really contains and how to remove it without re-encoding, and how to let an agent near a filesystem safely.
Who This Is For
Developers who built a "hello world" MCP server and want one that touches real files
Anyone who has been bitten by a sideways photo, a black-background JPEG or a leaked GPS tag
People who want to know what happens between "make it 200 KB" and the bytes on disk
Prerequisites: Python 3.10+. pip install -r requirements.txt (that is mcp and
Pillow; no system packages, no ImageMagick, no ffmpeg).
Related MCP server: mcp-image-tools
Modules
# | Module | What You'll Build |
01 | Lazy open vs decode, modes, why the file name lies, and a describe function that detects truncation | |
02 | fit, fill, exact and percent as pure arithmetic, never upscaling by accident, tested by table | |
03 | Flattening transparency onto a colour, keeping animations, palette and CMYK inputs, honest notes | |
04 | A binary search on JPEG quality that hits "under 200 KB", and what to do when it cannot | |
05 | Writing and reading GPS, orientation, and a lossless JPEG stripper with a self-check | |
06 | A directory sandbox that survives | |
07 | A one-file MCP server with image previews, driven over real stdio by a test client |
Each module contains:
README.md: the concepts and the design decisionsmain.py: a working, commented implementation that checks itself withassertbreak-it.md: challenges that break your own code, with hints
How To Use This Course
Option A: Build along. Read the modules in order, run each main.py, then do the
break-it challenges.
Option B: Reference. Each main.py stands alone, with no imports between modules.
Option C: Use the finished tool. uvx picture-mcp is the full version of what
Module 07 assembles.
Run It
pip install -r requirements.txt
python verify.py # runs every module's main.py; each must exit 0
python verify.py 04 06 # just these
cd 07-mcp-wrapper-and-testing && python server.py --dir ~/Pictures # the server itselfverify.py is what CI runs on Linux, macOS and Windows. The modules create their own test
images (gradients, transparent logos, animated GIFs, EXIF with GPS) in a temp directory, so
there are no fixtures to download.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Image processing for AI agents: resize, convert, compress, crop, and web-ready AI-generated images.
Resize, convert, compress, crop and thumbnail images, and strip EXIF and GPS metadata.
Image and PDF toolkit: convert to AVIF/WebP/JXL, resize, crop, remove backgrounds, optimize PDFs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with tools to convert images between formats and inspect image metadata, enabling seamless image processing within agent workflows.24 npm3MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform image processing tasks such as sprite sheet splitting, resizing, cropping, and batch operations on local images.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to perform local image operations such as circle cropping, cropping, resizing, compressing, converting, and inspecting images without uploading files or making network calls.786 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to compress photos on the local machine to an exact target size in B, KB, or MB, with tools for batch compression, pre-flight feasibility estimation, image info lookup, and format listing, all returning structured JSON statuses.2MIT