claude-image-gen
AI-powered image generation using Google Gemini, integrated with Claude Code via Skills or Claude.ai via MCP (Model Context Protocol).
claude mcp add --transport stdio guinacio-claude-image-gen node /path/to/claude-image-gen/mcp-server/build/index.js \
--env GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>" \
--env IMAGE_OUTPUT_DIR="${IMAGE_OUTPUT_DIR:-./generated-images}" \
--env GEMINI_DEFAULT_MODEL="${GEMINI_DEFAULT_MODEL:-gemini-3-pro-image-preview}"How to use
This MCP server implements a Gemini-based image generation capability that integrates with Claude through an MCP tool named media-pipeline. The server exposes a generic tool abstraction for image creation, allowing Claude to invoke image generation directly via the MCP protocol or through the CLI skill that calls the bundled CLI script. When used via MCP, you can specify prompts, aspect ratios, and model quality, and the server will generate images on demand and return file paths where the images are saved.
To use the MCP flow, connect Claude to the media-pipeline MCP service and call the create_asset tool (or equivalent) to generate images from textual prompts. If you prefer the skill-assisted path, the Claude image-generation skill can trigger the same underlying CLI, leveraging the bundled dependencies for a seamless experience. The two execution modes ensure flexibility: the CLI route is lean and fast for skill-driven prompts, while the MCP route supports direct tool calls for non-skill workflows.
How to install
Prerequisites:
- Node.js 18+ (required for manual installation)
- A Google Gemini API key
- Build and run the MCP server locally
- From the repository root, install dependencies and build:
cd mcp-server npm install npm run build
- Add the MCP server to Claude Code (MCP-based workflow)
-
Option A: Using Claude CLI (recommended for ease of use)
claude mcp add --transport stdio media-pipeline \ --env GEMINI_API_KEY=your-api-key-here \ -- node /path/to/claude-image-gen/mcp-server/build/index.jsThe
--separates Claude CLI flags from the server command. -
Option B: Manual config (advanced) Add to Claude Code config (
~/.claude.json):{ "mcpServers": { "media-pipeline": { "command": "node", "args": ["/path/to/claude-image-gen/mcp-server/build/index.js"], "env": { "GEMINI_API_KEY": "${GEMINI_API_KEY}", "GEMINI_DEFAULT_MODEL": "${GEMINI_DEFAULT_MODEL:-gemini-3-pro-image-preview}", "IMAGE_OUTPUT_DIR": "${IMAGE_OUTPUT_DIR:-./generated-images}" } } } }
- (Optional) Install the Skill Manually
- If you’re not using the plugin, copy the skill assets to Claude’s skills folder as described:
cp -r skills/image-generation ~/.claude/skills/
- (Optional) Build Extension for Claude Desktop
- If you want to package your own extension for Claude Desktop:
This creates a media-pipeline.mcpb extension file.cd mcp-server npm install -g @anthropic-ai/mcpb mcpb pack
Prerequisites recap:
- Gemini API key
- Node.js 18+ (for manual installation and running the MCP server)
- Access to Claude with MCP integration or the CLAUDE CLI tooling described above
Additional notes
Tips and notes:
- Environment variables support defaults via the ${VAR:-default} syntax for convenient local development.
- If you primarily need skill-driven usage, you can disable the MCP server in Claude Code to reduce startup overhead; the skill will still function and call the bundled CLI.
- The MCP server version uses the generic tool naming (media-pipeline) and create_asset-style interaction to encourage proper tool discovery by the assistant rather than direct, image-specific function calls.
- Ensure GEMINI_API_KEY is kept secure and not checked into version control.
- The default output directory is ./generated-images; you can customize this via IMAGE_OUTPUT_DIR.
Related MCP Servers
buildwithclaude
A single hub to find Claude Skills, Agents, Commands, Hooks, Plugins, and Marketplace collections to extend Claude Code, Claude Desktop, Agent SDK and OpenClaw
mcp-rest-api
A TypeScript-based MCP server that enables testing of REST APIs through Cline. This tool allows you to test and interact with any REST API endpoints directly from your development environment.
claude-code
MCP Server connects with claude code local command.
Hybrid-CLI-Agent
Multi-agent CLI orchestrator combining Claude Code, Gemini CLI, and OpenRouter.
create -kit
Scaffold a production-ready Model Context Protocol (MCP) server in seconds.
infura
Infura MCP server! This project provides a ready-to-use Model Context Protocol (MCP) server that exposes the Infura JSON-RPC API as a set of tools for Large Language Models like Claude and Cursor.