Image Processor MCP server

Image Processor MCP server

image-processor-mcp•bypansuriyadhvanil

An MCP server offering tools for image downloading, compression, batch directory processing, filename synchronization, OCR text extraction, and configuration discovery.

License: MIT License•Runtime: Awaiting documentation review•Category: media design

WHAT IT DOES

  • •Downloads images from a URL or by keyword search via Pexels, optionally compressing or converting the result.
  • •Compresses or converts single images with configurable quality, dimensions, format, and recursive size targeting.
  • •Batch compresses all images in a directory recursively while preserving folder structure and generating reports and mappings.
  • •Extracts printed text from images using local OCR supporting many languages and output formats.

BEST FOR

  • •Preparing web assets by compressing and converting images to smaller formats.
  • •Batch processing image folders for projects while keeping the folder structure organized.
  • •Updating project files to reference renamed image files after compression.

ABOUT IMAGE-PROCESSOR-MCP

Image Processor MCP server is cataloged as an MCP server attributed to pansuriyadhvanil. An MCP server offering tools for image downloading, compression, batch directory processing, filename synchronization, OCR text extraction, and configuration discovery. It is categorized under media design. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Image Processor MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does text extraction require an API key or external service?

No; OCR runs entirely locally using tesseract.js with no API key required.

What happens to SVG files during batch compression?

SVG files are skipped during batch compression because sharp cannot safely compress vector images without breaking rendering.

Does OCR support handwritten text?

No, handwritten text is not supported.

Upstream README

View this exact version on GitHub

README.md · 53f4019b06b4 · Fetched 2026-11-13 11:27:08 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Image Processor MCP — Complete Documentation

Version: 0.2.3
Package: image-processor-mcp
Author: Dhvanil Pansuriya


Table of Contents

  1. Overview
  2. Installation & Configuration
  3. Tool: download_image
  4. Tool: compress_image
  5. Tool: compress_directory
  6. Tool: sync_filenames
  7. Tool: extract_text
  8. Tool: get_acknowledgement
  9. Configuration Defaults
  10. Supported Formats
  11. Credits & License

Overview

An MCP (Model Context Protocol) server that provides 6 tools for image downloading, compression, batch processing, filename synchronization, OCR text extraction, and configuration discovery.

Quick Start

npx -y image-processor-mcp

Key Features

  • Download images from URLs or search by keyword (Pexels integration)
  • Compress and convert single images with 10 output formats
  • Recursive compression to target file size
  • Lossless and lossy compression with configurable quality and CPU effort
  • Auto-resize oversized images
  • Batch process entire directories preserving folder structure
  • Filename and directory name normalization
  • Auto-generated markdown compression reports
  • Auto-generated filename mappings paired with reports
  • Scan project files and replace old filenames with new ones
  • OCR text extraction (100+ languages, runs 100% locally)

Installation & Configuration

Install from npm

npm install image-processor-mcp

Requirements

  • Node.js 18 or higher

MCP Configuration

Claude Desktop

{
  "mcpServers": {
    "image-processor-mcp": {
      "command": "npx",
      "args": ["-y", "image-processor-mcp"],
      "env": {
        "IMAGE_SEARCH_API_KEY": "your_pexels_api_key_here"
      }
    }
  }
}

VS Code (Cline / MCP extensions)

{
  "mcpServers": {
    "image-processor-mcp": {
      "command": "npx",
      "args": ["-y", "image-processor-mcp"],
      "env": {
        "IMAGE_SEARCH_API_KEY": "your_pexels_api_key_here"
      }
    }
  }
}

IMAGE_SEARCH_API_KEY is optional — only needed for keyword search in download_image. Get a free key at https://www.pexels.com/api/key/.


1. download_image

Downloads an image from a URL or searches by keyword. Optionally compress/convert the image.

Modes

ModeParameterDescription
URL modeurlDirect download from an image URL
Search modequeryKeyword search via Pexels

If both provided, search mode takes priority.

Parameters

