Generates post images in Facebook-optimized dimensions (1200x630).
Generates featured images and banners in Ghost-optimized dimensions (1200x675, 2000x1125, 2560x1440) for blog posts.
Generates blog and social media images using Google's Gemini AI image generation models with configurable quality levels and platform-specific presets.
Generates images optimized for Instagram posts (1080x1080 square) and stories/reels (1080x1920 vertical).
Generates banner images in Medium-optimized dimensions (1400x788) for articles.
Generates header images in Substack-optimized dimensions (1456x816) for newsletter posts.
Generates featured images in WordPress-optimized dimensions (1200x675) for blog posts.
Generates thumbnails (1280x720) and channel banners (2560x1440) optimized for YouTube.
image-generation-mcp
An MCP (Model Context Protocol) server for generating blog and social media images using AI. Currently supports Google's Gemini/Nano Banana image generation models with a provider architecture designed for easy extension.
Features
Platform Presets: Pre-configured dimensions for Ghost, Medium, Instagram, Twitter, LinkedIn, YouTube, and more
Multiple Quality Levels: Standard (fast) or High (uses Gemini Pro for better quality)
Provider Architecture: Extensible design to support multiple AI providers
Security First: Input validation, prompt sanitization, safe error handling
Flexible Output: Return base64 image data or save directly to disk
Quick Start
Environment Variables
Variable | Required | Description |
| Yes | Your Google AI API key for Gemini |
Get your API key from Google AI Studio.
Claude Code Setup
Option 1: Published Package (after npm publish)
Option 2: Local Development
Option 3: Manual Configuration
Add to ~/.claude.json (user scope) or .mcp.json (project scope):
For local development:
Verify Installation
Claude Desktop Setup
Add to your claude_desktop_config.json:
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Tools
generate_blog_image
Generate an image for blog posts or social media.
Parameters:
Parameter | Type | Required | Description |
| string | Yes | Description of the image to generate |
| string | No | Platform preset (default:
) |
| string | No |
or
(default:
) |
| string | No | Style hint (e.g., "photorealistic", "illustration") |
| string | No | Blog post title for context |
| string | No | Path to save the image file |
| string | No | Provider to use (default:
) |
Example:
list_image_formats
List all available image format presets.
Parameters:
Parameter | Type | Required | Description |
| string | No | Filter by category:
,
,
,
|
Available Formats
Blog Platforms
Format | Dimensions | Description |
| 1200x675 | Featured image for Ghost blog posts |
| 2000x1125 | High-resolution feature image for Ghost |
| 2560x1440 | Premium high-resolution blog banner (QHD) |
| 1400x788 | Banner image for Medium articles |
| 1456x816 | Header image for Substack posts |
| 1200x675 | Featured image for WordPress posts |
Social Media
Format | Dimensions | Description |
| 1080x1080 | Square post for Instagram feed |
| 1080x1920 | Vertical story/reel for Instagram |
| 1200x675 | Image for Twitter/X posts |
| 1200x628 | Image for LinkedIn posts |
| 1200x630 | Image for Facebook posts |
Video Platforms
Format | Dimensions | Description |
| 1280x720 | Thumbnail for YouTube videos |
| 2560x1440 | Channel banner for YouTube |
Generic
Format | Dimensions | Description |
| 1024x1024 | Generic square image |
| 1920x1080 | Standard landscape (1080p) |
| 3840x2160 | 4K landscape image |
| 1080x1920 | Standard portrait/vertical image |
Security
This MCP server implements several security measures:
Input Validation: Prompts are validated for length and sanitized
Prompt Injection Protection: Suspicious patterns are blocked
Path Traversal Prevention: Output paths are validated
Safe Error Messages: API keys and sensitive data are never exposed in errors
No Logging of Secrets: API keys are never logged
⚠️ Disclaimer
This is a simple, vibe-coded MCP server for generating images. It is provided as-is for convenience and educational purposes.
What You Should Know
API Key Security: Your
GOOGLE_API_KEYis as safe as you make it. We do not store, log, or transmit your API key anywhere except to Google's API. You are responsible for:Keeping your API key secure
Not committing it to version control
Rotating it if you suspect it has been compromised
Data Transmission: Your prompts and generated images are sent to/from Google's Gemini API. Review Google's AI Terms of Service for their data handling policies.
No Warranty: This software is provided "AS IS", without warranty of any kind. The authors are not liable for any damages, data loss, API costs, or other issues arising from use of this software.
API Costs: Image generation may incur costs on your Google Cloud account. Monitor your usage and set up billing alerts.
Content Responsibility: You are responsible for the prompts you submit and the images you generate. Do not use this tool to generate harmful, illegal, or policy-violating content.
License
MIT License - see LICENSE for full terms.
By using this software, you acknowledge that you have read and understood these terms.
Adding New Providers
The server uses a provider interface pattern. To add a new provider:
Create a new file in
src/providers/implementingImageProviderRegister it in
src/providers/index.ts
Development
Publishing to npm
License
MIT