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

@mcpcn/video-mcp

v1.0.14

Published

MCP Server for Sora video generation API integration

Readme

Sora 视频生成 MCP 服务器

这是一个基于云雾 API 的 Sora 视频生成 MCP 服务器,提供强大的 AI 视频生成能力。

✨ 功能特性

  • 🎬 文生视频: 仅使用文本提示词即可生成精彩视频
  • 🖼️ 图生视频: 结合图片和提示词生成动态视频内容
  • 📊 任务查询: 实时查询视频生成任务的状态和结果
  • 🎯 灵活配置: 支持横屏/竖屏、多种清晰度和时长选择

📦 安装

# 安装依赖
npm install

# 构建项目
npm run build

⚙️ 配置

1. 创建环境变量文件

cp .env.example .env

2. 配置 API 密钥

编辑 .env 文件,填入你的云雾 API 密钥:

YUNWU_API_KEY=your_api_key_here
YUNWU_BASE_URL=https://yunwu.ai

💡 获取 API 密钥: 访问 云雾 AI 注册账号并获取 API 密钥

🚀 使用方法

在 Claude Desktop 中使用

  1. 找到 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 添加以下配置:

{
  "mcpServers": {
    "sora-video": {
      "command": "node",
      "args": ["/完整路径/视频生成/build/index.js"],
      "env": {
        "YUNWU_API_KEY": "your_api_key_here",
        "YUNWU_BASE_URL": "https://yunwu.ai"
      }
    }
  }
}
  1. 重启 Claude Desktop

命令行运行

# 设置环境变量
export YUNWU_API_KEY=your_api_key_here
export YUNWU_BASE_URL=https://yunwu.ai

# 运行服务器
npm start

🛠️ 可用工具

1. 创建文生视频 (create_video)

使用文本描述生成视频。

参数说明:

| 参数 | 类型 | 必需 | 说明 | 默认值 | |------|------|------|------|--------| | prompt | string | ✅ | 视频内容描述 | - | | model | string | ❌ | 模型名称 | sora-2 | | orientation | string | ❌ | 视频方向: portrait(竖屏) / landscape(横屏) | portrait | | size | string | ❌ | 视频质量: small(720p) / large(1080p) | small | | duration | string | ❌ | 视频时长: 10 / 15 秒 | - |

使用示例:

{
  "prompt": "一只金色的拉布拉多犬在海滩上奔跑,夕阳西下,海浪拍打着沙滩",
  "orientation": "landscape",
  "size": "large",
  "duration": "15"
}

2. 创建图生视频 (create_video_with_images)

使用图片和文本描述生成视频。

参数说明:

| 参数 | 类型 | 必需 | 说明 | 默认值 | |------|------|------|------|--------| | prompt | string | ✅ | 视频内容描述 | - | | images | string[] | ✅ | 图片 URL 数组 | - | | model | string | ❌ | 模型名称 | sora-2 | | orientation | string | ❌ | 视频方向 | portrait | | size | string | ❌ | 视频质量 | small | | duration | string | ❌ | 视频时长 | - |

使用示例:

{
  "prompt": "让这些图片中的场景动起来,添加自然的过渡效果",
  "images": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "orientation": "portrait",
  "size": "large",
  "duration": "10"
}

3. 查询任务状态 (query_video_task)

查询视频生成任务的进度和结果。

参数说明:

| 参数 | 类型 | 必需 | 说明 | |------|------|------|------| | id | string | ✅ | 任务 ID (格式: sora-2:task_xxx) |

使用示例:

{
  "id": "sora-2:task_01k6x15vhrff09dkkqjrzwhm60"
}

任务状态说明:

  • pending - 任务处理中,请稍候
  • completed - 任务已完成,可获取视频 URL
  • failed - 任务失败

📚 工作流程

  1. 创建任务: 使用 create_videocreate_video_with_images 创建视频生成任务
  2. 获取任务 ID: 任务创建成功后会返回任务 ID
  3. 轮询查询: 使用 query_video_task 定期查询任务状态
  4. 获取结果: 任务完成后,从返回结果中获取视频 URL

🔧 开发

# 开发模式 (监视文件变化,自动重新编译)
npm run dev

# 编译构建
npm run build

# 运行服务
npm start

📖 相关文档

💡 使用建议

  1. 提示词优化: 详细、具体的提示词能够生成更好的视频效果
  2. 图片质量: 使用清晰、高质量的图片作为输入可以获得更好的结果
  3. 合理选择参数: 根据需求选择合适的分辨率和时长,避免不必要的资源消耗
  4. 任务查询频率: 建议每 5-10 秒查询一次任务状态,避免过于频繁的请求

⚠️ 注意事项

  • 确保 API 密钥有足够的余额
  • 视频生成可能需要较长时间,请耐心等待
  • 图片 URL 必须是公开可访问的
  • 遵守云雾 API 的使用条款和限制

📄 许可证

MIT License

🤝 贡献

欢迎提交 Issue 和 Pull Request!


注意: 本项目仅供学习和研究使用,请遵守相关法律法规和平台使用条款。