@contenthero/mcp

中文文档
0.4.50发布于 2026/11/07MITTypeScriptES Module近 30 天下载 4444

Official ContentHero MCP server. Generate images, video, and audio from any MCP client (Claude Code, Claude Desktop, etc.) using your ContentHero API key.

原始使用文档
文档目录9 节
  1. Tools
  2. Setup
  3. Claude Code
  4. Claude Desktop / generic MCP config
  5. Environment
  6. Usage
  7. How it works
  8. Image controls and discovery
  9. Video draft controls

@contenthero/mcp

Official ContentHero MCP server. Generate images, video, and audio from any MCP client (Claude Code, Claude Desktop, ...) using your ContentHero API key.

Tools

ToolWhat it does
generate_imageGenerate images from a prompt (or image-to-image). Waits for the result and returns the URLs.
generate_videoGenerate video from a prompt (or start/end frame, references). Returns at once with an outputId; get_status waits for the render.
generate_audioElevenLabs speech (TTS), music, or sound effects. Synchronous: returns the audio URL directly.
get_statusWait for any background job by the id that started it (a generation's outputId gives its final URLs).
get_accountYour ContentHero account: balance, spend this month, the monthly spend cap, plan and auto top-up.
update_accountChange an account setting (today: the monthly spend cap).

Three intent-shaped generate tools (not one generate_media): image and video share the async smart-wait lifecycle, audio shares almost nothing and runs synchronously, and per-tool modelId enums keep each schema clean.

Setup

Requires Node 20+. You need a ContentHero API key (ch_live_...).

Claude Code

claude mcp add contenthero --env CONTENTHERO_API_KEY=ch_live_xxx -- npx -y @contenthero/mcp

Claude Desktop / generic MCP config

{
  "mcpServers": {
    "contenthero": {
      "command": "npx",
      "args": ["-y", "@contenthero/mcp"],
      "env": { "CONTENTHERO_API_KEY": "ch_live_xxx" }
    }
  }
}

Environment

VariableRequiredDefault
CONTENTHERO_API_KEYyes-
CONTENTHERO_BASE_URLnohttps://app.contenthero.ai

Usage

Once connected, just ask in natural language. The agent picks the tool and model:

"Generate a 16:9 image of a golden retriever astronaut with <imageModelId>."

"Make an 8 second video of a city at dusk with audio using <videoModelId>."

"Read this script aloud with ElevenLabs voice <id>."

Images return in one turn (~15s). Video either returns inline or hands back an outputId; the agent then calls get_status to fetch the final URLs. Insufficient credits, invalid parameters, and unknown models come back as readable tool errors.

How it works

This server is a thin wrapper over @contenthero/sdk, which talks to the ContentHero /api/v1 surface. Your API key resolves your account server-side; the server never sends a user id. Pricing is computed server-side.

Image controls and discovery

The existing generate_image tool accepts quality, outputFormat, background, frameCount, frameDurationMs, and frameSize. Read list_models and get_model for each model's current choices, defaults, setting conditions, reference and transparency formats, and GIF sheet rules. Use numeric or string frame counts according to the declared control. Send GIF fields only for GIF output. getCost previews the same request without generating. Server refusals retain their specific message.

Video draft controls

Discover the model declaration before generating. Model lists and details include accepted inputs, input modes, the declared Draft resolution, and upgrade resolution and availability when declared. Upgrade a completed draft owned by the caller while it remains available. Shot settings are inherited and cannot change. The server enforces ownership, completion, expiration and whether the selected draft output already has an upgrade.

generate_video accepts draft, upgradeFromOutputId, upgradeSlot, outputFormat and returnLastFrame. Draft and upgrade output options map to the API parameters bag. Source identifiers remain top level. Pass getCost to preview the same request without generating.

For generate_lip_sync, read get_model first. Supply imageUrl for a model declaring singleImage, or referenceVideos for a model declaring singleVideo. Add audioUrl, or script with voiceId. Pass getCost to preview the same request. The server validates the source required by the model.

版本与发布记录

@contenthero/mcp 共发布 70 个版本,首次发布于 2026/06/12;过去 12 个月发布了 70 个版本。

版本发布日期距今
0.4.50latest2026/11/073 天前
0.4.492026/11/019 天前
0.4.482026/10/3110 天前
0.4.472026/10/2912 天前
0.4.462026/10/2912 天前
0.4.452026/10/2813 天前

关于 @contenthero/mcp 的常见问题

@contenthero/mcp 是什么?

Official ContentHero MCP server. Generate images, video, and audio from any MCP client (Claude Code, Claude Desktop, etc.) using your ContentHero API key.

如何安装 @contenthero/mcp?

在项目目录运行 npm install @contenthero/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 contenthero-mcp,可以用 npx contenthero-mcp 直接运行。

@contenthero/mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@contenthero/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@contenthero/mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@contenthero/mcp 可以商用吗?

@contenthero/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@contenthero/mcp 的下载量有多少?

根据 npm 官方下载统计,@contenthero/mcp 在 2026/10/11 – 2026/11/09 这 30 天内被下载 4,444 次,日均约 148 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@contenthero/mcp 还在维护吗?

最新版本 0.4.50 发布于 2026/11/07(3 天前);至今共发布 70 个版本,其中过去 12 个月发布了 70 个;首次发布于 2026/06/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。