Image Generation MCP Server

Image Generation MCP Server

Enables text-to-image and pixel art generation using Pollinations.ai with no API key required, and supports multiple models like Flux.

Category
Visit Server

README

Image Generation MCP Server

A Model Context Protocol (MCP) server for generating images using Pollinations.ai. No API key required — completely free!

Features

  • šŸŽØ Text-to-Image Generation — Generate high-quality images from text prompts
  • šŸ–¼ļø Pixel Art Mode — Specialized pixel art generation for retro/8-bit styles
  • šŸš€ Multiple Models — Support for Flux, Flux-Pro, and Flux-Realism
  • šŸ’¾ Auto-Save — Generated images are automatically saved to disk
  • šŸ†“ Free — Uses Pollinations.ai which requires no API key

Installation

Prerequisites

  • Python 3.8 or higher
  • pip

Setup

  1. Clone or navigate to the project directory:

    cd image-gen-mcp
    
  2. Install the package in development mode:

    pip install -e .
    
  3. (Optional) Configure output directory: Create a .env file in the project root:

    IMAGE_OUTPUT_DIR=./generated_images
    

Usage

Running the Server

python -m image_gen_mcp

The server will start and be ready to accept requests.

Available Tools

1. generate_image

Generate an image from a text prompt.

Parameters:

  • prompt (required): Description of the image
  • width (optional): Image width in pixels (default: 1024)
  • height (optional): Image height in pixels (default: 1024)
  • model (optional): Model to use - "flux", "flux-pro", or "flux-realism" (default: "flux")
  • seed (optional): Random seed for reproducibility

Example:

{
  "prompt": "a serene mountain landscape with a lake at sunset",
  "width": 1024,
  "height": 1024,
  "model": "flux"
}

2. generate_pixel_art

Generate pixel art from a text prompt.

Parameters:

  • prompt (required): Description of the pixel art
  • width (optional): Image width in pixels (default: 256)
  • height (optional): Image height in pixels (default: 256)

Example:

{
  "prompt": "a knight with a sword and shield",
  "width": 256,
  "height": 256
}

3. list_providers

List available image generation providers and their capabilities.

Example:

{}

Integration with Claude

To use this MCP with Claude Code, add it to your Claude configuration:

  1. Edit ~/.claude/settings.json
  2. Add the MCP server configuration:
{
  "mcpServers": {
    "image-gen-mcp": {
      "command": "python",
      "args": ["-m", "image_gen_mcp"],
      "env": {
        "IMAGE_OUTPUT_DIR": "./generated_images"
      }
    }
  }
}
  1. Restart Claude Code

Generated Images

By default, images are saved to ./generated_images/ with filenames like:

prompt_description_1719489264.png

You can change the output directory using the IMAGE_OUTPUT_DIR environment variable.

Troubleshooting

Connection Timeout

If you get a timeout error, it may be because:

  • The image generation is taking longer than expected
  • Your internet connection is unstable
  • Pollinations.ai service is temporarily down

Try again or increase the timeout in providers.py (currently 120 seconds).

Generation Failures

  • Ensure you have a stable internet connection
  • Try a simpler prompt
  • Check that Pollinations.ai is accessible

Architecture

image-gen-mcp/
ā”œā”€ā”€ src/image_gen_mcp/
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ __main__.py        # Entry point
│   ā”œā”€ā”€ server.py          # MCP server implementation
│   └── providers.py       # Image generation providers
ā”œā”€ā”€ pyproject.toml         # Project configuration
└── README.md

Contributing

Feel free to extend this server with:

  • Additional image generation providers (Together AI, Hugging Face, etc.)
  • Caching mechanisms
  • Batch generation
  • Image enhancement tools
  • Cost tracking

License

MIT License

Disclaimer

This project uses Pollinations.ai for image generation. Make sure to comply with their terms of service and respect copyright and usage rights when generating images.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured