Jimeng MCP Server logo

Jimeng MCP Server

Community
wwwzhouhui

一个为即梦AI打造的MCP服务器,让Claude、Cherry Studio等AI应用直接调用即梦的AI生成能力。基于jimeng-free-api-all开源项目,提供OpenAI兼容接口。 核心功能:文本生成图像(即梦4.0/3.1)、图像合成(多图融合)、文本生成视频(480p-1080p)、图像生成视频(静态转动态)。 支持三种模式:stdio(Claude Desktop)、SSE(Web)、HTTP REST API(跨平台)。Docker一键部署,开箱即用。异步轮询优化,确保长时间任务稳定完成。 需要Python 3.10+和Docker,配置SessionID即可使用,每日免费66积分。适合AI创作者、开发者学习MCP协议。MIT开源,代码透明。

Publisherwwwzhouhui
Repositoryjimeng-mcp-server
LanguagePython
Forks
21
Stars
82
Available tools
0
Transport typestdio, streamable-http
Categories
Links
  • Connect tools to AI workflows

    Jimeng MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    82 stars and 21 forks from the linked repository.

即梦 MCP 服务器

用于即梦 AI 的模型上下文协议 (MCP) 服务器 - 通过 Claude 和其他 LLM 应用提供强大的图像和视频生成能力

License Python MCP Version


项目介绍

即梦 MCP 服务器是一个专业的 AI 图像和视频生成 MCP 服务器,基于 jimeng-free-api-all 开源项目构建,通过 Claude Desktop、Cherry Studio 和 Claude Code 等 MCP 客户端提供强大的 AI 创作能力。

核心依赖

本项目基于 jimeng-free-api-all 开源项目构建,该项目提供了即梦 AI 的逆向接口实现,支持文生图、图生视频等多种 AI 生成能力。

核心特性

  • 文生图: 使用即梦 4.5 根据文本描述生成高质量图像
  • 图像合成: 基于文本指令将多张图像智能融合
  • 文生视频: 使用即梦视频 3.0 根据文本描述生成短视频片段
  • 图生视频: 为静态图像添加动画效果
  • MCP 协议支持: 标准 MCP 协议,支持多种通信模式
  • 多客户端兼容: 支持 Claude Desktop、Cherry Studio、Claude Code 等

更新日志

v0.2.0 (2024-12-14) - 参数格式同步更新

  • 同步上游 v4.7 更新: 适配 jimeng-free-api-all 最新 API 参数格式
  • 图片接口参数变更:
    • 移除 width、height 参数
    • 新增 ratio 参数:支持 1:1、4:3、3:4、16:9、9:16、3:2、2:3、21:9
    • 新增 resolution 参数:支持 1k、2k(默认)、4k
  • 视频接口参数变更:
    • 移除 width、height 参数
    • 新增 ratio 参数:支持 1:1(默认)、4:3、3:4、16:9、9:16
    • resolution 参数:支持 480p、720p(默认)、1080p
    • 新增 duration 参数:视频时长,支持 5 或 10 秒
  • 默认模型升级: 默认图像模型从 jimeng-4.0 升级为 jimeng-4.5

功能清单

功能名称功能说明技术栈状态
文本生成图像从详细文本提示创建高质量图像jimeng-4.5✅ 稳定
图像合成合成 1-10 张图像,风格迁移和混合jimeng-4.5✅ 稳定
文本生成视频从文本创建动画视频jimeng-video-3.0✅ 稳定
图像生成视频让静态图像动起来jimeng-video-3.0✅ 稳定
stdio 模式标准输入/输出通信MCP 协议✅ 稳定
SSE 模式Server-Sent Events 事件流Starlette✅ 稳定
HTTP 模式RESTful API 接口FastAPI✅ 稳定
多图生成jimeng-4.x 支持智能多图生成即梦 AI✅ 稳定

技术架构

技术版本用途
Python3.10+主要开发语言
MCP1.0+模型上下文协议
httpx0.27+HTTP 客户端
Starlette0.37+ASGI 框架
Uvicorn0.27+ASGI 服务器
sse-starlette1.6+SSE 支持

架构说明

┌─────────────────────────────────────────────────┐
│            Claude Desktop / MCP Client           │
└────────────────────┬────────────────────────────┘
                     │ MCP Protocol
                     ↓
┌─────────────────────────────────────────────────┐
│          jimengmcp (本 MCP 服务器)               │
│    ┌──────────────────────────────────────┐     │
│    │  MCP Protocol Handler (stdio/sse)   │     │
│    └───────────────┬──────────────────────┘     │
│                    ↓                             │
│    ┌──────────────────────────────────────┐     │
│    │     Tool Implementations             │     │
│    │  - text_to_image                     │     │
│    │  - image_composition                 │     │
│    │  - text_to_video                     │     │
│    │  - image_to_video                    │     │
│    └───────────────┬──────────────────────┘     │
└────────────────────┼────────────────────────────┘
                     │ HTTP API Calls
                     ↓