ParameterTypeRequiredDefaultDescription
urlstringno*—Direct image URL
querystringno*—Search keyword
outputPathstringyes—Save path
outputFormatstringnooriginalwebp, avif, jpeg, png, tiff, gif
qualitynumberno851–100
losslessbooleannofalseLossless mode
effortnumberno6CPU effort 0–6
widthnumberno—Target width
heightnumberno—Target height
maxDimensionnumberno2000Auto-resize threshold
recursiveCompressbooleannofalseIterative size targeting
expectedSizeKBnumberno100Target KB
qualityStepDownnumberno10Per-iteration decrease
minimumQualityFloornumberno10Minimum quality

* One of url or query is required.

Data Flow

Request → type guard → Controller
  ├─ Search mode? → Pexels API → first hit URL
  └─ URL mode?    → use directly
  ↓
axios.get(url, arraybuffer, 30s timeout)
  ↓
Write to temp file → check compression params
  ├─ YES → ImageService.compressImage → clean temp → return result
  └─ NO  → move to final path → return success

Response Example (search + compression)

{
  "query": "mountain sunset",
  "imageId": 12345,
  "width": 1920,
  "height": 1080,
  "imageSize": 0,
  "user": "John Doe",
  "tags": "mountain sunset",
  "inputPath": "...",
  "outputPath": "./images/mountain.webp",
  "originalSize": 500000,
  "compressedSize": 80000,
  "compressionRatio": 84.00,
  "success": true,
  "iterations": 1,
  "qualitySteps": [85],
  "finalQuality": 85,
  "exceededTarget": false
}

Edge Cases

  • No url or query: Error — must provide one
  • Empty search results: Error — no images found
  • Missing API key: Error — IMAGE_SEARCH_API_KEY not set
  • Download timeout (30s): Error — timeout exceeded
  • Compression fails: Temp file cleaned up, error returned

2. compress_image

Compress or convert a single image with full control over quality, dimensions, format, and recursive compression.

Parameters

ParameterTypeRequiredDefaultDescription
inputPathstringyes—Source image path
outputPathstringyes—Destination path
outputFormatstringnowebpOutput format
qualitynumberno851–100
losslessbooleannofalseLossless mode
effortnumberno6CPU effort 0–6
widthnumberno—Target width
heightnumberno—Target height
maxDimensionnumberno2000Auto-resize threshold
recursiveCompressbooleannofalseIterative targeting
expectedSizeKBnumberno100Target KB
qualityStepDownnumberno10Per-iteration decrease
minimumQualityFloornumberno10Minimum quality

Core Compression Algorithm

1. Read original size + image metadata (sharp)
2. Compute resize:
   - Explicit w/h? → use those
   - Exceeds maxDimension? → scale proportionally
   - Otherwise → no resize
3. Loop:
   - sharp pipeline → apply format with quality
   - If input === output → buffer (safe in-place)
   - Else → write to file
   - If recursive + over target + above floor → reduce quality, loop
   - Else → break
4. Return CompressionResult

Format Conversion

FormatSharp Options
webp{quality, lossless, effort, smartSubsample, alphaQuality:90}
avif{quality, lossless, effort}
jpeg{quality, mozjpeg:true}
png{compressionLevel:9}
tiff{quality, compression:'lzw'}
gifgif() (no options)
otherFalls back to WebP

Response Example

{
  "inputPath": "./input/photo.jpg",
  "outputPath": "./output/photo.webp",
  "originalSize": 500000,
  "compressedSize": 80000,
  "compressionRatio": 84.00,
  "success": true,
  "iterations": 1,
  "qualitySteps": [85],
  "finalQuality": 85,
  "exceededTarget": false
}

Edge Cases

  • In-place compression (same path): Buffer-based to avoid corruption
  • Missing input file: success: false with error
  • Unknown format: Falls back to WebP
  • Recursion floor: Stops when quality can't decrease further
  • Abort: Returns partial result with success: false

3. compress_directory

Batch compress all images in a directory recursively, preserving folder structure. Generates report + mappings.

Parameters

