Skip to main content

mcp-image-tools

Version 8.0 — completely rewritten and revised.

Image tools for AI assistants: look at a picture, describe it, scale it, convert it, write one. Usable as a Python library or served over the Model Context Protocol.

  • A picture arrives as a picture. read and resize answer with an image content block, not with a path or a base64 string.
  • Large pictures are scaled down before they are handed out, to a longest edge of 1024 pixels unless the server or a call sets another limit.
  • Server over stdio or streamable HTTP with the MCP SDK, protocol revision 2026-07-28, OAuth for HTTP.

Installation

Python 3.12 or later.

pip install mcp-image-tools            # the library
pip install "mcp-image-tools[server]"  # and the MCP server

Quick start

A client that starts the server itself, over stdio:

{
  "mcpServers": {
    "images": {
      "command": "mcp-image-tools",
      "args": ["--working-dir", "/home/you/pictures"]
    }
  }
}

Over HTTP, with OAuth:

MCP_OAUTH_ENABLED=true \
MCP_OAUTH_SERVER_URL=https://auth.example.org/ \
MCP_PUBLIC_URL=https://mcp.example.org/ \
mcp-image-tools --transport streamable-http --host 0.0.0.0 --port 12205 --path /images

As a library:

from pathlib import Path

from mcp_image_tools import Workspace, pictures

space = Workspace(working_dir=Path.cwd(), max_edge=800)
shown = pictures.read(space, "screenshot.png")
print(shown.image_format, shown.width, shown.height)

Tools

Tool What it does
read Open a picture and return it as a picture, scaled to the limit
facts Format, width, height, colour mode, transparency and file size, without showing it
resize Return a picture scaled to a given longest edge
convert Write a picture in another format: PNG, JPEG, WebP, GIF, BMP
write Write a picture from base64 data

convert and write refuse data that is not a picture before anything is written. Transparency is laid on white where the target format cannot carry it.

Server options

Option Default Meaning
--transport stdio stdio or streamable-http
--host MCP_HOST, else 127.0.0.1 address to bind (HTTP)
--port MCP_PORT, else 8000 port to bind (HTTP)
--path /mcp path the endpoint answers on (HTTP)
--working-dir current directory where relative paths start
--max-edge 1024 longest edge a picture is scaled to

Authentication over HTTP is configured with MCP_OAUTH_ENABLED, MCP_OAUTH_SERVER_URL, MCP_PUBLIC_URL and MCP_AUTH_METHOD; the server refuses to listen beyond this machine without it.

Development

Setup, checks, release steps and the rules the code keeps: doc/development.md. Changes are listed in CHANGES.md.

License

MIT, see LICENSE.

Metadata

Release files for mcp-image-tools 8.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-image-tools 8.0.0
File Size Uploaded Provenance
mcp_image_tools-8.0.0.tar.gz 32.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-image-tools 8.0.0
File Interpreter ABI Platform
mcp_image_tools-8.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.1 kB

Release files / mcp_image_tools-8.0.0.tar.gz

Download URL mcp_image_tools-8.0.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
72403e977d3748073de8f86d29dcc1d41b648edd16ba16bc881541814765d98f
BLAKE2b-256 checksum
How to use checksums
af98774e6a4ff29cfa594c11dba44c59ec71f7d4ab20de6fefc65c6cfe83773a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / mcp_image_tools-8.0.0-py3-none-any.whl

Download URL mcp_image_tools-8.0.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c09b7d5688ae40ca29313cacf81a57d7755a1697cfb38eb48371003833d7f4c0
BLAKE2b-256 checksum
How to use checksums
829433d275f44832f9a42d93fc2dc667e6a7694903f16ac412892e95456abfc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for mcp-image-tools 8.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

8.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page