Image Processor MCP server

Enables image retrieval, processing, and display from both URLs and local files with automatic compression and formatting for visual content integration.
Back to servers
Provider
FarhaParveen919
Release date
Mar 22, 2025
Language
Python
Stats
3 stars

This MCP Server provides tools for fetching and processing images from URLs, local file paths, and numpy arrays. It converts images to base64-encoded strings with proper MIME types, making it easy to handle images in your AI applications.

Prerequisites

  • Python 3.10+
  • uv package manager (recommended)

Installation

Create and activate a virtual environment using uv:

uv venv

# On Windows:
.venv\Scripts\activate

# On Unix/MacOS:
source .venv/bin/activate

Install dependencies:

uv pip install -r requirements.txt

Running the Server

Direct Method

Start the MCP server directly:

uv run python mcp_image.py

Configure for Windsurf/Cursor

Windsurf Setup

  1. Edit the configuration file at ~/.codeium/windsurf/mcp_config.json
  2. Add the following configuration:
{
  "mcpServers": {
    "image": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-image", "run", "mcp_image.py"]
    }
  }
}

Cursor Setup

  1. Open Cursor and go to Settings (Navbar → Cursor Settings)
  2. Navigate to FeaturesMCP Servers
  3. Click on + Add New MCP Server
  4. Enter the following configuration:
{
  "mcpServers": {
    "image": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-image", "run", "mcp_image.py"]
    }
  }
}

Available Tools

The server provides a fetch_images tool that processes images from URLs or local file paths.

Usage Examples

You can use commands like:

  • "Fetch these images: [list of URLs or file paths]"
  • "Load and process this local image: [file_path]"

Example Inputs

# URL-only test
[
  "https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Chocolate_%28blue_background%29.jpg/400px-Chocolate_%28blue_background%29.jpg",
  "https://imgs.search.brave.com/Sz7BdlhBoOmU4wZjnUkvgestdwmzOzrfc3GsiMr27Ik/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pbWdj/ZG4uc3RhYmxlZGlm/ZnVzaW9ud2ViLmNv/bS8yMDI0LzEwLzE4/LzJmOTY3NTViLTM0/YmQtNDczNi1iNDRh/LWJlMTVmNGM5MDBm/My5qcGc",
  "https://shigacare.fukushi.shiga.jp/mumeixxx/img/main.png"
]

# Mixed URL and local file test
[
  "https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Chocolate_%28blue_background%29.jpg/400px-Chocolate_%28blue_background%29.jpg",
  "C:\\Users\\username\\Pictures\\image1.jpg",
  "https://imgs.search.brave.com/Sz7BdlhBoOmU4wZjnUkvgestdwmzOzrfc3GsiMr27Ik/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pbWdj/ZG4uc3RhYmxlZGlm/ZnVzaW9ud2ViLmNv/bS8yMDI0LzEwLzE4/LzJmOTY3NTViLTM0/YmQtNDczNi1iNDRh/LWJlMTVmNGM5MDBm/My5qcGc",
  "C:\\Users\\username\\Pictures\\image2.jpg"
]

Troubleshooting

If you encounter issues:

  • Verify all dependencies are installed correctly
  • Ensure the server is running and listening for connections
  • Check that local file paths are correct and accessible
  • For "Unsupported image type" errors, verify the content type handling
  • Look for error messages in the server output

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later