Image Generator MCP Server
Generate placeholder images with specified dimensions and colors, and save them to a file path.
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
Installation
- Clone or download this repository
- Install dependencies:
npm install
- Build the server:
npm run build
- Add the server to your MCP configuration:
For VSCode:
{
"servers": {
"Image Placeholder Gen": {
"type": "stdio",
"command": "node",
"args": [
"~/mcp_servers/image-gen/build/index.js"
]
}
}
}
For Claude Desktop:
{
"mcpServers": {
"image-gen": {
"command": "node",
"args": ["/path/to/image-gen/build/index.js"]
}
}
}
Usage
The server provides one tool:
generate_test_image
Generate a test image with specified parameters.
Parameters:
width(number): Width of the image in pixels (1-4096)height(number): Height of the image in pixels (1-4096)color(string): Color of the image as hex code (e.g., #FF0000 or #f00)filepath(string): Full path where the PNG image should be savedlabel(string, optional): Custom text to display in the top-left corner of the image
Example:
{
"name": "generate_test_image",
"arguments": {
"width": 400,
"height": 300,
"color": "#3498db",
"filepath": "/tmp/test_image.png",
"label": "My Custom Label"
}
}
Returns:
- Text confirmation that the image was successfully generated and saved
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
Contributing
Feel free to submit issues and enhancement requests!
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
DeepWiki by Devin
Remote, no-auth MCP server providing AI-powered codebase context and answers
UseGrant MCP Server
Interact with the UseGrant API for programmatic access control and permissions management.
Cache Overflow
knowledge network for AI coding agents. Developers connect their agents to a shared pool of verified solutions — saving tokens, reducing debugging time, and getting better results. Solution authors earn when their work helps others.
mcp2cli
CLI bridge that wraps MCP servers as bash-invokable commands, recovering ~11K tokens of context window per session https://github.com/rodaddy/mcp2cli
Figma (Oficial)
The Figma MCP server brings Figma directly into your workflow by providing important design information and context to AI agents generating code from Figma design files.
Custom MCP Server
A versatile MCP server built with Next.js, providing a range of tools and utilities with Redis state management.
Neovim LSP MCP Server
Bridges AI coding assistants with Neovim's Language Server Protocol for AI-powered code intelligence and navigation.
Specifai
Integrate and automate Specifai projects with any MCP-compatible AI tool.
OpenRouter MCP Client for Cursor
An MCP client for Cursor that uses OpenRouter.ai to access multiple AI models. Requires an OpenRouter API key.
Unbundle OpenAPI MCP Server
A server for splitting and extracting parts of OpenAPI specifications using Redocly CLI.