Skip to main content
Glama

Midjourney MCP Server

by z23cc

🎨 Midjourney MCP Server

一个功能完整的 Midjourney MCP (Model Context Protocol) 服务器,通过 GPTNB API 提供 Midjourney 图像生成功能。

✨ 特性

  • 🖼️ 图像生成: 通过文本提示生成高质量图像
  • 🔄 图像变换: 支持放大、变体、重新生成等操作
  • 🎭 高级编辑: 缩放、平移、修复等编辑功能
  • 👥 人脸替换: 智能人脸交换功能
  • 📝 图像描述: AI 图像内容分析
  • 🔧 提示优化: 智能提示词优化建议
  • 📊 任务管理: 简洁高效的任务状态跟踪

🚀 快速开始

环境要求

  • Python 3.10+
  • pip
  • Node.js (用于 MCP Inspector,可选)

安装

# 克隆项目 git clone <repository-url> cd mj-mcp # 安装依赖 pip install -r requirements.txt # 或安装为可编辑包 pip install -e .

配置

设置环境变量:

# Windows set GPTNB_API_KEY=your_api_key_here set GPTNB_BASE_URL=https://aiclound.vip # Linux/Mac export GPTNB_API_KEY=your_api_key_here export GPTNB_BASE_URL=https://aiclound.vip

或创建 .env 文件:

GPTNB_API_KEY=your_api_key_here GPTNB_BASE_URL=https://aiclound.vip

🚀 运行

启动服务器

# 直接运行 python src/server.py # 或使用MCP开发工具 npx @modelcontextprotocol/inspector python src/server.py

🛠️ 可用工具 (7个)

核心图像生成工具 (6个)

工具名称描述主要参数
imagine_image生成图像prompt, aspect_ratio, base64_images
blend_images混合图像base64_images, dimensions
describe_image描述图像base64_image
change_image图像变换task_id, action, index
modal_edit高级编辑task_id, action, prompt
swap_face人脸替换source_image, target_image

任务管理工具 (1个)

工具名称描述主要参数
get_task_status任务状态查询task_id

📁 项目结构

mj-mcp/ ├── src/ # 源代码目录 │ ├── server.py # MCP 服务器主入口 │ ├── client.py # GPTNB API 客户端 │ ├── service.py # 业务逻辑服务 │ ├── config.py # 配置管理 │ ├── models.py # 数据模型 │ ├── task_handler.py # 任务处理器 │ ├── exceptions.py # 异常定义 │ └── utils.py # 工具函数 ├── requirements.txt # 项目依赖 ├── setup.py # 安装配置 └── README.md # 项目文档

🔧 开发

代码结构

项目采用简化的扁平化结构,符合 MCP 协议最佳实践:

  • 无包结构: 移除了不必要的 __init__.py__main__.py
  • 直接入口: 通过 python src/server.py 直接启动
  • 现代依赖: 使用最新版本的 MCP SDK (1.9.1)
  • 简洁配置: 使用传统的 requirements.txt 管理依赖
  • 精简工具集: 7个核心工具,专注于实用功能,避免冗余

📝 使用示例

基本图像生成

# 通过 MCP 客户端调用 result = await session.call_tool("imagine_image", { "prompt": "a beautiful sunset over mountains, digital art", "aspect_ratio": "16:9" })

图像变体

# 生成变体 result = await session.call_tool("change_image", { "task_id": "previous_task_id", "action": "VARIATION", "index": 1 })

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

GPL-3.0 License

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A complete Midjourney MCP server that provides image generation features through the GPTNB API, including text-to-image generation, image transformations, advanced editing, and face swapping capabilities.

  1. ✨ 特性
    1. 🚀 快速开始
      1. 环境要求
      2. 安装
      3. 配置
    2. 🚀 运行
      1. 启动服务器
    3. 🛠️ 可用工具 (7个)
      1. 核心图像生成工具 (6个)
      2. 任务管理工具 (1个)
    4. 📁 项目结构
      1. 🔧 开发
        1. 代码结构
      2. 📝 使用示例
        1. 基本图像生成
        2. 图像变体
      3. 🤝 贡献
        1. 📄 许可证

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A MCP server that integrates with Cursor IDE to generate images based on text descriptions using JiMeng AI, allowing users to create and save custom images directly within their development environment.
            Last updated -
            188
            Python
            MIT License
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            An MCP Server that integrates with Stability AI's API to provide high-quality image generation, editing, and manipulation capabilities including background removal, outpainting, search-and-replace, and upscaling.
            Last updated -
            13
            552
            73
            TypeScript
            MIT License
            • Apple
          • -
            security
            A
            license
            -
            quality
            An MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.
            Last updated -
            52
            TypeScript
            MIT License
            • Linux
            • Apple
          • A
            security
            A
            license
            A
            quality
            An MCP server that integrates with Recraft AI to enable generation and manipulation of high-quality raster and vector images through tools like image generation, editing, vectorization, background removal, and upscaling.
            Last updated -
            9
            544
            20
            TypeScript
            MIT License

          View all related MCP servers

          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/z23cc/midjourney-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server