Image Generation MCP Server
Generate images using Google's Gemini model through an MCP server.
Setup
- Clone this repository
git clone https://github.com/MalluBeast69/gemini-img-gen-MCP
cd gemini-img-gen-MCP
- Initialize a new MCP server project
uv init mcp-server-demo
cd mcp-server-demo
- Install dependencies using uv
uv add "mcp[cli]"
uv add "google-generativeai"
uv add "Pillow"
- Create an
.mcp-config.jsonfile in your workspace with the following content:
{
"mcpServers": {
"content_gen": {
"command": "mcp",
"args": ["run", "<PATH_TO_SERVER_PY>"],
"env": {
"GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>",
"OUTPUT_IMAGE_PATH": "<YOUR_OUTPUT_PATH>"
},
"transportType": "stdio",
"autoApprove": []
}
}
}
Replace:
<PATH_TO_SERVER_PY>with the full path to your server.py file (e.g., "C:/Projects/image_gen/server.py")<YOUR_GEMINI_API_KEY>with your Gemini API key from https://makersuite.google.com/app/apikey<YOUR_OUTPUT_PATH>with where you want the generated images to be saved (e.g., "C:/Users/YourName/Pictures/GeneratedImages")
Usage
- Start the MCP server:
mcp start content_gen
- The server will now be ready to generate images based on your prompts!
Requirements
- Python 3.8+
- uv package manager
- Gemini API key
Recommend MCP Servers 💡
LaurieWired/GhidraMCP
MCP Server for Ghidra
mcp-vulnerability-scanner
A Model Context Protocol (MCP) server for scanning IP addresses for vulnerabilities, supporting single or batch IP scanning with detailed reports.
Magg
A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities. It acts as a central hub for managing multiple MCP servers, allowing LLMs to search, add, configure, enable/disable servers, aggregate tools, and persist configurations.
globalping
Remote MCP server that gives LLMs access to run network commands
cyberchef_api_mcp_server
This model context protocol (MCP) server interfaces with the [CyberChef Server](https://github.com/gchq/CyberChef-server) API. Allowing you to use any LLM/MCP client of your choosing to utilise the tools and resources within CyberChef.
helebest/my-mcp-lab
A lab project for setting up an SSE-based Model Context Protocol (MCP) server.