AiGeekSquad.ImageGenerator
A .NET MCP (Model Context Protocol) tool for AI-powered image generation using various providers including OpenAI (DALL-E, GPT Image models) and Google (Imagen). Supports image generation, editing, and variations with an extensible provider architecture.
Ask AI about AiGeekSquad.ImageGenerator
Powered by Claude Β· Grounded in docs
I know everything about AiGeekSquad.ImageGenerator. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
AiGeekSquad.ImageGenerator
A .NET MCP (Model Context Protocol) tool for AI-powered image generation using various providers including OpenAI (DALL-E, GPT Image models) and Google (Imagen).
Features
- π¨ Multiple Providers: Support for OpenAI and Google AI platforms
- π§ Extensible Architecture: Easily add custom image generation providers
- π― Latest Models: Support for DALL-E 3, GPT Image 1, GPT-5 Image (future), and Imagen 3
- π Response API: Iterative image manipulation with edits and variations
- π οΈ MCP Integration: Works seamlessly with MCP-compatible AI assistants
- β‘ Modern C#: Built with .NET 9.0 and latest C# features
- β Well Tested: Comprehensive test coverage using xUnit
- π¦ NuGet Package: Easy installation as a global .NET tool
Supported Operations
Generate Images
Create images from text prompts using various AI models.
Edit Images
Modify existing images based on text descriptions (OpenAI DALL-E 2).
Create Variations
Generate variations of existing images (OpenAI DALL-E 2).
List Providers
Get information about available providers and their capabilities.
Supported Models
OpenAI
dall-e-3- Latest high-quality image generationdall-e-2- Previous generation (supports edits and variations)gpt-image-1- New GPT-based image generationgpt-5-image- Future GPT-5 image capabilities (placeholder)
imagen-3.0-generate-001- Latest Imagen modelimagen-3.0-fast-generate-001- Optimized for speedimagegeneration@006- Imagen 2
Installation
As a Global .NET Tool (Recommended)
dotnet tool install --global AiGeekSquad.ImageGenerator
Update Existing Installation
dotnet tool update --global AiGeekSquad.ImageGenerator
From Source
git clone https://github.com/AIGeekSquad/image-generator.git
cd image-generator
dotnet pack src/AiGeekSquad.ImageGenerator.Tool/AiGeekSquad.ImageGenerator.Tool.csproj --configuration Release
dotnet tool install --global --add-source ./nupkg AiGeekSquad.ImageGenerator
Configuration
Environment Variables
# OpenAI (required for OpenAI provider)
export OPENAI_API_KEY="your-openai-api-key"
# Optional: Azure OpenAI
export OPENAI_ENDPOINT="https://your-resource.openai.azure.com"
# Google (optional)
export GOOGLE_PROJECT_ID="your-google-cloud-project-id"
appsettings.json
Alternatively, create an appsettings.json file in the tool's directory:
{
"OpenAI": {
"ApiKey": "your-openai-api-key",
"Endpoint": "",
"DefaultModel": "dall-e-3"
},
"Google": {
"ProjectId": "your-google-cloud-project-id",
"Location": "us-central1",
"DefaultModel": "imagen-3.0-generate-001"
}
}
Usage
As an MCP Server
Add to your MCP configuration (e.g., in GitHub Copilot or Claude Desktop):
{
"mcpServers": {
"image-generator": {
"command": "aigeeksquad-imagegen",
"args": [],
"env": {
"OPENAI_API_KEY": "your-api-key"
}
}
}
}
Command Line
After installation, run the tool:
aigeeksquad-imagegen
The tool starts an MCP server that communicates via stdio.
MCP Tools
generate_image
Generate an image from a text prompt.
Parameters:
prompt(required): Text description of the imageprovider: Provider to use (default: "OpenAI")model: Model to use (e.g., "dall-e-3", "gpt-image-1")size: Image size (e.g., "1024x1024", "1792x1024")quality: Image quality ("standard" or "hd")style: Image style ("vivid" or "natural")numberOfImages: Number of images to generate (default: 1)
edit_image
Edit an existing image based on a prompt.
Parameters:
image(required): Base64 encoded image or URLprompt(required): Description of desired changesmask: Optional mask imageprovider: Provider to use (default: "OpenAI")model: Model to use (default: "dall-e-2")size: Output image sizenumberOfImages: Number of images to generate (default: 1)
create_variation
Create variations of an existing image.
Parameters:
image(required): Base64 encoded image or URLprovider: Provider to use (default: "OpenAI")model: Model to use (default: "dall-e-2")size: Output image sizenumberOfImages: Number of variations (default: 1)
list_providers
List all available providers and their capabilities.
Architecture
Core Components
-
AiGeekSquad.ImageGenerator.Core: Core library with abstractions and provider implementations
IImageGenerationProvider: Interface for image generation providersIImageGenerationService: Service for managing multiple providersImageProviderBase: Base class for easy provider implementationProviderCapabilities: Metadata about provider capabilities
-
AiGeekSquad.ImageGenerator.Tool: MCP server implementation
ImageGenerationTools: MCP tool implementationsProgram.cs: Server configuration and startup
-
AiGeekSquad.ImageGenerator.Tests: Comprehensive test suite using xUnit
Extensibility
Adding a new provider is straightforward:
- Create a class that inherits from
ImageProviderBase - Implement the required abstract members
- Register the provider in
Program.cs
Example:
public class CustomImageProvider : ImageProviderBase
{
public override string ProviderName => "Custom";
protected override ProviderCapabilities Capabilities { get; } = new()
{
ExampleModels = new List<string> { "custom-model-1" },
SupportedOperations = new List<ImageOperation> { ImageOperation.Generate },
DefaultModel = "custom-model-1",
AcceptsCustomModels = true
};
public override async Task<ImageGenerationResponse> GenerateImageAsync(
ImageGenerationRequest request,
CancellationToken cancellationToken = default)
{
// Implementation
}
}
Development
Build
dotnet build
Test
dotnet test
Run Locally
cd src/AiGeekSquad.ImageGenerator.Tool
dotnet run
Requirements
- .NET 9.0 SDK or later
- OpenAI API key (for OpenAI provider)
- Google Cloud project with Vertex AI enabled (for Google provider, optional)
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
Acknowledgments
- Built with ModelContextProtocol SDK
- Uses Microsoft.Extensions.AI
- Integrates with Azure OpenAI SDK
- Integrates with Google Cloud AI Platform
