AiGeekSquad.ImageGenerator.Core
1.0.70
dotnet add package AiGeekSquad.ImageGenerator.Core --version 1.0.70
NuGet\Install-Package AiGeekSquad.ImageGenerator.Core -Version 1.0.70
<PackageReference Include="AiGeekSquad.ImageGenerator.Core" Version="1.0.70" />
<PackageVersion Include="AiGeekSquad.ImageGenerator.Core" Version="1.0.70" />
<PackageReference Include="AiGeekSquad.ImageGenerator.Core" />
paket add AiGeekSquad.ImageGenerator.Core --version 1.0.70
#r "nuget: AiGeekSquad.ImageGenerator.Core, 1.0.70"
#:package AiGeekSquad.ImageGenerator.Core@1.0.70
#addin nuget:?package=AiGeekSquad.ImageGenerator.Core&version=1.0.70
#tool nuget:?package=AiGeekSquad.ImageGenerator.Core&version=1.0.70
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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Azure.AI.OpenAI (>= 2.1.0)
- Google.Cloud.AIPlatform.V1 (>= 3.54.0)
- Microsoft.Extensions.AI (>= 9.10.1)
- Microsoft.Extensions.AI.Abstractions (>= 9.10.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Http (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- System.Text.Json (>= 9.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of the core library with provider abstractions and built-in OpenAI and Google providers.