home / mcp / leonardo mcp server

Leonardo MCP Server

Leonardo AI MCP server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ish-joshi-leonardo-mcp-server": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/ish-joshi/leonardo-mcp-server",
        "leonardo-mcp-server",
        "stdio"
      ],
      "env": {
        "LEONARDO_API_KEY": "YOUR_LEONARDO_API_KEY"
      }
    }
  }
}

You can run a Leonardo MCP Server to create and manage image generation jobs with Leonardo AI using either HTTP for remote clients or stdio for local clients. This server exposes convenient MCP endpoints to submit jobs, check status, and list your generation tasks, making it easy to integrate Leonardo into your favorite MCP workflow.

How to use

Set up your Leonardo MCP Server with a secure API key and run it in your preferred transport mode. If you run it in HTTP mode, expose the server so remote clients can reach it. If you run it in stdio mode, you can connect locally over standard input/output without opening a network port.

How to install

Prerequisites: you need a Leonardo AI API key. You will set this key in the environment as LEONARDO_API_KEY before starting the server.

1) Prepare your environment by exporting your Leonardo API key (replace YOUR_LEONARDO_API_KEY with your actual key):

export LEONARDO_API_KEY=YOUR_LEONARDO_API_KEY

# On Windows PowerShell you would use:
# $env:LEONARDO_API_KEY = "YOUR_LEONARDO_API_KEY"

Additional notes

Configure the MCP server using the provided JSON example. The server can run in stdio mode for local usage or in HTTP mode for remote access. The Leonardo API key must be present in the environment for authentication.

{
  "mcpServers": {
    "leonardo_mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/ish-joshi/leonardo-mcp-server",
        "leonardo-mcp-server",
        "stdio"
      ],
      "env": {
        "LEONARDO_API_KEY": "YOUR_LEONARDO_API_KEY"
      }
    }
  }
}

Security and exposure

When running in HTTP mode, ensure you expose the server only to trusted networks or implement proper authentication and access controls. If you are testing locally, use stdio mode to avoid network exposure.

Troubleshooting

If you encounter authentication errors, double-check that LEONARDO_API_KEY is set in the environment where the server is running. If the HTTP endpoint is not reachable from remote clients, verify your firewall and any tunneling configuration (e.g., ngrok) is correct and that the public URL is used by your MCP client.