Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Midjourney Web

FreeNot checked

Unofficial MCP server for generating images via Midjourney web app using authentication cookies. Enables text-to-image generation with customizable parameters.

GitHubEmbed

About

Unofficial MCP server for generating images via Midjourney web app using authentication cookies. Enables text-to-image generation with customizable parameters.

README

Unofficial Model Context Protocol (MCP) server for generating images through the Midjourney web app using your own signed-in browser authentication cookies.

This project is a cleaned-up and modernized fork of Lala-0x3f/mj-mcp. It keeps the same simple MCP surface, but updates the web flow for the current Midjourney site:

  • submits jobs to /api/submit-jobs
  • reads the Midjourney user id from the signed-in web page
  • polls /api/imagine instead of relying on the now-blocked websocket path
  • defaults to --v 8.1

This project is not affiliated with, endorsed by, or supported by Midjourney.

Tool

The server exposes one MCP tool:

generating_image(prompt: str, aspect_ratio: str) -> str

The response is Markdown with four Midjourney CDN image URLs.

Requirements

  • Python 3.10+
  • uv or another Python package runner
  • A Midjourney account with access to the web app
  • Your own __Host-Midjourney.AuthUserTokenV3_r and __Host-Midjourney.AuthUserTokenV3_i cookie values

Install From GitHub

uvx --from git+https://github.com/WilliamJizh/midjourney-mcp-web midjourney-mcp-web

For local development:

git clone https://github.com/WilliamJizh/midjourney-mcp-web.git
cd midjourney-mcp-web
uv run --with-editable . python -m midjourney_mcp_web

Configuration

The server reads configuration from environment variables.

Variable Required Default Description
TOKEN_R Yes Value of __Host-Midjourney.AuthUserTokenV3_r
TOKEN_I Yes Value of __Host-Midjourney.AuthUserTokenV3_i
API_BASE No www.midjourney.com Midjourney web host
SUFFIX No --v 8.1 Parameters appended to every prompt
MJ_JOB_TIMEOUT_SEC No 300 Polling timeout for completed job visibility
CHANNEL_ID No singleplayer_<user_id> Override channel id

Never commit real token values. Treat both tokens as secrets.

Codex Config Example

[mcp_servers.midjourney]
command = "uvx"
args = ["--from", "git+https://github.com/WilliamJizh/midjourney-mcp-web", "midjourney-mcp-web"]

[mcp_servers.midjourney.env]
TOKEN_R = "replace_with_midjourney_cookie_r"
TOKEN_I = "replace_with_midjourney_cookie_i"
SUFFIX = "--v 8.1"

For better local security on macOS, store the tokens in Keychain and use a small wrapper script that exports TOKEN_R and TOKEN_I before launching this server. Do not publish that wrapper with real values.

Claude Desktop Config Example

{
  "mcpServers": {
    "midjourney": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/WilliamJizh/midjourney-mcp-web",
        "midjourney-mcp-web"
      ],
      "env": {
        "TOKEN_R": "replace_with_midjourney_cookie_r",
        "TOKEN_I": "replace_with_midjourney_cookie_i",
        "SUFFIX": "--v 8.1"
      }
    }
  }
}

Getting Cookie Values

  1. Open https://www.midjourney.com/explore?tab=top while signed in.
  2. Open browser developer tools.
  3. Go to Application or Storage.
  4. Open Cookies for https://www.midjourney.com.
  5. Copy the values for:
    • __Host-Midjourney.AuthUserTokenV3_r
    • __Host-Midjourney.AuthUserTokenV3_i

Do not paste these values into public chats, issues, logs, or commits.

Example Prompt

A peaceful impressionist garden with water lilies and soft morning light --stylize 200

Call the MCP tool with:

{
  "prompt": "A peaceful impressionist garden with water lilies and soft morning light --stylize 200",
  "aspect_ratio": "3:4"
}

The server appends:

--ar 3:4 --v 8.1

unless you override SUFFIX.

Development

uv run --extra dev pytest
uv run --extra dev python -m build

Run a no-secret source scan before publishing:

git grep -n -I -E 'TOKEN_R=|TOKEN_I=|AuthUserTokenV3_[ri]=[^\"[:space:]]+|gho_|sk-[A-Za-z0-9]|BEGIN (RSA|OPENSSH|PRIVATE) KEY'

Limitations

  • Midjourney web APIs are not public APIs and may change without notice.
  • The server uses your own Midjourney account and may consume GPU time.
  • The returned URLs point to Midjourney CDN assets.
  • This does not upload reference images; it is text-prompt only.

License

GPL-3.0-or-later. See LICENSE.

from github.com/WilliamJizh/midjourney-mcp-web

Installing Midjourney Web

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/WilliamJizh/midjourney-mcp-web

FAQ

Is Midjourney Web MCP free?

Yes, Midjourney Web MCP is free — one-click install via Unyly at no cost.

Does Midjourney Web need an API key?

No, Midjourney Web runs without API keys or environment variables.

Is Midjourney Web hosted or self-hosted?

A hosted option is available: Unyly runs the server in the cloud, no local setup required.

How do I install Midjourney Web in Claude Desktop, Claude Code or Cursor?

Open Midjourney Web on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Midjourney Web with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All media MCPs