# Midjourney Proxy MCP

> MCP server for Midjourney image generation via ImagineAPI

## Overview

This package provides an MCP (Model Context Protocol) server that enables AI assistants to generate Midjourney images through ImagineAPI.

- Repository: https://github.com/YoungjaeDev/midjourney-proxy-mcp
- Documentation: https://youngjaeDev.github.io/midjourney-proxy-mcp/
- PyPI: https://pypi.org/project/midjourney-proxy-mcp/

## Installation

```bash
uvx midjourney-proxy-mcp
# or
pip install midjourney-proxy-mcp
```

## Environment Variables

- IMAGINEAPI_URL: ImagineAPI base URL (default: https://api.imagineapi.dev)
- IMAGINEAPI_TOKEN: API authentication token (required)

## MCP Tools

### midjourney_imagine
Generate an image using Midjourney.

Parameters:
- prompt (string, required): Image generation prompt with Midjourney syntax
- ref (string, optional): Reference ID for tracking

Midjourney parameters supported: --ar, --v, --q, --s, --c, --no, --tile, --seed

### midjourney_get_status
Get image generation status.

Parameters:
- image_id (string, required): Image ID to query

Returns: id, prompt, status, progress, url, upscaled_urls, error

### midjourney_list_images
List recently generated images.

Parameters:
- limit (integer, optional): Maximum number to retrieve (default: 10, max: 100)
- status (string, optional): Filter by status (pending, in-progress, completed, failed)

## MCP Resources

### midjourney://generations
List all recent image generations.

### midjourney://generations/{status}
Filter generations by status (pending, in-progress, completed, failed).

### midjourney://generation/{id}
Get detailed information for a specific generation.

### midjourney://stats
Get generation statistics (total, by_status, completion_rate, recent_24h).

## Image Status Flow

1. pending - Request received, queued
2. in-progress - Midjourney generating (progress % available)
3. completed - Done, upscaled_urls contains 4 images
4. failed - Error occurred, check error field

## Client Configuration

### Claude Desktop
Add to claude_desktop_config.json:
```json
{
  "mcpServers": {
    "midjourney": {
      "command": "uvx",
      "args": ["midjourney-proxy-mcp"],
      "env": {
        "IMAGINEAPI_URL": "https://your-imagineapi.com",
        "IMAGINEAPI_TOKEN": "your-api-token"
      }
    }
  }
}
```

### Claude Code
```bash
claude mcp add midjourney -- uvx midjourney-proxy-mcp
```

## API Reference

Based on ImagineAPI:
- POST /items/images - Create new image
- GET /items/images/{id} - Get image status
- GET /items/images - List images

Authentication: Bearer token in Authorization header
