Labsco
sam2332 logo

Image Generator MCP Server

from sam2332

Generate placeholder images with specified dimensions and colors, and save them to a file path.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Image Generator MCP Server

A Model Context Protocol (MCP) server that generates test images with customizable width, height, and color. Saves images as PNG files to specified file paths.

Features

  • Generate test images with specified dimensions (1-4096 pixels)
  • Support for hex color format (e.g., #FF0000, #f00)
  • Automatic text overlay showing image dimensions
  • Optional custom label text displayed in the top-left corner
  • Smart contrast color selection for readable text
  • Saves images as PNG files to specified file paths
  • Automatically creates directories if they don't exist

Color Format

The tool supports hex color format:

  • Hex colors: #FF0000, #f00

Testing

Run the test script to verify the server works:

npm run build
npm test

Dependencies

  • Node.js canvas library for image generation
  • Model Context Protocol SDK

Notes

  • Maximum image dimensions are capped at 4096x4096 pixels for performance
  • Generated images include dimension text overlay for easy identification
  • Text color is automatically chosen for optimal contrast against the background
  • The server automatically creates directories if they don't exist in the specified file path