I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

gemini-image-generation-mcp
MCP server for Google Gemini 2.0 Flash image generation
3 years
Works with Finder
1
Github Watches
1
Github Forks
7
Github Stars
Gemini Flash MCP - Image Generation for Roo Code
This project provides a Model Context Protocol (MCP) server for connecting to Google's Gemini 2.0 Flash image generation model. It's specifically designed to work with Roo Code and other MCP-compatible AI assistants.
Currently working on issues with API connection
Currently testing and trying to resolve some issues with the Gemini API. Code may not be functional sorry!
Overview
This MCP server provides a tool for Gemini 2.0 Flash image generation with comprehensive support for all available API options. It allows AI assistants like Roo Code to generate images through the Model Context Protocol (MCP) with fine-grained control over the generation process.
Features
- Text-to-image generation using Google's Gemini 2.0 Flash model
- Full support for all available API parameters
- Simple web interface for testing and demonstration
- Easy installation for Roo Code and Claude Desktop
- Comprehensive documentation and examples
Installation
Prerequisites
- Node.js 18 or higher
- A Google AI Studio API key with access to the Gemini 2.0 Flash model
Global Installation
- Install the package globally:
npm install -g gemini-flash-mcp
- Run the setup command to configure Roo Code:
gemini-flash-mcp-install
- Set your Google AI API key in Roo Code settings:
- Open Roo Code
- Go to Settings
- Add the following environment variable to the MCP server configuration:
"gemini-flash-mcp": {
"env": {
"GEMINI_API_KEY": "your-google-ai-api-key"
}
}
- Restart Roo Code
Manual Installation
- Clone this repository:
git clone https://github.com/jezweb/gemini-image-generation-mcp.git
cd gemini-image-generation-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
- Configure your MCP settings manually:
- For Roo Code: Edit
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
- For Claude Desktop: Edit
~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or appropriate path for your OS
Add the following configuration:
"gemini-flash-mcp": {
"command": "node",
"args": ["/path/to/gemini-flash-mcp/build/index.js"],
"env": {
"GEMINI_API_KEY": "your-google-ai-api-key"
}
}
- Restart Roo Code or Claude Desktop
Usage
Once installed, you can use the generate_image
tool in Roo Code or other MCP-compatible assistants:
Please generate an image of a sailing boat on Sydney Harbour
Available Parameters
The generate_image
tool supports the following parameters:
-
prompt
(required): Text description of the desired image -
temperature
: Controls randomness (0.0 to 1.0, default: 1.0) -
topP
: Controls diversity via nucleus sampling (0.0 to 1.0, default: 0.95) -
topK
: Controls diversity via top-k sampling (default: 40) -
maxOutputTokens
: Maximum number of tokens to generate (default: 8192)
Web Interface
A web interface is available for testing the image generation:
npm start
Then open your browser to http://localhost:3000
Development
Project Structure
-
src/
- Source code for the MCP server-
index.ts
- Main server file with the image generation tool -
gemini.ts
- Gemini API integration -
install.ts
- Installation script for Roo Code and Claude Desktop
-
-
build/
- Compiled JavaScript files -
test-gemini.html
- Web interface for testing image generation -
test-gemini.js
- Direct test script for the Gemini API
Building
npm run build
Testing
npm test
Troubleshooting
API Key Issues
If you encounter authentication errors:
- Verify your API key is correct
- Ensure you have access to the Gemini 2.0 Flash model
- Check that the environment variable is properly set in your MCP configuration
Connection Issues
If the MCP server fails to connect:
- Check that the server is running
- Verify the path in your MCP configuration is correct
- Ensure the server has the correct permissions
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- Google for providing the Gemini 2.0 Flash API
- The Model Context Protocol (MCP) team for enabling AI assistant extensibility
相关推荐
Converts Figma frames into front-end code for various mobile frameworks.
Confidential guide on numerology and astrology, based of GG33 Public information
A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.
Mirror ofhttps://github.com/suhail-ak-s/mcp-typesense-server
本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。
Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx
Short and sweet example MCP server / client implementation for Tools, Resources and Prompts.
Reviews

user_xqUuCFMf
I have been using the Hugging Face MCP Server by MCP-Mirror and it has completely transformed my workflow. The integration is seamless, and the performance is top-notch. The server provides an efficient and reliable way to deploy models, making it a must-have for anyone in the AI development space. Highly recommend checking out the product here: https://mcp.so/server/shreyaskarnik_huggingface-mcp-server/MCP-Mirror.