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 🙏

© 2026 – Pkg Stats / Ryan Hefner

glm-cogvideo-mcp

v1.0.4

Published

智谱AI视频生成API的MCP服务器封装 (glm-cogvideo-mcp)

Readme

Glm CogVideo - 智谱AI视频生成MCP服务器 (glm-cogvideo-mcp)

这是一个基于Model Context Protocol (MCP)的智谱AI CogVideoX-3视频生成API封装服务器。

功能特性

  • 🎬 使用智谱AI CogVideoX-3模型生成视频
  • 🔄 自动轮询任务结果,无需手动查询
  • 🚀 支持通过npx快速启动
  • ⚙️ 简单的配置方式,所有参数都有合理的默认值

安装

方式1: 通过npx使用(推荐)

无需安装,直接在MCP配置文件中使用npx即可。

方式2: 全局安装

npm install -g glm-cogvideo-mcp

配置

获取API密钥

  1. 访问智谱AI开放平台
  2. 注册并登录账号
  3. 在控制台创建API密钥

配置MCP客户端

在你的MCP客户端配置文件中添加以下配置:

Claude Desktop配置示例

编辑 claude_desktop_config.json:

{
  "mcpServers": {
    "glm-cogvideo-mcp": {
      "command": "npx",
      "args": ["-y", "glm-cogvideo-mcp"],
      "env": {
        "ZHIPU_API_KEY": "你的智谱API密钥"
      }
    }
  }
}

可用工具

generate_video

生成视频并自动等待完成。该工具会自动提交任务并轮询结果,直到视频生成完成或超时。

参数:

  • prompt (必需): 视频内容的文本描述,详细描述你想要生成的视频内容
  • quality (可选): 视频质量设置,可选值:"quality"(高质量)。默认值:quality
  • with_audio (可选): 是否生成音频。默认值:true
  • size (可选): 视频分辨率。默认值:1920x1080
    • 支持的分辨率:
      • 1280x720 - 高清横屏
      • 720x1280 - 高清竖屏
      • 1024x1024 - 正方形
      • 1920x1080 - 全高清横屏(默认)
      • 1080x1920 - 全高清竖屏
      • 2048x1080 - 超宽屏
      • 3840x2160 - 4K超高清
  • fps (可选): 视频帧率。默认值:30
    • 可选值:3060
  • duration (可选): 视频时长(秒)。默认值:5
    • 可选值:510
  • watermark_enabled (可选): 是否添加水印。默认值:false

最简示例(仅需提示词):

{
  "prompt": "一只可爱的橘猫在阳光下玩毛线球"
}

完整参数示例:

{
  "prompt": "一只可爱的橘猫在阳光下玩毛线球",
  "quality": "quality",
  "with_audio": true,
  "size": "1920x1080",
  "fps": 30,
  "duration": 5,
  "watermark_enabled": false
}

返回结果:

{
  "success": true,
  "message": "视频生成成功",
  "data": {
    "task_id": "任务ID",
    "request_id": "请求ID",
    "model": "cogvideox-3",
    "status": "completed",
    "created": 1234567890,
    "video_result": [
      {
        "video_url": "https://...",
        "cover_image_url": "https://..."
      }
    ],
    "usage": {
      "prompt_tokens": 100,
      "completion_tokens": 0,
      "total_tokens": 100
    }
  }
}

使用流程

  1. 调用工具:只需调用 generate_video 工具,传入提示词(prompt)
  2. 自动等待:工具会自动提交任务并每3秒轮询一次结果
  3. 获取视频:生成完成后,直接从返回结果的 video_result 中获取视频URL和封面图URL

注意事项:

  • 视频生成通常需要几分钟时间,工具会自动等待
  • 最多轮询200次(约10分钟),如果超时会报错
  • 轮询过程会在控制台输出进度信息

开发

本地构建

# 安装依赖
npm install

# 构建项目
npm run build

# 开发模式(监听文件变化)
npm run dev

发布到npm

# 登录npm账号
npm login

# 发布包
npm publish

技术栈

  • TypeScript
  • Model Context Protocol (MCP) SDK
  • 智谱AI API

许可证

MIT

相关链接