Permite que un cliente de IA convierta, cambie el tamaño, recorte y aplique filtros a imágenes utilizando un binario en C ligero y sin dependencias.
También conocido como swperb/imgcli, imgcli-mcp
- Stars
- 0
- Herramientas
- —
- Descargas, 30 días
- —
- Última versión
- 0.2.0
- Último commit
- 13 nov 2026
- Licencia
- MIT
¿Qué es imgcli MCP?
imgcli es un MCP server. Permite que un cliente de IA convierta, cambie el tamaño, recorte y aplique filtros a imágenes utilizando un binario en C ligero y sin dependencias.
Resumen generado a partir del README del proyecto
Acerca del MCP server de imgcli
Procesar imágenes a través de un cliente de IA es más eficiente con imgcli, una herramienta ligera diseñada para la conversión, el cambio de tamaño y el filtrado rápido. Funciona como un único binario en C sin dependencias que opera localmente en tu máquina, lo que lo hace ideal para pipelines automatizados donde la velocidad y un bajo consumo de recursos son críticos. Los agentes de IA pueden interactuar con él usando herramientas específicas como convert_image, probe_image y list_filters para manipular datos visuales sin necesidad de librerías de sistema pesadas.
Este servidor utiliza una sintaxis de filtergraph estilo ffmpeg para ejecutar tareas complejas en una sola pasada, como escalar, recortar o aplicar ajustes de color como escala de grises y sepia. Admite varios formatos, incluidos PNG, JPEG, BMP, TGA, GIF, PPM y QOI. Al ser un binario autónomo de 232 KB que solo se enlaza con libc, evita la sobrecarga y la complejidad de kits de herramientas más grandes como ImageMagick, proporcionando una alternativa más rápida para tareas como la generación de miniaturas o la aplicación de marcas de agua en imágenes.
Qué puedes hacer con él
- 1Generación de miniaturas por lotesUn agente de IA puede cambiar el tamaño de una carpeta completa de imágenes para convertirlas en miniaturas pequeñas usando un solo comando.
- 2Aplicar filtros visuales complejosPuedes instruir a una IA para estilizar una imagen combinando múltiples efectos como saturación, contraste y desenfoque.
- 3Marcas de agua automáticas en imágenesLos desarrolladores pueden usar la herramienta para superponer un logo sobre una imagen principal con configuraciones de opacidad específicas.
Escrito a partir del README del proyecto. Cada caso de uso se verifica con una cita del mismo.
Cómo instalar imgcli MCP
Formatos verificados el 10 nov 2026Añadir a CursorAñadir a GooseInstalar imgcli MCP en Claude Code
$ claude mcp add imgcli -- npx -y imgcli-mcpInstalar imgcli MCP en Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"imgcli": {
"command": "npx",
"args": [
"-y",
"imgcli-mcp"
]
}
}
}Instalar imgcli MCP en VS Code
.vscode/mcp.json
{
"servers": {
"imgcli": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"imgcli-mcp"
]
}
}
}Instalar imgcli MCP en VS Code CLI
$ code --add-mcp '{"name":"imgcli","type":"stdio","command":"npx","args":["-y","imgcli-mcp"]}'Instalar imgcli MCP en Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"imgcli": {
"command": "npx",
"args": [
"-y",
"imgcli-mcp"
]
}
}
}Instalar imgcli MCP en Codex
$ codex mcp add imgcli -- npx -y imgcli-mcpInstalar imgcli MCP en Codex config.toml
~/.codex/config.toml
[mcp_servers.imgcli] command = "npx" args = ["-y", "imgcli-mcp"]
Instalar imgcli MCP en Gemini CLI
$ gemini mcp add -s user imgcli npx -- -y imgcli-mcpInstalar imgcli MCP en Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"imgcli": {
"command": "npx",
"args": [
"-y",
"imgcli-mcp"
]
}
}
}Configuración
IMGCLI_BINPath to the imgcli binary if not on PATH (e.g. after `brew install swperb/tap/imgcli`).
| Nombre | Descripción | Tipo |
|---|---|---|
| IMGCLI_BIN | Path to the imgcli binary if not on PATH (e.g. after `brew install swperb/tap/imgcli`). |
Verificaciones automáticas
Ejecutado 14 nov 2026Informe completo →Pasó nuestras verificaciones automáticas. Esto no es una auditoría de seguridad: lee el código y dale al servidor el acceso más limitado que necesite. Cómo funcionan las verificaciones
- Repositorio de origen vinculado y accesibleswperb/imgcli is public and reachablegithub.com/swperb/imgcli ↗Aprobado
- El paquete indica este repositorio como su origenimgcli-mcp names swperb/imgcli as sourcenpmjs.com/package/imgcli-mcp ↗Aprobado
- Procedencia de la compilación (atestación de Sigstore)No build attestation published for this releaseNo verificado
- Licencia de código abierto (OSI)MITspdx.org/licenses/MIT.html ↗Aprobado
- Commit o lanzamiento en el último añoLast commit or release 2026-11-02github.com/swperb/imgcli ↗Aprobado
- OpenSSF ScorecardOpenSSF Scorecard 7.9 / 10; weakest: CII-Best-Practices 0, Signed-Releases 0, Code-Review 2scorecard.dev/viewer/?uri=github.com/swperb/imgcli ↗Aprobado
- El nombre del paquete no es similar a un paquete popularNo popular package one edit away from imgcli-mcpAprobado
- No hay avisos críticos en el paquete ni en sus dependencias99 resolved dependencies checked; no critical advisoryosv.dev ↗Aprobado
- Sin instrucciones ocultas para el modelo0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersAprobado
- Las herramientas destructivas están etiquetadasNo verificado
- El endpoint remoto responde al handshake de MCPNo verificado
README
Ver en GitHubimgcli — command-line image conversion & processing in C
ImageMagick's power, ffmpeg's syntax, zero dependencies. A tiny C binary that converts, resizes, crops, filters, and composites images — PNG, JPEG, BMP, TGA, GIF, PPM, QOI — driven by an ffmpeg-style filtergraph. No system libraries; compiles anywhere a C11 compiler exists.
⚡ ~8× faster than ImageMagick on common resize/filter ops, in a 232 KB single binary (~470× smaller) — see the benchmarks. A lightweight alternative to ImageMagick
convertorffmpegfor still images.

