npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@iflow-mcp/media-gen-mcp

v1.0.2

Published

MCP server for media generation

Readme

Media Generator MCP Server

基于 fastmcp 的 MCP 服务,集成阿里云百炼平台通义万相模型实现文生图和文生视频功能。

安装

npm install

配置

  1. 复制 .env.example.env
  2. 填入DashScope API密钥:
    DASHSCOPE_API_KEY=你的DashScope_API密钥

使用

开发模式

npm run dev

构建

npm run build

运行

npm start                     # stdio模式(默认)
npm start stream              # HTTP流模式(端口8080)

功能

1. 生成图片 (generate_image)

根据文本描述生成图片。

参数:

  • prompt (必填): 图片文本描述
  • negative_prompt (可选): 不希望在图片中出现的内容描述
  • size (可选): 图片尺寸,可选值:
    • 1024*1024 (默认)
    • 720*1280
    • 1280*720
    • 768*1152
    • 1152*768
    • 512*512
    • 1440*1440
  • n (可选): 生成图片数量,1-4,默认1
  • seed (可选): 随机种子,用于生成可重复的结果
  • prompt_extend (可选): 是否启用提示词智能改写,默认true
  • watermark (可选): 是否添加AI生成水印,默认false

2. 生成视频 (generate_video)

根据文本描述生成视频。

参数:

  • prompt (必填): 视频文本描述
  • negative_prompt (可选): 不希望在视频中出现的内内容描述
  • size (可选): 视频分辨率,可选值:
    • 1920*1080 (默认,1080P横屏)
    • 1080*1920 (1080P竖屏)
    • 1440*1440 (1080P方形)
    • 1632*1248 (1080P 4:3)
    • 1248*1632 (1080P 3:4)
    • 1280*720 (720P横屏)
    • 720*1280 (720P竖屏)
    • 960*960 (720P方形)
    • 1088*832 (720P 4:3)
    • 832*1088 (720P 3:4)
    • 832*480 (480P横屏)
    • 480*832 (480P竖屏)
    • 624*624 (480P方形)
  • model (可选): 视频模型,可选值:
    • wan2.2-t2v-plus (默认)
    • wanx2.1-t2v-turbo
    • wanx2.1-t2v-plus
  • seed (可选): 随机种子,用于生成可重复的结果
  • prompt_extend (可选): 是否启用提示词智能改写,默认true
  • watermark (可选): 是否添加AI生成水印,默认false

示例

生成图片

生成一张猫的图片:

{
  "prompt": "一只可爱的橘猫坐在窗台上晒太阳",
  "size": "1024*1024"
}

生成视频

生成一只小猫在月光下奔跑的视频:

{
  "prompt": "一只小猫在月光下奔跑,水墨画风格,背景是古色古香的中式庭院",
  "size": "1920*1080",
  "model": "wan2.2-t2v-plus"
}

MCP服务配置

Claude Desktop 配置

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "media-gen": {
      "command": "npx",
      "args": ["-y", "media-gen-mcp"],
      "env": {
        "DASHSCOPE_API_KEY": "你的DashScope_API密钥"
      }
    }
  }
}

Cursor 配置

.cursor/mcp.json 中添加:

{
  "mcpServers": {
    "media-gen": {
      "command": "npx",
      "args": ["-y", "media-gen-mcp"],
      "env": {
        "DASHSCOPE_API_KEY": "你的DashScope_API密钥"
      }
    }
  }
}

VS Code 配置

settings.json 中添加:

{
  "mcp": {
    "servers": {
      "media-gen": {
        "command": "npx",
        "args": ["-y", "media-gen-mcp"],
        "env": {
          "DASHSCOPE_API_KEY": "你的DashScope_API密钥"
        }
      }
    }
  }
}

HTTP模式使用

如需通过HTTP使用,先运行:

npm run build
npm start stream

然后配置MCP客户端连接到 http://localhost:8080