# Leonardo.ai MCP

> Leonardo.ai (Generative AI & Models) lets you build complex creative pipelines directly into your agent. Generate high-fidelity images using precise prompts or guide the process by uploading reference photos. You can discover, manage, and audit custom models and generation history all without leaving your chat client.

## Overview
- **Category:** ai-frontier
- **Price:** Free
- **Tags:** generative-ai, image-generation, model-management, visual-assets, prompt-engineering, content-production

## Description

This MCP connects your generative image workflow to Leonardo.ai, giving you full control over professional visual assets through simple conversation. Instead of navigating a complex web dashboard, you tell your AI agent exactly what you want—whether that's generating an image from scratch or expanding a piece using a reference photo.

Your agent handles the whole process: it can list available models, check which custom styles are loaded onto your account, and initiate asynchronous generation requests. If you need to guide the style, you upload a source image and generate variations based on its structure. You'll also get real-time visibility into your usage by monitoring token allocations. Because Vinkius hosts this MCP within its catalog, you can connect all your specialized AI services—image creation, data querying, workflow automation—from one place, making your entire creative stack accessible to your agent.

## Tools

### generate_image
Generates a new image based on your text prompt and returns an ID to track the output status.

### get_generation
Checks the current status of any active or completed image generation request using its unique ID.

### list_user_generations
Retrieves a list of all recent images and their associated metadata created by your account.

### list_platform_models
Lists all global, publicly available models hosted on the Leonardo.ai platform.

### list_custom_models
Retrieves a list of private, fine-tuned models that you've trained and uploaded to your account.

### get_model
Fetches detailed information and specific parameters for any given Leonardo.ai model by name or ID.

### delete_generation
Permanently removes a specific image generation log entry from your history record.

### get_user
Retrieves current account metrics, including remaining tokens and usage statistics for billing oversight.

### create_variation
Generates an unzoomed extension of a previously created image to expand its context while keeping the style consistent.

### upload_init_image
Acquires a secure link needed to upload a source image for advanced image-to-image guidance.

## Prompt Examples

**Prompt:** 
```
Generate a futuristic cityscape at sunset using the Phoenix model
```

**Response:** 
```
Generating image… I've triggered a request using the Phoenix model (UUID: 123-abc). Your generation ID is 'gen-98765'. I'll monitor the status and provide the high-resolution links as soon as they are ready.
```

**Prompt:** 
```
List my last 3 image generations
```

**Response:** 
```
I've retrieved your recent generations: 1) 'Cyberpunk Forest' (gen-101), 2) 'Minimalist Logo' (gen-102), and 3) 'Abstract Portrait' (gen-103). Would you like me to fetch the direct URLs for any of these?
```

**Prompt:** 
```
Check my current token balance and account limits
```

**Response:** 
```
Retrieving metrics for user 'alex_designer'… You currently have 1,240 tokens remaining for today. Your daily limit is 2,000. You have performed 45 generations so far in this billing cycle.
```

## Capabilities

### Generate Images
Send a text prompt and get an image generation request ID that you can then poll until the final result is ready.

### Track Generation Status
Check if a previous image generation request is still running or if it has successfully completed.

### Manage Models and Styles
List all public platform models, discover your specific fine-tuned custom styles, or retrieve detailed parameters for any model.

### Create Visual Variations
Upload an initial image to generate structural extensions or context variations that expand the original piece while maintaining its style.

### Audit Image History and Usage
List all past user generations, retrieve links, track the prompts used, and monitor your current token usage against account limits.

## Use Cases

### Maintaining Brand Consistency Across Assets
A marketing team needs 50 variations of a product shot. Instead of manually running the same prompt and model fifty times, they ask their agent to use `upload_init_image` with the master photo, then loop through `create_variation` until all required angles are covered.

### Auditing Project Costs
A creative director needs to know if a team member is running up costs. They ask their agent to use `list_user_generations` and then `get_user` to cross-reference the history with current token usage, ensuring compliance.

### Developing New Visual Styles
A concept artist wants to see if a new model works. They use `list_platform_models` first, select 'Phoenix,' and then run a test generation via `generate_image` with a complex prompt to validate the style.

### Troubleshooting Failed Generations
An asset fails to load. Instead of restarting, the agent uses `get_generation` with the original ID to check if the failure was due to model parameters or network issues, saving time.

## Benefits

- Stop guessing which model to use. Use the `list_platform_models` and `list_custom_models` tools to see exactly what styles are available before you start generating.
- When an image isn't quite right, don't scrap it. Upload a source picture using `upload_init_image` and generate variations based on its composition instead of starting over.
- Keep track of your budget and usage in real time. The `get_user` tool gives you live metrics so you know exactly how many tokens are left for the week.
- Need to build a specific style? Use the `get_model` function to pull model details, ensuring your agent uses the exact parameters required for consistency across projects.
- Managing history is easy. You can list all past assets with `list_user_generations`, or if you need to clean up records, use `delete_generation`.

## How It Works

The bottom line is, you use plain language prompts to control complex, multi-step generative tasks without ever leaving your chat interface.

1. Subscribe to this MCP and provide your Leonardo.ai API key within your agent's settings.
2. Ask your AI client to perform a specific action, like 'Generate an image of a robot in the style of Kino XL.'
3. Your agent calls the necessary functions, giving you status updates until the high-resolution images are ready.

## Frequently Asked Questions

**How do I start generating an image using Leonardo.ai (Generative AI & Models) MCP?**
You initiate the process by asking your agent to generate an image and providing a detailed text prompt, like 'A futuristic city at sunset.' The tool will then return a Generation ID for tracking.

**Can I use Leonardo.ai (Generative AI & Models) MCP to guide my images?**
Yes, you can. By using `upload_init_image`, you provide your agent with a source photo, and it will give you the necessary secure link for guided generation or variations.

**What is the difference between list_platform_models and list_custom_models in Leonardo.ai (Generative AI & Models) MCP?**
Platform models are the public, global styles available to everyone. Custom models are the specific, private fine-tuned styles that you or your team trained on your own account.

**Is there a way to check my usage limits with Leonardo.ai (Generative AI & Models) MCP?**
Absolutely. Use the `get_user` tool, and it will retrieve your active account metrics, including tokens remaining for today's generation budget.

**How do I access my older images with Leonardo.ai (Generative AI & Models) MCP?**
You simply ask the agent to run `list_user_generations`. It will pull up a list of your recent work, along with their direct URLs and original prompts.

**Does Leonardo.ai (Generative AI & Models) MCP let me delete old history?**
Yes. If you need to clean up records or remove sensitive data, the `delete_generation` tool lets you explicitly erase a specific generation log entry.