OpenGraph.io

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

ParameterTypeDescription
promptstringRequired. For diagrams: natural language description OR pure Mermaid/D2/Vega syntax. For illustrations: describe the image content, style, and composition.
kindstringType of image: illustration, diagram, icon, social-card, or qr-code. Default: illustration
aspectRatiostringPreset aspect ratio: og-image (1200×630), twitter-card, linkedin-post, instagram-square, youtube-thumbnail, wide, square, portrait, etc.
stylePresetstringBrand-inspired presets: github-dark, github-light, notion, vercel, linear, stripe, neon-cyber, pastel, minimal-mono, corporate, startup, documentation, technical
diagramTemplatestringPre-built diagram templates: auth-flow, oauth2-flow, crud-api, microservices, ci-cd, gitflow, database-schema, state-machine, user-journey, cloud-architecture, system-context
brandColorsarrayBrand colors as hex codes (e.g., ["#0033A0", "#FF8C00"])
stylePreferencesstringStyle preferences: "modern", "minimalist", "corporate", etc.
projectContextstringDescription of the project this image is for
modelstringAI model: gpt-image-1.5, gemini-flash, gemini-pro
qualitystringQuality setting: low, medium, high, or fast
transparentbooleanRequest transparent background
outputStylestringPolish level: draft (fast), standard (AI-enhanced), premium (full AI polish)

Example: Generate Social Card

AI Assistant Prompt
Create a social card for my blog post titled "Getting Started with MCP" 
with a dark theme and the OpenGraph.io branding

Example: Generate Diagram

AI Assistant Prompt
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

ParameterTypeDescription
sessionIdstring (uuid)Required. The session UUID containing the image to iterate on
assetIdstring (uuid)Required. The asset UUID of the image to iterate on
promptstringRequired. Detailed instruction for the iteration. Be specific about what to change.
cropX1, cropY1integerTop-left corner coordinates for cropping (pixels)
cropX2, cropY2integerBottom-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

ParameterTypeDescription
sessionIdstring (uuid)Required. The session UUID containing the asset
assetIdstring (uuid)Required. The asset UUID to export
destinationPathstringRequired. Absolute path where the image should be saved (e.g., /Users/me/project/images/output.png)
overwritebooleanWhether 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

ParameterTypeDescription
sessionIdstring (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

PresetUse Case
og-imageOpen Graph images (1200×630)
twitter-cardTwitter/X summary cards
twitter-postTwitter/X timeline posts
linkedin-postLinkedIn feed posts
facebook-postFacebook feed posts
instagram-squareInstagram square posts
instagram-portraitInstagram portrait posts
instagram-storyInstagram/Facebook stories
youtube-thumbnailYouTube video thumbnails
wideGeneral wide format (16:9)
squareGeneral square format (1:1)
portraitGeneral portrait format
icon-smallSmall icons (32×32, 64×64)
icon-mediumMedium icons (128×128, 256×256)
icon-largeLarge icons (512×512)

Workflow Example

Here's a typical workflow for generating and exporting an image:

Step 1: Generate the 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-456
Step 2: Iterate if needed
User: 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.
Step 3: Export to project
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.png

Best 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

Related