Image Generation Tools
Generate professional illustrations, diagrams, icons, and social cards with AI. Create, iterate, and export images directly from your AI assistant through the OpenGraph MCP Server.
Overview
The OpenGraph MCP Server includes a powerful suite of image generation tools that allow your AI assistant to create professional visuals on demand. Whether you need technical diagrams for documentation, social media cards, icons, or marketing illustrations, these tools handle it all.
- generateImage – Create new images from text prompts
- iterateImage – Refine and modify existing generated images
- exportImageAsset – Save images to your local filesystem
- inspectImageSession – Review generation history and find assets
generateImage
Create professional images from text prompts. Supports multiple image types including illustrations, diagrams (Mermaid, D2, Vega), icons, social cards, and QR codes.
Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Required. For diagrams: natural language description OR pure Mermaid/D2/Vega syntax. For illustrations: describe the image content, style, and composition. |
| kind | string | Type of image: illustration, diagram, icon, social-card, or qr-code. Default: illustration |
| aspectRatio | string | Preset aspect ratio: og-image (1200×630), twitter-card, linkedin-post, instagram-square, youtube-thumbnail, wide, square, portrait, etc. |
| stylePreset | string | Brand-inspired presets: github-dark, github-light, notion, vercel, linear, stripe, neon-cyber, pastel, minimal-mono, corporate, startup, documentation, technical |
| diagramTemplate | string | Pre-built diagram templates: auth-flow, oauth2-flow, crud-api, microservices, ci-cd, gitflow, database-schema, state-machine, user-journey, cloud-architecture, system-context |
| brandColors | array | Brand colors as hex codes (e.g., ["#0033A0", "#FF8C00"]) |
| stylePreferences | string | Style preferences: "modern", "minimalist", "corporate", etc. |
| projectContext | string | Description of the project this image is for |
| model | string | AI model: gpt-image-1.5, gemini-flash, gemini-pro |
| quality | string | Quality setting: low, medium, high, or fast |
| transparent | boolean | Request transparent background |
| outputStyle | string | Polish level: draft (fast), standard (AI-enhanced), premium (full AI polish) |
Example: Generate Social Card
Create a social card for my blog post titled "Getting Started with MCP"
with a dark theme and the OpenGraph.io brandingExample: Generate Diagram
Generate an auth flow diagram showing:
1. User enters credentials
2. Server validates against database
3. JWT token returned
4. Client stores token
Use the github-dark style preset.Tip: For diagrams, you can either describe what you want in natural language, or provide raw Mermaid/D2/Vega syntax. Don't mix both in the same prompt.
iterateImage
Refine, modify, or create variations of an existing generated image. Use this to make targeted edits without regenerating from scratch.
Parameters
| Parameter | Type | Description |
|---|---|---|
| sessionId | string (uuid) | Required. The session UUID containing the image to iterate on |
| assetId | string (uuid) | Required. The asset UUID of the image to iterate on |
| prompt | string | Required. Detailed instruction for the iteration. Be specific about what to change. |
| cropX1, cropY1 | integer | Top-left corner coordinates for cropping (pixels) |
| cropX2, cropY2 | integer | Bottom-right corner coordinates for cropping (pixels) |
Use Cases
- Change colors: "Change the primary color to #0033A0"
- Add elements: "Add a title at the top"
- Style changes: "Make it more minimalist"
- Fix issues: "Remove the text in the corner"
- Crop: Specify coordinates to crop to a specific region
exportImageAsset
Export a generated image to a specific file path on your local filesystem. Use this to save images directly to your project.
Parameters
| Parameter | Type | Description |
|---|---|---|
| sessionId | string (uuid) | Required. The session UUID containing the asset |
| assetId | string (uuid) | Required. The asset UUID to export |
| destinationPath | string | Required. Absolute path where the image should be saved (e.g., /Users/me/project/images/output.png) |
| overwrite | boolean | Whether to overwrite if a file already exists. Default: true |
Security: The destination path must be an absolute path. System directories (/etc, /usr, /bin, etc.) are blocked for security reasons.
inspectImageSession
Retrieve detailed information about an image generation session and all its assets. Useful for reviewing what was generated and finding asset IDs for iteration.
Parameters
| Parameter | Type | Description |
|---|---|---|
| sessionId | string (uuid) | Required. The session UUID to inspect |
Returns
- Session metadata (creation time, name, status)
- List of all assets with their prompts, toolchains, and status
- Parent-child relationships showing iteration history
Aspect Ratio Presets
| Preset | Use Case |
|---|---|
| og-image | Open Graph images (1200×630) |
| twitter-card | Twitter/X summary cards |
| twitter-post | Twitter/X timeline posts |
| linkedin-post | LinkedIn feed posts |
| facebook-post | Facebook feed posts |
| instagram-square | Instagram square posts |
| instagram-portrait | Instagram portrait posts |
| instagram-story | Instagram/Facebook stories |
| youtube-thumbnail | YouTube video thumbnails |
| wide | General wide format (16:9) |
| square | General square format (1:1) |
| portrait | General portrait format |
| icon-small | Small icons (32×32, 64×64) |
| icon-medium | Medium icons (128×128, 256×256) |
| icon-large | Large icons (512×512) |
Workflow Example
Here's a typical workflow for generating and exporting an image:
User: Create an OG image for my blog post about "Building REST APIs with Node.js"
Use a dark tech theme with blue accents.
AI: I'll generate that image for you...
[Calls generateImage with appropriate parameters]
Generated! Here's the preview. Session ID: abc-123, Asset ID: def-456User: Can you make the title bigger and add a subtle gradient?
AI: I'll update that for you...
[Calls iterateImage with sessionId, assetId, and new prompt]
Updated! Here's the new version.User: Perfect! Save it to my project's public/images folder.
AI: I'll export that for you...
[Calls exportImageAsset with destination path]
Saved to /Users/you/project/public/images/blog-rest-apis-og.pngBest Practices
- Be specific in prompts – Include details about colors, style, and composition
- Use style presets – They provide consistent, professional results
- Iterate rather than regenerate – Small changes are faster with iterateImage
- Use appropriate aspect ratios – Each platform has optimal dimensions
- Provide project context – Helps the AI match your brand