Server data from the Official MCP Registry
Convert, resize, crop, filter & composite images via the imgcli CLI (lightweight, no deps)
Convert, resize, crop, filter & composite images via the imgcli CLI (lightweight, no deps)
This is a well-designed MCP server wrapping the imgcli command-line tool. The code uses safe subprocess execution (execFile with argv array, no shell), implements proper input validation via Zod schemas, and has no authentication requirements appropriate for a local tool. Minor code quality observations (broad exception handling, lack of input path validation) do not significantly detract from a fundamentally secure implementation. Supply chain analysis found 3 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.
3 files analyzed · 7 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: IMGCLI_BIN
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-swperb-imgcli": {
"env": {
"IMGCLI_BIN": "your-imgcli-bin-here"
},
"args": [
"-y",
"imgcli-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
A dependency-free CLI to convert, resize, crop, filter, and composite images — PNG, JPEG, BMP, TGA, GIF, and PPM — driven by an ffmpeg-style filtergraph. One small C binary, no system libraries, compiles anywhere a C11 compiler exists.
If you're looking for a lightweight image converter / image processing library for the command line — a tiny alternative to ImageMagick
convertorffmpegfor still images — this is it.
# Convert + resize + filter in one pass:
imgcli -i photo.jpg -vf "scale=1024:-1,grayscale,contrast=1.2,gblur=1.5" out.png
What it does: format conversion · resize / scale · crop · pad · rotate · flip · brightness / contrast / saturation / gamma / hue · grayscale · sepia · invert · threshold · box & Gaussian blur · sharpen · Sobel edge detect · emboss · custom convolution kernels · alpha-composite overlay · draw boxes · solid fills.
Design: the same paradigm as ffmpeg — decode → normalize to one common frame format (RGBA) → run a comma-separated filtergraph → encode by output extension.
| ffmpeg concept | imgcli equivalent |
|---|---|
AVFrame / pixfmt | every image is normalized to packed 8-bit RGBA (Image) |
| demuxer/decoder | img_load via vendored stb_image (PNG/JPEG/BMP/TGA/GIF/…) |
-vf filtergraph | name=a:b:c, name, … chain parsed in filters.c |
AVFilter | each filter mutates or replaces the current frame |
| muxer (by extension) | img_save (png/jpg/bmp/tga + a hand-written PPM writer) |
lavfi test sources | testsrc=, color=, gradient=, checker= generators |
Codecs come from the public-domain stb
single-header libraries (third_party/). They're bundled, not linked, so the
tool stays portable and self-contained while still reading/writing the formats
the world actually uses — the same trade-off ffmpeg makes by leaning on codec
libraries instead of reinventing them.
# Homebrew (macOS / Linux)
brew install swperb/tap/imgcli
# Prebuilt binaries: https://github.com/swperb/imgcli/releases
# From source (only a C compiler and -lm required)
make # produces ./imgcli
make demo # generates a few sample images
sudo make install # installs to /usr/local/bin
An MCP server wraps imgcli so AI agents can
call convert_image, probe_image, and list_filters directly — see
mcp/.
imgcli [-i INPUT]... [-vf GRAPH] [-q N] [-y|-n] [--json] [--quiet] OUTPUT
-i INPUT a file, or a generator (testsrc=WxH, color=NAME:WxH,
gradient=WxH, checker=WxH). Repeat -i for compositing inputs;
the first is the primary frame, the rest feed `overlay`.
-vf GRAPH filtergraph, e.g. "scale=800:-1,grayscale,gblur=2"
-q N JPEG quality 1..100 (default 90)
-y / -n overwrite / never overwrite the output
--json emit one machine-readable JSON result line (for scripts/agents)
--quiet suppress the human-readable success line
-filters list every filter
-info print input dimensions and exit
-V print version
-h help
Colours accept #rgb, #rrggbb, #rrggbbaa, 0x…, r-g-b[-a], or names
(red, white, transparent, …). No commas, so they're safe inside a graph.
Geometry — scale=W:H[:nearest|bilinear] (-1 keeps aspect),
crop=W:H[:X:Y], pad=W:H[:X:Y[:color]], hflip, vflip,
transpose=90|180|270, rotate=DEG[:color] (arbitrary angle, canvas expands).
Colour — grayscale, invert, sepia, brightness=V, contrast=V,
saturation=V, gamma=V, hue=DEG, threshold=V, opacity=V, tint=color.
Convolution — blur=R (box), gblur=SIGMA (separable Gaussian),
sharpen[=AMOUNT], edge (Sobel), emboss, convolution=K[:DIV:BIAS]
(custom N×N kernel, e.g. convolution=0 -1 0 -1 5 -1 0 -1 0).
Composite / draw — overlay=X:Y[:INDEX] (alpha "over" compositing of
another -i input), fill=color, drawbox=X:Y:W:H:color[:fill|thickness].
# Thumbnail, preserving aspect ratio
imgcli -i photo.jpg -vf "scale=400:-1" thumb.png
# Stylise: desaturate a touch, boost contrast, soften
imgcli -i photo.jpg -vf "saturation=0.6,contrast=1.15,gblur=1" look.jpg
# Watermark a logo in the top-left, 60% opacity, then convert to JPEG
imgcli -i page.png -i logo.png -vf "opacity=0.6,overlay=24:24" out.jpg
# Rotate 30° onto a transparent canvas
imgcli -i sticker.png -vf "rotate=30:transparent" rotated.png
# No input file? Generate a test card.
imgcli -i testsrc=640x480 card.png
imgcli is built to be a reliable tool in an automated pipeline: one self-contained binary, no dependencies, deterministic, non-interactive, and machine-readable. See AGENTS.md for a token-economical recipe sheet.
# Always pass -y (don't prompt) and --json (parseable result) in automation:
imgcli --json -y -i in.jpg -vf "scale=512:-1" out.png
# -> {"ok":true,"output":"out.png","width":512,"height":341,"format":"png","bytes":34122}
-y; one process per conversion.--json for results, --quiet to silence chatter;
stable exit codes (0 ok, 1 runtime error, 2 usage error).imgcli --json -info -i file.jpg.imgcli decodes untrusted image files in C, so memory safety is taken seriously. The codebase has been audited against the OWASP Top 10, common C/CWE classes, and ffmpeg's historical vulnerability classes. Highlights:
_FORTIFY_SOURCE, stack protector, PIE/RELRO, format
warnings), ASan/UBSan (make asan), and a fuzz harness (make fuzz).Full threat model, OWASP/CWE mapping, ffmpeg-CVE-class analysis, and dependency policy: SECURITY.md.
src/image.{h,c} Image (RGBA frame) + load/save (stb glue, PPM writer)
src/filters.{h,c} filtergraph parser + every filter + registry
src/source.{h,c} synthetic input generators
src/util.{h,c} colour / size parsing
src/main.c CLI argument handling (incl. --json output)
third_party/ vendored stb_image.h, stb_image_write.h (public domain)
fuzz/ libFuzzer harness for the decode -> filtergraph path
AGENTS.md token-economical usage guide for agents/scripts
SECURITY.md threat model, OWASP/CWE mapping, hardening, dependency policy
The imgcli source is yours to use freely. The vendored stb headers are public domain (see their headers).
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.