MCP Image Generator
An MCP server for generating images using Together AI or Replicate models.
MCP Image Generator
A Model Context Protocol (MCP) server for generating images using Together AI's image generation models. This MCP Server can be run locally or using an SSE endpoint.
The MCP Image Generator required a provider, only "Replicate" and "Together" are supported currently. You need to set the TOGETHER_API_KEY or REPLICATE_API_TOKEN environment variables. and set the PROVIDER environment variable to "replicate" or "together"/
SSE Endpoint (Docker environment)
Clone the repository
git clone https://github.com/gmkr/mcp-imagegen.git
cd mcp-imagegen
Build and run Docker container
docker build -f Dockerfile.server -t mcp-imagegen .
docker run -p 3000:3000 mcp-imagegen
Configuring with MCP Client
{
"mcpServers": {
"imagegenerator": {
"url": "http://localhost:3000/sse",
"env": {
"PROVIDER": "replicate",
"REPLICATE_API_TOKEN": "your-replicate-api-token"
}
}
}
}
Adjust the url to the endpoint of the MCP server you want to use. provider can be "replicate" or "together".
Running locally using stdio
Prerequisites
- Node.js
- Together AI API key or Replicate API token
Installation
-
Clone the repository:
git clone https://github.com/gmkr/mcp-imagegen.git cd mcp-imagegen -
Install dependencies:
pnpm install
Configuration
Create a configuration file for your MCP client. Here's an example configuration:
{
"mcpServers": {
"imagegenerator": {
"command": "pnpx",
"args": [
"-y",
"tsx",
"/path/to/mcp-imagegen/src/index.ts"
],
"env": {
"PROVIDER": "replicate",
"REPLICATE_API_TOKEN": "your-replicate-api-token"
}
}
}
}
Replace /path/to/mcp-imagegen with the absolute path to your cloned repository and your-replicate-api-token with your actual Replicate API token.
Usage
The MCP Image Generator provides a tool called generate_image that can be used to generate images based on text prompts.
Tool: generate_image
Generates an image based on the provided prompt.
Parameters:
prompt(string): The text prompt to generate an image forwidth(number, optional): The width of the image to generate (default: 512)height(number, optional): The height of the image to generate (default: 512)numberOfImages(number, optional): The number of images to generate (default: 1)
Environment Variables
PROVIDER: The provider to use for image generation (default: "replicate")REPLICATE_API_TOKEN: Your Replicate API tokenTOGETHER_API_KEY: Your Together AI API keyMODEL_NAME: The model to use for image generation (default: "black-forest-labs/flux-schnell")
License
MIT
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
uMCP (ultraMCP)
A lightweight Java framework for building MCP servers with TCP transport via mcp-java-bridge.
Assistant MCP Server
An MCP server that dynamically loads tools from an external JSON file configured via an environment variable.
Apple Doc MCP
Search Apple's Developer Documentation with smart search and wildcard support.
S3 Documentation MCP Server
A lightweight Model Context Protocol (MCP) server that brings RAG (Retrieval-Augmented Generation) capabilities to your LLM over Markdown documentation stored on S3.
Axone MCP
A lightweight server exposing Axone's capabilities through the Model-Context Protocol.
Webhook Tester MCP Server
Interact with webhook-test.com to automate and manage webhook tokens, inspect incoming requests, and perform analytics.
40ants MCP
A framework for building Model Context Protocol (MCP) servers in Common Lisp.
TCC
Automatically generates MCP servers from OpenAPI specifications, enabling conversational AI agents to interact with existing web systems.
MCP Servers Nix
A Nix-based configuration framework for deploying MCP servers with ready-to-use packages, supporting modular and reproducible builds.
Code-Index-MCP
A local-first code indexer that enhances LLMs with deep code understanding. It integrates with AI assistants via the Model Context Protocol (MCP) and supports AI-powered semantic search.