leonardo-ai-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@leonardo-ai-mcp-serverGenerate an image of a sunset over mountains in cinematic style"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐จ Leonardo AI MCP Server
A remote Model Context Protocol (MCP) server for Leonardo.ai, powered by Vercel.
Generate images, manage models, check generation status, upscale, create variations โ all through MCP from Cursor, Claude Desktop, VS Code, or any MCP-compatible client.
โจ Features / Tools
Tool | Description |
| Generate images with Leonardo AI. Supports model selection, dimensions, style presets, Alchemy, PhotoReal, and Ultra mode. Polls for completion automatically. |
| Get the status and results of a generation job by ID |
| List all available Leonardo AI platform models with IDs, names and descriptions |
| Get recent generation jobs for a user |
| Get the authenticated user's info (username, tokens, quota) |
| Create a variation, outpaint, inpaint, or unzoom of an existing image |
| Upscale a generated image to higher resolution |
| Permanently delete a generation and its images |
Related MCP server: Gemini Image Gen MCP Server
๐ Deploy to Vercel
One-Click Deploy
Manual Deploy
Fork/clone this repository
Import it in Vercel
Set environment variable
LEONARDO_API_KEYwith your Leonardo AI API keyEnable Fluid Compute in your Vercel project settings for optimal performance
Deploy โ your MCP server will be live at
https://your-project.vercel.app/mcp
๐ Get a Leonardo AI API Key
Go to Leonardo.ai
Sign up / log in
Navigate to API Access in your settings
Generate an API key
๐ Connect Your MCP Client
Cursor
Add to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"leonardo-ai": {
"url": "https://your-project.vercel.app/mcp",
"headers": {
"x-leonardo-api-key": "YOUR_LEONARDO_API_KEY"
}
}
}
}Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"leonardo-ai": {
"url": "https://your-project.vercel.app/mcp",
"headers": {
"x-leonardo-api-key": "YOUR_LEONARDO_API_KEY"
}
}
}
}VS Code (GitHub Copilot)
Add to your VS Code MCP settings:
{
"mcp": {
"servers": {
"leonardo-ai": {
"url": "https://your-project.vercel.app/mcp",
"headers": {
"x-leonardo-api-key": "YOUR_LEONARDO_API_KEY"
}
}
}
}
}Note: You can also set
LEONARDO_API_KEYas an environment variable on Vercel instead of passing it as a header. If the env var is set, the header is optional.
๐ Local Development
# Install dependencies
pnpm install
# Set your API key
cp .env.example .env
# Edit .env and add your LEONARDO_API_KEY
# Start local dev server
pnpm devThe MCP server will be available at http://localhost:3000/mcp.
๐ Project Structure
โโโ api/
โ โโโ server.ts # MCP server with all tool definitions
โ โโโ leonardo-client.ts # Leonardo AI REST API client
โโโ public/
โ โโโ index.html # Landing page
โโโ package.json
โโโ tsconfig.json
โโโ vercel.json # Vercel deployment config
โโโ .env.example
โโโ README.md๐ API Key Options
The server resolves the Leonardo API key in this order:
x-leonardo-api-keyheader โ passed by the MCP client (recommended for multi-user setups)LEONARDO_API_KEYenv variable โ set in Vercel project settings (simpler for single-user)
๐งช Example Usage
Once connected, you can use natural language in your MCP client:
"Generate an image of a sunset over mountains in cinematic style"
"List available Leonardo AI models"
"Show me my recent generations"
"Upscale the last generated image"
"Create a variation of image xyz"
๐ License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/superdwayne/leonardo-ai-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server