midjourney-mcp-web

midjourney-mcp-web

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

Category
访问服务器

README

Midjourney MCP Web

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选