Back to MCP Servers

Imagesorcery

ComputerVision-based šŸŖ„ sorcery of image recognition and editing tools for AI assistants.

multimedia-processai
By sunriseapps
32250Updated 1 month agoPythonMIT

Installation

npx -y imagesorcery-mcp

Configuration

{
  "mcpServers": {
    "imagesorcery-mcp": {
      "command": "npx",
      "args": ["-y", "imagesorcery-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

šŸŖ„ ImageSorcery MCP

ComputerVision-based šŸŖ„ sorcery of local image recognition and editing tools for AI assistants

Official website: imagesorcery.net

License MCP Claude Cursor Cline Verified on MseeP PyPI Downloads

<a href="https://glama.ai/mcp/servers/@sunriseapps/imagesorcery-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@sunriseapps/imagesorcery-mcp/badge" /> </a>

āœ… With ImageSorcery MCP

šŸŖ„ ImageSorcery empowers AI assistants with powerful image processing capabilities:

  • āœ… Crop, resize, and rotate images with precision
  • āœ… Remove background
  • āœ… Draw text and shapes on images
  • āœ… Add logos and watermarks
  • āœ… Detect objects using state-of-the-art models
  • āœ… Extract text from images with OCR
  • āœ… Use a wide range of pre-trained models for object detection, OCR, and more
  • āœ… Do all of this locally, without sending your images to any servers

Just ask your AI to help with image tasks:

"copy photos with pets from folder photos to folder pets" Copying pets

"Find a cat at the photo.jpg and crop the image in a half in height and width to make the cat be centered" Centerizing cat šŸ˜‰ Hint: Use full path to your files".

"Enumerate form fields on this form.jpg with foduucom/web-form-ui-field-detection model and fill the form.md with a list of described fields" Numerate form fields šŸ˜‰ Hint: Specify the model and the confidence".

šŸ˜‰ Hint: Add "use imagesorcery" to make sure it will use the proper tool".

Your tool will combine multiple tools listed below to achieve your goal.

šŸ› ļø Available Tools

ToolDescriptionExample Prompt
blurBlurs specified rectangular or polygonal areas of an image using OpenCV. Can also invert the provided areas e.g. to blur background."Blur the area from (150, 100) to (250, 200) with a blur strength of 21 in my image 'test_image.png' and save it as 'output.png'"
change_colorChanges the color palette of an image"Convert my image 'test_image.png' to sepia and save it as 'output.png'"
configView and update ImageSorcery MCP configuration settings"Show me the current configuration" or "Set the default detection confidence to 0.8"
cropCrops an image using OpenCV's NumPy slicing approach"Crop my image 'input.png' from coordinates (10,10) to (200,200) and save it as 'cropped.png'"
detectDetects objects in an image using models from Ultralytics. Can return segmentation masks (as PNG files) or polygons."Detect objects in my image 'photo.jpg' with a confidence threshold of 0.4"
draw_arrowsDraws arrows on an image using OpenCV"Draw a red arrow from (50,50) to (150,100) on my image 'photo.jpg'"
draw_circlesDraws circles on an image using OpenCV"Draw a red circle with center (100,100) and radius 50 on my image 'photo.jpg'"
draw_linesDraws lines on an image using OpenCV"Draw a red line from (50,50) to (150,100) on my image 'photo.jpg'"
draw_rectanglesDraws rectangles on an image using OpenCV"Draw a red rectangle from (50,50) to (150,100) and a filled blue rectangle from (200,150) to (300,250) on my image 'photo.jpg'"
draw_textsDraws text on an image using OpenCV"Add text 'Hello World' at position (50,50) and 'Copyright 2023' at the bottom right corner of my image 'photo.jpg'"
fillFills specified rectangular, polygonal, or mask-based areas of an image with a color and opacity, or makes them transparent. Can also invert the provided areas e.g. to remove background."Fill the area from (150, 100) to (250, 200) with semi-transparent red in my image 'test_image.png'"
findFinds objects in an image based on a text description. Can return segmentation masks (as PNG files) or polygons."Find all dogs in my image 'photo.jpg' with a confidence threshold of 0.4"
get_metainfoGets metadata information about an image file"Get metadata information about my image 'photo.jpg'"
ocrPerforms Optical Character Recognition (OCR) on an image using EasyOCR"Extract text from my image 'document.jpg' using OCR with English language"
overlayOverlays one image on top of another, handling transparency"Overlay 'logo.png' on top of 'background.jpg' at position (10, 10)"
resizeResizes an image using OpenCV"Resize my image 'photo.jpg' to 800x600 pixels and save it as 'resized_photo.jpg'"
rotateRotates an image using imutils.rotate_bound function"Rotate my image 'photo.jpg' by 45 degrees and save it as 'rotated_photo.jpg'"

šŸ˜‰ Hint: detailed information and usage instructions for each tool can be found in the tool's /src/imagesorcery_mcp/tools/README.md.

šŸ“š Available Resources

Resource URIDescriptionExample Prompt
models://listLists all available models in the models directory"Which models are available in ImageSorcery?"

šŸ˜‰ Hint: detailed information and usage instructions for each resource can be found in the resource's /src/imagesorcery_mcp/resources/README.md.

šŸ’¬ Available Prompts

Prompt NameDescriptionExample Usage
remove-backgroundGuides the AI through a comprehensive background removal workflow using object detection and masking tools"Use the remove-background prompt to remove the background from my photo 'portrait.jpg', keeping only the person"

šŸ˜‰ Hint: detailed information and usage instructions for each prompt can be found in the prompt's /src/imagesorcery_mcp/prompts/README.md.

šŸš€ Getting Started

Requirements

  • Python 3.10 or higher
  • pipx (recommended) - for easy installation and virtual environment management
  • ffmpeg, libsm6, libxext6, libgl1-mesa-glx - system libraries required by OpenCV
  • Claude.app, Cline, or another MCP client
<details> <summary>Virtual environments (e.g. Docker)</summary>

These dependencies are typically included with OpenCV installation and don't require separate installation. But they might be missing in some virtual environments like Docker.

For Ubuntu/Debian systems:

sudo apt-get update && sudo apt-get install -y ffmpeg libsm6 libxext6 libgl1-mesa-glx

For Docker containers: Add this line to your Dockerfile:

RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 libgl1-mesa-glx
</details>

Installation

ImageSorcery Demo

<details> <summary>For Cline just copy-paste LLM-INSTALL.md</summary>
1.  Load MCP documentation if you have the tool for it. It will give you path to *MCP-configuration file* and other needed instructions.
2.  Run command `pipx install imagesorcery-mcp`
3.  Run command `imagesorcery-mcp --post-install`
4.  Create or modify *MCP-configuration file*.
5.  Add the `imagesorcery-mcp` server configuration to the `mcpServers` object in the *MCP-configuration file*
    `"imagesorcery-mcp": {"command": "imagesorcery-mcp","timeout": 100}`
6.  Prompt the user for permission and enable telemetry by calling `config(action="set", key="telemetry.enabled", value=True, persist=True)`.
7.  Attempt completion, indicating that the installation and configuration are complete.
</details>

Method 1: Using pipx (Recommended)

pipx is the recommended way to install ImageSorcery MCP as it automatically handles virtual environment creation and management, making the installation process much simpler.

<details> <summary>0. Install pipx (if not already installed):</summary>
  1. Install pipx (if not already installed):
    # On macOS with Homebrew:
    brew install pipx
    
    # On Ubuntu/Debian:
    sudo apt update && sudo apt install pipx
    
    # On other systems with pip:
    pip install --user pipx
    pipx ensurepath
</details>
  1. Install ImageSorcery MCP with pipx:

    pipx install imagesorcery-mcp
  2. Run the post-installation script: This step is crucial. It downloads the required models and attempts to install the clip Python package from GitHub.

    imagesorcery-mcp --post-install

Method 2: Manual Virtual Environment (Plan B)

<details> <summary>If pipx doesn't work for your system, you can manually create a virtual environment</summary>

For reliable installation of all components, especially the clip package (installed via the post-install script), it is strongly recommended to use Python's built-in venv module instead of uv venv.

  1. Create and activate a virtual environment:

    python -m venv imagesorcery-mcp
    source imagesorcery-mcp/bin/activate  # For Linux/macOS
    # source imagesorcery-mcp\Scripts\activate    # For Windows
  2. Install the package into the activated virtual environment: You can use pip or uv pip.

    pip install imagesorcery-mcp
    # OR, if you prefer using uv for installation into the venv:
    # uv pip install imagesorcery-mcp
  3. Run the post-installation script: This step is crucial. It downloads the required models and attempts to install the clip Python package from GitHub into the active virtual environment.

    imagesorcery-mcp --post-install

Note: When using this method, you'll need to provide the full path to the executable in your MCP client configuration (e.g., /full/path/to/venv/bin/imagesorcery-mcp).

</details>

Additional Notes

<details> <summary>What does the post-installation script do?</summary> The `imagesorcery-mcp --post-install` script performs the following actions:
  • Creates a config.toml configuration file in the current directory, allowing users to customize default tool parameters.
  • Creates a models directory (usually within the site-packages directory of your virtual environment, or a user-specific location if installed globally) to store pre-trained models.
  • Generates an initial models/model_descriptions.json file there.
  • Downloads default YOLO models (yoloe-11l-seg-pf.pt, yoloe-11s-seg-pf.pt, yoloe-11l-seg.pt, yoloe-11s-seg.pt) required by the detect tool into this models directory.
  • Attempts to install the clip Python package from Ultralytics' GitHub repository directly into the active Python environment. This is required for text prompt functionality in the find tool.
  • Downloads the CLIP model file required by the find tool into the models directory.

You can run this process anytime to restore the default models and attempt clip installation.

</details> <details> <summary>Important Notes for `uv` users (<code>uv venv</code> and <code>uvx</code>)</summary>
  • Using uv venv to create virtual environments: Based on testing, virtual environments created with uv venv may not include pip in a way that allows the imagesorcery-mcp --post-install script to automatically install the clip package from GitHub (it might result in a "No module named pip" error during the clip installation step). If you choose to use uv venv:
    1. Create and activate y

…

View source on GitHub