┌─────────────────────────────────────────────────┐
│       jimeng-free-api-all 逆向接口服务            │
│  (https://github.com/wwwzhouhui/                │
│         jimeng-free-api-all)                    │
│    ┌──────────────────────────────────────┐     │
│    │    OpenAI Compatible API Endpoints   │     │
│    │  - POST /v1/images/generations       │     │
│    │  - POST /v1/images/compositions      │     │
│    │  - POST /v1/videos/generations       │     │
│    └───────────────┬──────────────────────┘     │
└────────────────────┼────────────────────────────┘
                     │ 逆向调用
                     ↓
┌─────────────────────────────────────────────────┐
│           即梦 AI 官方服务                        │
│       (https://jimeng.duckcloud.fun)            │
└─────────────────────────────────────────────────┘

安装说明

环境要求

第一步:部署 jimeng-free-api-all 服务

本 MCP 服务器需要先部署底层的 API 服务。

方式一:Docker 部署(推荐)

bash
# 拉取镜像
docker pull wwwzhouhui569/jimeng-free-api-all:latest

# 运行容器
docker run -it -d --init --name jimeng-free-api-all \
  -p 8001:8000 \
  -e TZ=Asia/Shanghai \
  wwwzhouhui569/jimeng-free-api-all:latest

方式二:源码部署

bash
# 克隆 jimeng-free-api-all 项目
git clone https://github.com/wwwzhouhui/jimeng-free-api-all.git
cd jimeng-free-api-all

# 使用 Docker Compose 启动
docker-compose up -d

获取 SessionID:

  1. 访问 即梦官网 并登录
  2. 按 F12 打开浏览器开发者工具
  3. 进入 Application > Cookies
  4. 找到并复制 sessionid 的值
  5. 在后续配置中使用: Authorization: Bearer [your_sessionid]

验证部署:

bash
# 测试 API 是否正常运行
curl http://localhost:8001/v1/models

第二步:安装 jimengmcp MCP 服务器

bash
# 克隆此仓库
git clone https://github.com/wwwzhouhui/jimeng-mcp-server
cd jimeng-mcp-server

基础安装(stdio 模式)

bash
pip install -e .

SSE 模式

bash
pip install -e ".[sse]"

HTTP 模式

bash
pip install -e ".[http]"

完整安装(所有模式)

bash
pip install -e ".[all]"

配置环境变量

bash
cp .env.example .env

编辑 .env 文件:

bash
# 必需: 您的即梦 SessionID (从浏览器 Cookie 中获取)
JIMENG_API_KEY=your_sessionid_here

# 必需: jimeng-free-api-all 服务地址
JIMENG_API_URL=http://localhost:8001

# 可选: 默认使用的模型
JIMENG_MODEL=jimeng-4.5

使用说明

Claude Code 配置

使用 cc-switch 配置:

配置步骤1

配置步骤2

配置完成后,点击保存。

配置步骤3

使用 mcp list 查看:

配置步骤4

在 Claude Code 中使用

文本生成图像示例:

请使用jimeng-mcp-server 生成一张图像:小猪和小狗踢球

文本生成图像

图像合成示例:

请使用jimeng-mcp-server 将这两张图像合成在一起:
- 图像1: https://p3-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/bab623359bd9410da0c1f07897b16fec~tplv-tb4s082cfz-resize:0:0.image
- 图像2: https://p3-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/6acf16d07c47413898aea2bdd1ad339e~tplv-tb4s082cfz-resize:0:0.image
创建一个艺术风格的无缝融合

图像合成

文本生成视频示例:

请使用jimeng-mcp-server 创建一个视频:小马过河

运行模式

本 MCP 服务器支持三种通信模式:

1. stdio 模式(默认)

stdio 模式通过标准输入/输出通信,适合与 Claude Desktop 等 MCP 客户端集成。

bash
python -m jimeng_mcp.server
# 或
python -m jimeng_mcp.server --mode stdio

2. SSE 模式 (Server-Sent Events)

SSE 模式提供基于 HTTP 的事件流,适合 Web 应用集成。

bash
python -m jimeng_mcp.server --mode sse --host 0.0.0.0 --port 8000

连接端点:http://localhost:8000/sse

SSE 模式

3. HTTP REST API 模式

HTTP 模式提供标准的 RESTful API 接口,适合各种编程语言调用。

bash
python -m jimeng_mcp.server --mode http --host 0.0.0.0 --port 8000

可用端点:

  • GET /health - 健康检查
  • GET /tools - 获取可用工具列表
  • POST /text-to-image - 文本生成图像
  • POST /image-composition - 图像合成
  • POST /text-to-video - 文本生成视频
  • POST /image-to-video - 图像生成视频

配置说明

环境变量配置

变量名说明默认值
JIMENG_API_KEY即梦 API SessionID(必填)无
JIMENG_API_URLjimeng-free-api-all 服务地址https://jimeng1.duckcloud.fun
JIMENG_MODEL图像生成的默认模型jimeng-4.5

Cherry Studio 配置

将此服务器添加到 Cherry Studio 配置文件:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{
  "mcpServers": {
    "jimeng": {
      "command": "python",
      "args": ["-m", "jimeng_mcp.server"],
      "env": {
        "JIMENG_API_KEY": "您的API密钥"
      }
    }
  }
}

SSE 配置:

SSE 配置1

SSE 配置2


API 工具参数

text_to_image (文本生成图像)

参数类型必需默认值描述
promptstring是-图像的详细描述,jimeng-4.x 支持多图生成
negative_promptstring否""要在图像中避免的内容
ratiostring否1:1宽高比 (1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9)
resolutionstring否2k分辨率 (1k, 2k, 4k)
sample_strengthfloat否0.5精细度 (0.0-1.0)
modelstring否jimeng-4.5使用的模型

image_composition (图像合成)

参数类型必需默认值描述
promptstring是-如何合成图像
imagesarray是-图像 URL 数组(1-10 张)
ratiostring否1:1输出宽高比
resolutionstring否2k输出分辨率 (1k, 2k, 4k)
sample_strengthfloat否0.5精细度 (0.0-1.0)
modelstring否jimeng-4.5使用的模型

text_to_video (文本生成视频)

参数类型必需默认值描述
promptstring是-视频描述
ratiostring否1:1宽高比 (1:1, 4:3, 3:4, 16:9, 9:16)
resolutionstring否720p分辨率 (480p, 720p, 1080p)
durationinteger否5视频时长 (5 或 10 秒)
modelstring否jimeng-video-3.0使用的模型

image_to_video (图像生成视频)

参数类型必需默认值描述
promptstring是-动画描述
file_pathsarray是-首帧/尾帧图像 URL 数组
ratiostring否1:1宽高比 (1:1, 4:3, 3:4, 16:9, 9:16)
resolutionstring否720p分辨率 (480p, 720p, 1080p)
durationinteger否5视频时长 (5 或 10 秒)
modelstring否jimeng-video-3.0使用的模型

开发指南

运行测试

bash
pytest

直接运行服务器

bash
python -m jimeng_mcp.server

常见问题

A: 确保 .env 文件中的 JIMENG_API_KEY 设置正确,验证您的 API 密钥是否有效且有足够的额度。

A: 检查您的网络连接,验证 API 基础 URL 是否可访问,检查是否有防火墙限制。

A: 视频生成可能需要几分钟时间,服务器已为视频操作自动设置较长超时时间(10 分钟),考虑生成更短的视频或更低的分辨率。

A: 确保 Docker 已安装并运行,检查端口 8001 是否被占用,查看容器日志排查问题。

A: 确保 .env 文件配置正确,使用 mcp list 命令检查 MCP 服务器状态,确认环境变量已正确加载。


技术交流群

欢迎加入技术交流群,分享你的使用心得和反馈建议:

技术交流群


作者联系

微信二维码


打赏

如果这个项目对你有帮助,欢迎请我喝杯咖啡 ☕

微信支付

微信支付


Star History

如果觉得项目不错,欢迎点个 Star ⭐

Star History Chart


License

MIT License


免责声明

本项目仅供学习和研究使用,基于 jimeng-free-api-all 项目构建。

重要提示:

  • ⚠️ 本项目使用的是逆向接口,仅限个人学习研究使用
  • ⚠️ 禁止将本项目用于商业用途或对外提供服务
  • ⚠️ 逆向接口可能随官方更新而失效,请关注项目更新
  • ⚠️ 使用时请遵守即梦 AI 官方的服务条款和使用限制
  • ⚠️ 建议使用官方 API 进行生产环境部署

相关项目

本项目依赖并感谢以下开源项目:

核心依赖

  • jimeng-free-api-all - 即梦 AI 逆向接口实现
    • 提供完整的图像和视频生成 API
    • OpenAI 兼容的接口设计
    • 支持 Docker 一键部署
    • 开源协议: GPL-3.0

技术框架

特别致谢

  • wwwzhouhui - jimeng-free-api-all 项目作者,提供了稳定可靠的即梦 AI 逆向接口
  • Anthropic - 开发了强大的 Claude AI 和 MCP 协议
  • 即梦 AI 团队 - 提供优秀的图像和视频生成能力

Installation

TypingMind
{
  "mcpServers": {
    "jimeng-mcp-server": {
      "command": "python",
      "args": [
        "-m",
        "jimeng_mcp.server"
      ]
    }
  }
}

Use Jimeng MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Jimeng MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Jimeng MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Jimeng MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "jimeng-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Jimeng MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Jimeng MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Jimeng MCP Server to help me with this task?
Jimeng MCP Server
Sure. I read it.
Here is what I found using Jimeng MCP Server.

Option 2: Add an MCP server URL

Use this when Jimeng MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for Jimeng MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Jimeng MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Jimeng MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Jimeng MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Jimeng MCP Server to help me with this task?
Jimeng MCP Server
Sure. I read it.
Here is what I found using Jimeng MCP Server.

Frequently asked questions

What is the Jimeng MCP Server MCP server used for?

Jimeng MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Jimeng MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Jimeng MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Jimeng MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Jimeng MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Jimeng MCP Server MCP to TypingMind?

Jimeng MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Jimeng MCP Server MCP provide in TypingMind?

Jimeng MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Jimeng MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Jimeng MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