mcp-imagegen
MCP Server for Generating images
Documentation
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-imagegenBuild and run Docker container
docker build -f Dockerfile.server -t mcp-imagegen .
docker run -p 3000:3000 mcp-imagegenConfiguring 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
1. Clone the repository:
git clone https://github.com/gmkr/mcp-imagegen.git
cd mcp-imagegen2. Install dependencies:
pnpm installConfiguration
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 for
- `width` (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 token
- `TOGETHER_API_KEY`: Your Together AI API key
- `MODEL_NAME`: The model to use for image generation (default: "black-forest-labs/flux-schnell")
License
MIT
Frequently asked questions
What is mcp-imagegen?
mcp-imagegen is MCP Server for Generating images
How do I install mcp-imagegen?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-imagegen open source?
Yes — it is hosted on GitHub at https://github.com/GMKR/mcp-imagegen and has 3 stars.
Related MCP tools
Playwright MCP server TypeScript-based implementation. Trusted by 22000+ developers. Trusted by 22000+ developers. Trusted by 22000+ developers.
Official Notion MCP Server TypeScript-based implementation. Trusted by 3400+ developers. Trusted by 3400+ developers. Trusted by 3400+ developers.
Directory for Awesome MCP Servers TypeScript-based implementation. Trusted by 1900+ developers. Trusted by 1900+ developers.
🧩 MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes.
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker TypeScript-based implementation. Trusted by 1400+ developers.
MCP Server for kubernetes management commands TypeScript-based implementation. Trusted by 1100+ developers. Trusted by 1100+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP