{"_id":"@ckz_2055/gemini-image-mcp","_rev":"2-501728a8c36b26c651329dcdb57ae1a6","name":"@ckz_2055/gemini-image-mcp","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ckz_2055/gemini-image-mcp","version":"1.0.0","keywords":["mcp","model-context-protocol","gemini","gemini-flash","gemini-pro","imagen","image-generation","ai","google-ai","claude","claude-code"],"author":{"name":"ckz_2055"},"license":"MIT","_id":"@ckz_2055/gemini-image-mcp@1.0.0","maintainers":[{"name":"ckz_2055","email":"ck@seeice.com"}],"bin":{"gemini-image-mcp":"dist/index.js"},"dist":{"shasum":"d7b9eb2d7a73ec5c0607572020fcbb83e8908feb","tarball":"https://registry.npmjs.org/@ckz_2055/gemini-image-mcp/-/gemini-image-mcp-1.0.0.tgz","fileCount":4,"integrity":"sha512-EYg6jB0lleUOOet2k7VnttN8SKw/p+fI7ZvkgQUUs2STTo4+6FjljEPK9vvvEmzhYirTDJXLfAImtlQhFm1Bag==","signatures":[{"sig":"MEYCIQCGtT8MiG7+Y+43EoYD2iAQ8+pFHbIazB2y5fh223yTFAIhAMEdVZDvERuhPSuD2/+EA03GFPw0UPUY32dENF+t58Pt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19157},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"ckz_2055","email":"ck@seeice.com"},"_npmVersion":"11.6.2","description":"MCP server for Google Gemini image generation (Gemini Flash, Gemini Pro, and Imagen 4.0)","directories":{},"_nodeVersion":"24.10.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5"},"_npmOperationalInternal":{"tmp":"tmp/gemini-image-mcp_1.0.0_1768062050028_0.8500831034658272","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ckz_2055/gemini-image-mcp","version":"1.0.1","description":"MCP server for Google Gemini image generation (Gemini Flash, Gemini Pro, and Imagen 4.0)","type":"module","main":"dist/index.js","bin":{"gemini-image-mcp":"dist/index.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/index.js","prepublishOnly":"npm run build"},"keywords":["mcp","model-context-protocol","gemini","gemini-flash","gemini-pro","imagen","image-generation","ai","google-ai","claude","claude-code"],"author":{"name":"ckz_2055"},"license":"MIT","engines":{"node":">=18.0.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.4"},"devDependencies":{"@types/node":"^22.10.5","typescript":"^5.7.2"},"types":"./dist/index.d.ts","_id":"@ckz_2055/gemini-image-mcp@1.0.1","_nodeVersion":"24.10.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-gKrpGwBH6CFXI7fV1QrMAyZjVHj0SjHxGmrFQso0OBdeSeqMT/R8cT5ZjOIhDf0pjZuJkjALKRe49lsfYMmjmg==","shasum":"f419e11659f74d10efdc0806c41e68a720a0c777","tarball":"https://registry.npmjs.org/@ckz_2055/gemini-image-mcp/-/gemini-image-mcp-1.0.1.tgz","fileCount":4,"unpackedSize":18939,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDKUFHocIH9riHVKyq/Xwx81G4JiJNO4eqCFkWQFp1VDwIhAIf0/ubGNakL2ukxch7/7UWiFFJqvpV2NenaE891c57l"}]},"_npmUser":{"name":"ckz_2055","email":"ck@seeice.com"},"directories":{},"maintainers":[{"name":"ckz_2055","email":"ck@seeice.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gemini-image-mcp_1.0.1_1768062879146_0.23873252866317385"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-10T16:20:49.803Z","modified":"2026-01-10T16:34:39.500Z","1.0.0":"2026-01-10T16:20:50.175Z","1.0.1":"2026-01-10T16:34:39.289Z"},"author":{"name":"ckz_2055"},"license":"MIT","keywords":["mcp","model-context-protocol","gemini","gemini-flash","gemini-pro","imagen","image-generation","ai","google-ai","claude","claude-code"],"description":"MCP server for Google Gemini image generation (Gemini Flash, Gemini Pro, and Imagen 4.0)","maintainers":[{"name":"ckz_2055","email":"ck@seeice.com"}],"readme":"# Google Gemini Image Generation MCP Server\n\nA Model Context Protocol (MCP) server that provides image generation capabilities using Google's Gemini API (including Nano Banana models and Imagen) for Claude Code and other MCP clients.\n\n## Features\n\n- Text-to-image generation with Google Gemini's image generation models\n- Support for multiple models:\n  - **Gemini Flash**: Fast and efficient (gemini-2.5-flash-image)\n  - **Gemini Pro**: High quality with 4K support (gemini-3-pro-image-preview)\n  - **Imagen 4.0**: Google's dedicated image generation model\n- Multiple resolutions (1K, 2K, 4K)\n- Multiple aspect ratios (1:1, 16:9, 4:3, 21:9, etc.)\n- Easy integration with Claude Code Skills\n\n## Prerequisites\n\n- Node.js 18 or higher\n- A Google Gemini API key (get one from [Google AI Studio](https://aistudio.google.com/apikey))\n\n## Installation\n\nInstall via npm:\n\n```bash\nnpm install -g @ckz_2055/gemini-image-mcp\n```\n\nOr use directly with npx (no installation required):\n\n```bash\nnpx @ckz_2055/gemini-image-mcp\n```\n\n**Get your API key:**\n1. Visit [Google AI Studio](https://aistudio.google.com/apikey)\n2. Sign in with your Google account\n3. Click \"Create API Key\"\n4. Copy your API key (starts with `AIzaSy`)\n\n## Configuration for Claude Code\n\n### Option 1: Using Claude Desktop\n\nAdd to your Claude Desktop config file:\n- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"gemini-image\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ckz_2055/gemini-image-mcp\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\nReplace `your-api-key-here` with your actual Google Gemini API key.\n\n### Option 2: Using Claude Code CLI\n\nAdd to your Claude Code MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"gemini-image\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ckz_2055/gemini-image-mcp\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\nReplace `your-api-key-here` with your actual Google Gemini API key.\n\n## Usage\n\nOnce configured, the MCP server provides the following tool:\n\n### `generate_image`\n\nGenerate images from text descriptions using Google Gemini.\n\n**Parameters:**\n\n- `prompt` (required): Text description of the image to generate. Be descriptive - describe the scene, don't just list keywords.\n- `model` (optional): Model to use:\n  - `\"gemini-flash\"` (default): Fast and efficient\n  - `\"gemini-pro\"`: High quality, supports 4K resolution\n  - `\"imagen\"`: Google's Imagen 4.0 model\n- `resolution` (optional): `\"1K\"` (default), `\"2K\"`, or `\"4K\"` (4K only with gemini-pro/imagen)\n- `aspect_ratio` (optional): `\"1:1\"` (default), `\"16:9\"`, `\"4:3\"`, `\"21:9\"`, etc.\n- `num_images` (optional): Number of images (1-4, only supported by Imagen model)\n\n**Example usage in Claude Code:**\n\n```\nUser: Generate an image of a sunset over mountains\nClaude: [Uses generate_image tool with prompt=\"A beautiful sunset over mountains with orange and pink sky\"]\n```\n\n**Example with specific parameters:**\n\n```\nUser: Create a wide 4K landscape image\nClaude: [Uses generate_image with model=\"gemini-pro\", resolution=\"4K\", aspect_ratio=\"16:9\"]\n```\n\n## Using with Skills\n\nSkills can now use the MCP tool for image generation. Here's an example skill:\n\nCreate `.claude/skills/blog-publisher/SKILL.md`:\n\n```markdown\n---\nname: Blog Publisher\ndescription: Convert markdown articles to HTML with AI-generated images\ntags: [markdown, html, images, blog]\n---\n\n# Blog Publisher Skill\n\nThis skill converts markdown articles into styled HTML pages with AI-generated images.\n\n## How it works\n\nWhen the user provides a markdown file:\n1. Parse the markdown content\n2. Identify places where images would enhance the content\n3. Use the `generate_image` MCP tool to create relevant images\n4. Convert markdown to HTML with syntax highlighting\n5. Insert generated images as base64 data URIs\n6. Apply beautiful CSS styling\n\n## Usage\n\n```\nUser: Convert my article to HTML with images\nAssistant: [Uses this skill to process the markdown and generate images]\n```\n\n## Example Implementation\n\nThe skill will call the generate_image tool like this:\n\n```typescript\n// The MCP tool is called automatically by Claude\ngenerate_image({\n  prompt: \"A futuristic cityscape at sunset with flying cars\",\n  model: \"gemini-flash\",\n  aspect_ratio: \"16:9\"\n})\n```\n```\n\n## Response Format\n\nImages are returned as base64 data URIs that can be used directly in HTML:\n\n```html\n<img src=\"data:image/png;base64,iVBORw0KG...\" alt=\"Generated image\">\n```\n\n## Testing\n\nTest the MCP server directly:\n\n```bash\n# Build and run\nnpm run build\nnpm start\n```\n\nOr use development mode (auto-rebuild):\n\n```bash\nnpm run dev\n```\n\n## Models & Capabilities\n\n| Model | ID | Resolution | Features |\n|-------|-----|-----------|----------|\n| Gemini Flash | `gemini-2.5-flash-image` | 1K, 2K | Fast, efficient |\n| Gemini Pro | `gemini-3-pro-image-preview` | 1K, 2K, 4K | High quality, multi-turn editing |\n| Imagen 4.0 | `imagen-4.0-generate-001` | 1K, 2K | Professional, batch generation |\n\n## Troubleshooting\n\n### \"GEMINI_API_KEY environment variable is required\"\n\nMake sure your API key is set in:\n- Your `.env` file, OR\n- The Claude config file under `env.GEMINI_API_KEY`\n\n### \"Gemini API error: 401\"\n\nYour API key is invalid or not authorized. Verify your key at [Google AI Studio](https://aistudio.google.com/apikey).\n\n### \"Gemini API error: 429\"\n\nYou've hit the rate limit. Wait a moment and try again, or check your quota in Google AI Studio.\n\n### \"Module not found\" errors\n\nRun `npm install` and `npm run build` to ensure dependencies are installed and TypeScript is compiled.\n\n### \"No images were generated\"\n\nThe API may have rejected your prompt. Try rephrasing it to be more descriptive and specific.\n\n## Development\n\n- `npm run build` - Build TypeScript to JavaScript\n- `npm run dev` - Watch mode for development\n- `npm start` - Run the MCP server\n\n## API Documentation\n\nFor more details on the Google Gemini API:\n- [Gemini Image Generation (Nano Banana)](https://ai.google.dev/gemini-api/docs/image-generation)\n- [Imagen API](https://ai.google.dev/gemini-api/docs/imagen)\n- [Google AI Studio](https://aistudio.google.com)\n\n## Example: Creating a Markdown to HTML Converter Skill\n\nOnce this MCP server is installed, you can create a skill that uses it:\n\n```markdown\n---\nname: Article to HTML\ndescription: Convert markdown articles to beautiful HTML with generated images\n---\n\n# Article to HTML Converter\n\nConverts markdown articles to styled HTML pages with AI-generated hero images and diagrams.\n\n## Usage\n\nUser: \"Convert article.md to HTML\"\n\nThe skill will:\n1. Read the markdown file\n2. Generate a hero image based on the article title\n3. Generate diagrams for code examples\n4. Convert to HTML with syntax highlighting\n5. Apply CSS styling\n6. Save as HTML file\n\nAll image generation is handled by the gemini-image MCP server!\n```\n\n## License\n\nMIT\n\n## Support\n\nFor issues with:\n- **This MCP server**: Open an issue in this repository\n- **Google Gemini API**: Visit [Google AI Studio](https://aistudio.google.com)\n- **Claude Code**: Visit [code.claude.com](https://code.claude.com)\n","readmeFilename":"README.md"}