ParameterTypeRequiredDefaultDescription
inputDirstringyes—Source directory
outputDirstringyes—Output directory
outputFormatstringnowebpOutput format
qualitynumberno851–100
losslessbooleannofalseLossless mode
effortnumberno6CPU effort 0–6
maxDimensionnumberno2000Auto-resize threshold
normalizeFilenamebooleannofalseClean filenames
filenameReplaceCharsstringno , -, ., &Replace chars
filenameCasestringnolowercaseCase conversion
normalizeDirnamebooleannofalseClean dir names
dirnameReplaceCharsstringno , -, ., &Dir replace chars
dirnameCasestringnolowercaseDir case
recursiveCompressbooleannofalseIterative targeting
expectedSizeKBnumberno100Target KB
qualityStepDownnumberno5 (schema) / 10 (code)Per-iteration decrease
minimumQualityFloornumberno10Minimum quality

Data Flow

Request → type guard → Controller
  ├─ Validate input directory exists
  ├─ Apply defaults, build FileNamingOptions
  ├─ Scan all image files (recursive)
  ├─ Filter out SVG (restricted)
  ├─ For each file:
  │   ├─ Compute output path (preserves structure, normalizes, changes ext)
  │   └─ Run ImageService.compressImage
  ├─ Generate report (.image-processor-mcp/reports/)
  └─ Generate mappings JSON (.image-processor-mcp/mappings/)

Output Path Algorithm

relativePath = inputDir → inputFile difference

1. Dir naming enabled → normalize each directory component
2. File naming enabled → normalize basename
3. Replace extension with .{outputFormat}
4. Prepend outputDir

normalizeName

Replace each char → '_', collapse multiple '_', trim edges, apply case

Generated Files

.image-processor-mcp/
├── reports/scan-report-{timestamp}.md
└── mappings/mappings-{timestamp}.json

Response Example

{
  "success": true,
  "totalFiles": 10,
  "successful": 9,
  "failed": 1,
  "totalOriginalSize": 5000000,
  "totalCompressedSize": 1200000,
  "overallReduction": 76.00,
  "durationMs": 5432,
  "reportPath": ".image-processor-mcp/reports/scan-report-2026-05-29-15-30-00.md",
  "mappingsPath": ".image-processor-mcp/mappings/mappings-2026-05-29-15-30-00.json"
}

Edge Cases

  • Input dir not found: Early error, no files written
  • SVG files: Silently excluded
  • Abort mid-batch: Partial results processed
  • All files fail: No mappings file generated
  • No images found: Empty report

4. sync_filenames

Scan project files and replace all references to old filenames with new filenames after compression.

Parameters

ParameterTypeRequiredDefaultDescription
scanDirstringyes—Directory to scan
mappingFilePathstringno—Path to mappings JSON file
mappingsarrayno—Inline {oldFileName, newFileName}[]
includeExtensionsarraynohtml,js,ts,css,md,json...Extensions to scan
excludeDirectoriesarraynonode_modules,.git,build,dist...Dirs to skip
dryRunbooleannotruePreview only

Validation

When using mappingFilePath:

  1. File exists + valid JSON
  2. Mappings array present and non-empty
  3. Each entry has oldFileName and newFileName (strings)
  4. Timestamp extracted from filename mappings-(.+).json
  5. Matching report must exist: reports/scan-report-{timestamp}.md

If the matching report is missing → operation rejected (prevents stale mappings).

Data Flow

Request → type guard → Controller
  ├─ mappingFilePath?
  │   YES → ReferenceService.readMappingFile → validate against report
  │   NO  → use inline mappings
  ├─ dryRun = args.dryRun !== false
  ├─ ReferenceService.scanReferences:
  │   ├─ Collect files recursively (filtered by extension, excluding dirs)
  │   ├─ For each file:
  │   │   ├─ For each mapping:
  │   │   │   ├─ Regex-escape oldFileName, count occurrences
  │   │   │   ├─ Build line-by-line details
  │   │   │   ├─ Build preview (3 lines context)
  │   │   │   └─ If !dryRun: replace in content
  │   │   └─ If modified: write file
  │   └─ Return UpdateRefResult
  └─ ReportService.generateSyncReport → .image-processor-mcp/syncs/