# 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.
Benchmarks
imgcli vs ImageMagick on an Apple Silicon Mac (single-threaded, warm cache).
Reproduce with make && bench/bench.sh — see bench/RESULTS.md
for the full method and caveats.
| Operation | imgcli | ImageMagick | speedup |
|---|---|---|---|
| PNG→JPEG + resize (one-shot) | 1.6 ms | 4.7 ms | 2.9× |
| Resize 1200×1200 → 300w | 6.0 ms | 51.6 ms | 8.6× |
| Grayscale 1200×1200 | 48.4 ms | 389 ms | 8.0× |
| Footprint | imgcli | ImageMagick |
|---|---|---|
| Install size | 232 KB | ~109 MB (≈470× larger) |
| Dependencies | 0 (libc only) | 17 packages |
ImageMagick is a far broader 16-bit/HDRI toolkit with 200+ formats; imgcli is a lean 8-bit pipeline that wins on speed, size, and startup — the shape that matters when an agent or script spawns one process per task.
Dependencies & formats
The default build is dependency-free — a single binary that links only the
system C library (libc). Decoding/encoding is handled by the bundled,
public-domain stb and
qoi single-header libraries, compiled
directly in. Nothing to apt install, no shared libraries, no version hell.
- Built-in formats — no dependencies: PNG, JPEG, BMP, TGA, GIF, PPM, QOI. Other formats that can be implemented in plain C (e.g. TIFF) will also be built in and keep the binary dependency-free.
- Formats that need external libraries — opt-in only: WebP, AVIF, HEIC, and JPEG XL
cannot be decoded without large external libraries (libwebp, libavif, libheif, libjxl);
there is no public-domain single-header decoder for them and they are not
practical to hand-roll. If imgcli adds these, it will be strictly via opt-in
build flags (e.g.
make WEBP=1) that link those libraries.
The "zero dependencies" claim applies to the default build, and always will — opt-in format libraries are never compiled into it. A build that enables such a flag is, by definition, no longer dependency-free, and that trade-off is stated at the point you opt in.
Why it's structured this way
| 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.
Install
# Homebrew (macOS / Linux)
brew install swperb/tap/imgcli
# Nix (no install — run straight from GitHub)
nix run github:swperb/imgcli -- -y -i in.png out.jpg
nix profile install github:swperb/imgcli
# Debian / Ubuntu / WSL (.deb from the latest release)
curl -fsSLO https://github.com/swperb/imgcli/releases/latest/download/imgcli_0.5.0_amd64.deb
sudo apt install ./imgcli_0.5.0_amd64.deb
# Arch (AUR)
yay -S imgcli # or: paru -S imgcli
# Docker
docker run --rm -v "$PWD:/work" -w /work ghcr.io/swperb/imgcli -y -i in.png out.jpg
# Windows — winget
winget install swperb.imgcli
# Windows — Scoop (installs straight from the manifest)
scoop install https://raw.githubusercontent.com/swperb/imgcli/main/packaging/scoop/imgcli.json
# 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 the binary + man page to /usr/local
Use it as a native agent tool (MCP)
An MCP server wraps imgcli so AI agents can
call convert_image, probe_image, and list_filters directly — see
mcp/.
Usage
imgcli [-i INPUT]... [-vf GRAPH] [-q N] [-f FMT] [-y|-n] [--json] OUTPUT
-i INPUT a file, '-' for stdin, 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)
-f FMT output format (png/jpg/bmp/tga/ppm/qoi); required when OUTPUT
is '-' (stdout), an optional override for files
-y / -n overwrite / never overwrite the output
--out-dir D batch mode: write one output per input into D (basename kept,
extension from -f or the input). Globs in -i are expanded.
--fail-fast in batch mode, stop at the first failing file
--json emit one machine-readable JSON result line (an array in batch)
--quiet suppress the human-readable success line
--dry-run validate the filtergraph + report output dims; write nothing
-filters [NAME] list every filter, or just NAME's syntax (add --json for a
machine-readable list)
-info print input dimensions and exit
-V print version
-h help
OUTPUT is a file path or '-' for stdout. When piping, the result line is
written to stderr so stdout carries only the encoded image bytes.
Batch mode (`--out-dir`) processes each input independently and keeps going on
per-file errors (use `--fail-fast` to stop). The exit code is non-zero if any
file failed.
Colours accept #rgb, #rrggbb, #rrggbbaa, 0x…, r-g-b[-a], or names
(red, white, transparent, …). No commas, so they're safe inside a graph.
Filters
Geometry — scale=W:H[:nearest|bilinear|bicubic|lanczos] (-1 keeps aspect;
bicubic/lanczos are high-quality separable resamplers that anti-alias on
downscale and stay sharp on upscale — bilinear is the default),
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, solarize, brightness=V, temperature=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].
Examples
# Thumbnail, preserving aspect ratio (lanczos = best downscale quality)
imgcli -i photo.jpg -vf "scale=400:-1:lanczos" 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
# Pipe-friendly: read stdin, write stdout (use -f to name the output format)
curl -s https://example.com/in.png | imgcli -i - -vf "scale=800:-1" -f jpg - > out.jpg
# Batch a whole folder into thumbnails (one call; per-file results)
imgcli -i "photos/*.jpg" --out-dir thumbs -vf "scale=400:-1:lanczos" -f png
For AI agents & scripting
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}
- Deterministic & non-interactive — never prompts; refuses to overwrite
without
-y; one process per conversion. - Structured output —
--jsonfor results,--quietto silence chatter; stable exit codes (0ok,1runtime error,2usage error). - No network, no subprocesses — safe to run on untrusted inputs in a sandbox.
- Probe without converting —
imgcli --json -info -i file.jpg.
Security
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:
- Decompression-bomb safe — dimensions are validated from the header before pixels are decoded; hard caps on size (16384 px/axis, 64 Mpx).
- Integer-overflow-safe allocation through a single capped choke point.
- No protocols/URLs/subprocesses — ffmpeg's worst class (SSRF / file-read via HLS playlists) is structurally impossible here.
- Hardened build (
_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.
Layout
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
Contributing
Contributor setup, validation targets, filter-registry guidance, and PR expectations live in CONTRIBUTING.md.
Have a question or idea? Use Discussions. For bugs and feature/format requests, open an issue — the templates will guide you.
Support
If imgcli is useful to you, consider sponsoring its development — it funds new formats, security hardening, and maintenance. See SPONSORS.md.
License
The imgcli source is yours to use freely (MIT). The vendored stb
headers are public domain (or MIT, at your option) and the vendored qoi.h is
MIT-licensed; full third-party notices are in
THIRD_PARTY_NOTICES.md.
Preguntas sobre imgcli MCP
¿Cómo agrego imgcli MCP a Claude Code?
Ejecuta claude mcp add imgcli -- npx -y imgcli-mcp en tu terminal. Añade --scope user para que esté disponible en todos los proyectos.
¿Cómo agrego imgcli MCP a Cursor?
Abre ~/.cursor/mcp.json y añade el servidor en mcpServers, usando la configuración de Cursor que se muestra en la sección de instalación de arriba.
¿Qué formatos de imagen admite imgcli por defecto?
La compilación predeterminada admite PNG, JPEG, BMP, TGA, GIF, PPM y QOI sin dependencias externas.
¿Puedo usar imgcli en un pipeline automatizado o con un agente de IA?
Sí, está diseñado para la automatización con un flag --json para obtener resultados legibles por máquinas, un flag --quiet para suprimir mensajes innecesarios y es no interactivo.
¿Es seguro ejecutar imgcli con archivos de imagen no confiables?
Sí, incluye funciones de seguridad como protección contra bombas de descompresión, asignación segura contra desbordamiento de enteros y no tiene soporte para protocolos de red ni subprocesos.