Generated Files

.image-processor-mcp/syncs/sync-report-{timestamp}.md           (live)
.image-processor-mcp/syncs/dry-run/sync-report-{timestamp}.md   (dry-run)

Response Example

Dry run — no files were modified.

Mapping source: .image-processor-mcp/mappings/mappings-2026-05-29-15-30-00.json
Files scanned: 42
Files with matches: 3
Total replacements: 12

--- Matches ---

[src/components/Header.tsx]
  "logo.png" → "logo.webp" (5x)
  Preview: ... context lines ...
  Line 15:23  "logo.png" → "logo.webp"
  ... and 3 more (see report)

Report saved to: .image-processor-mcp/syncs/dry-run/sync-report-2026-05-29-15-31-00.md

Edge Cases

  • Mapping file not found: Error with path
  • Invalid JSON: Parse error
  • No matching report: Detailed rejection message
  • Neither source provided: Error explaining options
  • No matches found: Informational message
  • Regex special chars: Properly escaped
  • Binary files: Filtered by extension list

5. extract_text

Extract visible printed text from images using OCR (tesseract.js). Runs entirely locally.

Parameters

ParameterTypeRequiredDefaultDescription
imagePathstringyes—Path to image file
languagestringnoengLanguage code (use + for multiple)
rectangleobjectno—Region {top, left, width, height}
outputFormatenumnotexttext, blocks, hocr, tsv
preprocessbooleannotrueGrayscale + auto-rotate

Data Flow

Request → type guard → OcrController → OcrService.recognize
  ├─ Validate path (exists, not dir, not empty, not SVG)
  ├─ Validate rectangle (positive dimensions)
  ├─ Build sharp pipeline:
  │   ├─ Convert unsupported formats to PNG
  │   └─ Preprocess: grayscale + rotate
  ├─ runOcr:
  │   ├─ Serialized via jobQueue (one at a time)
  │   ├─ getWorker: reuse / reinitialize / create
  │   ├─ worker.recognize()
  │   └─ Recycle worker every 500 jobs
  └─ Return ExtractTextResult

Worker Lifecycle

StateAction
Worker exists, same languageReuse directly
Worker exists, different languageworker.reinitialize(language)
No workercreateWorker(language, 1, ...)
After 500 jobssetImmediate(recycleWorker)
Worker errorerrorHandler nulls out reference
SIGINT / transport closeshutdown() → terminate

Supported Input Formats

Natively supportedAuto-converted to PNG
bmp, jpg, jpeg, pngtiff, heic, heif, webp*, gif*
pbm, pgm, ppmand all others

* webp and gif ARE natively supported by tesseract.js, despite the conversion check. The code converts any extension NOT in OCR_SUPPORTED_EXTENSIONS. Since webp and gif are in that list, they are NOT converted.

Limitations

  • Handwritten text: NOT supported
  • SVG files: Rejected (vector format)
  • Empty images: Return empty string (not an error)
  • First run: Downloads language data (~2MB) from CDN

Response Example (text format)

{
  "success": true,
  "text": "Extracted text content",
  "confidence": 92.5,
  "words": 42,
  "language": "eng",
  "durationMs": 1234,
  "preprocessed": true
}

Edge Cases

  • SVG: Explicit rejection
  • Unsupported format: Auto-converted to PNG
  • Worker crash: Auto-recovery (errorHandler nulls out)
  • Abort: DOMException caught → cancelled result
  • Empty file (0 bytes): Explicit rejection
  • Path is directory: Explicit rejection

6. get_acknowledgement

Returns comprehensive documentation of all tools, defaults, formats, and environment variables.

Parameters

None — empty input schema.

Response

A full markdown document built dynamically from all configuration constants:

SectionSource
All 6 toolsHardcoded descriptions
Configuration defaultsDEFAULTS + CONFIG_DESCRIPTIONS
Supported input formatsSUPPORTED_EXTENSIONS + INPUT_EXTENSION_DESCRIPTIONS
Supported output formatsSUPPORTED_OUTPUT_FORMATS + OUTPUT_FORMAT_DESCRIPTIONS
Sync scan defaultsDEFAULT_EXTENSIONS + DEFAULT_EXCLUDE_DIRS
Restricted extensionsRESTRICTED_EXTENSIONS
Environment variablesHardcoded
CreditsHardcoded

Implementation

ToolController.handleGetAcknowledgement()
  // Synchronous — no abort signal, no async
  // Returns { content: [{ type: 'text', text: markdown }] }

Edge Cases

None — always succeeds, no parameters, no I/O.


Configuration Defaults

ParameterDefaultDescription
quality85Compression quality for lossy formats (1–100)
losslessfalseLossless compression (WebP, PNG, GIF, AVIF)
effort6CPU effort (0–6). Higher = smaller files
maxDimension2000Auto-resize threshold in pixels
expectedSizeKB100Target file size for recursive compression
qualityStepDown10Quality decrease per recursive iteration
minimumQualityFloor10Minimum quality (1–100) during recursion
outputFormatwebpDefault output format
filenameCaselowercaseFilename case conversion
dirnameCaselowercaseDirectory name case conversion
filenameReplaceChars[' ', '-', '.', '&']Characters replaced with _ in filenames
dirnameReplaceChars[' ', '-', '.', '&']Characters replaced with _ in dir names

Supported Formats

Input Formats (35+)

.jpg, .jpeg, .png, .gif, .bmp, .tiff, .tif, .webp, .avif, .svg, .heic, .heif, .ico, .cur, .jp2, .j2k, .jpf, .jpx, .jpm, .mj2, .jxr, .wdp, .hdp, .psd, .psb, .dds, .tga, .vda, .icb, .vst, .pbm, .pgm, .ppm, .pnm, .pfm, .exr, .hdr, .hrd, .pic, .pict, .pct, .xbm, .xpm, .wal, .cut, .ras, .sun, .sgi, .rgb, .rgba, .bw, .pcx, .pcd, .iff, .lbm

Output Formats (10)

FormatDescription
webpGoogle WebP. Excellent lossy/lossless. Supports transparency.
avifAV1-based. 30–50% smaller than JPEG. Slower encoding.
jpegUniversal compatibility. No transparency.
pngLossless with transparency. Best for graphics/logos.
tiffHigh-quality. Print/publishing. Largest sizes.
gifAnimation + transparency. 256 colors.
heifHEVC-based. Apple ecosystem.
jp2JPEG 2000. Wavelet-based. Medical/ cinema.
jxlJPEG XL. Next-gen. Lossless JPEG re-encoding.
pdfConvert images to PDF pages.

Restricted Extensions

.svg — SVG files are skipped during batch compression (vector format — sharp cannot safely compress without breaking rendering).


Credits & License

Author

Dhvanil Pansuriya

Technology Credits

TechnologyRole
Model Context Protocol SDKMCP server framework
sharpHigh-performance image processing
tesseract.jsOCR text extraction — 100% local, no API key
PexelsFree stock photo API for image search
axiosHTTP client
fs-extraExtended file system

License

MIT License — See LICENSE for details.

Image-Processor-MCP

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Image Processor MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/image-processor-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related media design MCP Servers

Alternative and complementary servers in the same category

View all in media design →

A Rust CAD application with an MCP server for creating, inspecting and rendering drawings, either headlessly or through a connection to the desktop app.

8K
Media & Design
Liquid Composer
liquid-composer•frontedu

Liquid Composer is a browser-based Liquid Glass icon design tool that offers a local MCP server for agent-driven icon workflows.

69
Media & Design

agent-media makes short drama series and other short vertical videos from Claude, ChatGPT or Codex through one MCP connection, with OAuth sign-in and no API keys.

1
Media & Design