Content Engine
AI-powered content creation as a service. Generate scripts, images, and videos from any topic.
This is an MCP server accessible via Streamable HTTP transport. Any MCP-compatible client can connect to it directly — no proprietary CLI or binary required. Free tools work without credentials. Paid tools use the x402 protocol for per-request USDC payments.
Connection
Content Engine is a standard MCP server. Connect using any MCP client that supports Streamable HTTP transport.
MCP endpoint: INLINECODE0
Server discovery: INLINECODE1
No special binary, CLI tool, or SDK is required. The server follows the MCP specification and works with any compliant client.
Required Environment Variables
| Variable | Required | Description |
|---|
| INLINECODE2 | Yes | MCP server URL. Default: INLINECODE3 |
| INLINECODE4 |
For paid tools | Private key for an EVM wallet holding USDC on Base. Used by the x402 client library to sign payment authorizations.
Only needed if calling paid tools. Free tools work without it. |
Important: WALLET_PRIVATE_KEY gives the x402 client library the ability to sign USDC transfer authorizations. This key should be for a dedicated agent wallet with limited funds — not a primary wallet. See the Payment section for details on how funds are protected.
Payment — How It Works
Paid tools use the x402 payment protocol for USDC payments on the Base network (EIP-155 chain 8453).
The agent controls every payment
No funds are ever auto-debited. The payment flow is:
- 1. Agent calls a paid tool (e.g.
create_script) - Server responds with HTTP 402 Payment Required containing the exact USDC amount, recipient wallet, and network
- The agent's x402 client library reads the 402 response and presents the payment for authorization — the agent decides whether to sign
- If the agent authorizes, the client signs a USDC transfer for the exact amount specified and retries the request with the signed payment proof
- Server verifies the payment, settles the transaction on-chain, and processes the request
Each payment is explicit, per-request, and for an exact amount. The server cannot withdraw funds, charge more than the stated amount, or initiate payments. The agent (or its x402 client) must actively sign each transaction.
What the agent needs
To make paid calls, the agent's HTTP client must support x402. The recommended approach:
CODEBLOCK0
The wrapped fetch handles the 402 challenge-response cycle. Free tools work with plain fetch — no wallet needed.
Cost control
- - Call
get_quote (free) before any paid tool to see the exact USDC price and per-stage breakdown - Call
get_pricing (free) to see all current rates - Call
get_queue_status (free) to check daily budget remaining - Use a dedicated wallet with limited USDC to cap total exposure
- Use sandbox mode to test without any payment (see below)
Typical Pricing
Pricing is dynamic — costs vary based on video duration, narration, and effects.
| Operation | Typical Cost (USDC) | Varies By |
|---|
| Script generation | $0.10–$0.20 | Prompt complexity |
| Image generation |
$0.15 | Fixed per image |
| Video generation | $0.50–$2.00 | Duration, shots, talking heads |
| Full pipeline (60s) | $1.50–$2.00 | Duration, narration, effects |
| Publishing | $0.10–$0.15 | Fixed |
Always call get_quote with your parameters for the exact price.
Sandbox Mode (Free Testing)
Test the full API flow without payment, wallet, or USDC. Send Authorization: Bearer sandbox with any paid request to receive a mock response with the real cost quote attached.
CODEBLOCK1
Sandbox mode returns:
- - The exact USDC price you would pay
- A per-stage cost breakdown showing which AI services are used
- The response structure your agent should expect from real calls
- Mock IDs (
content_id, jobId, transactionId) matching the real format
Sandbox mode does not create content, charge USDC, require a wallet, or count toward rate limits.
Available Tools
Free (no payment or credentials required)
| Tool | Description |
|---|
| INLINECODE17 | Live USDC pricing for all operations |
| INLINECODE18 |
Exact cost quote with per-stage breakdown for specific parameters |
|
get_queue_status | Queue position, active jobs, daily budget remaining |
|
get_content | Full content item details including video URL and metadata |
|
get_content_status | Lightweight status poll (pipeline stage + completion %) |
Paid (x402 USDC — agent approves each payment)
| Tool | Description |
|---|
| INLINECODE22 | Generate AI video script from topic. Returns content_id for tracking. |
| INLINECODE24 |
Generate image from text prompt via Runway ML. Supports style and aspect ratio. |
|
create_video | Generate video from a completed script. Requires
content_id from
create_script. |
|
run_full_pipeline | End-to-end: script + video from a single topic. Fastest path to finished video. |
|
publish_content | Publish to YouTube, X, TikTok, Instagram, LinkedIn. |
Typical Workflow
Quick path
CODEBLOCK2
Step-by-step path
- 1.
get_quote operation="script" — See exact price - INLINECODE31 — Generate script, save returned INLINECODE32
- INLINECODE33 — Poll until complete
- INLINECODE34 — See exact price for video
- INLINECODE35 — Generate video
- INLINECODE36 — Poll until ready (1–5 min)
- INLINECODE37 — Retrieve video URL and metadata
Important Notes
- - Video generation takes 1–5 minutes. Always poll
get_content_status rather than assuming instant completion. - The
content_id (UUID) returned by creation tools is the key for all subsequent operations. - Pricing is dynamic — always call
get_quote before paid operations to see the exact cost. - Use sandbox mode (
Authorization: Bearer sandbox) to test without spending USDC. - Use a dedicated agent wallet with limited funds — do not use a primary wallet.
内容引擎
AI驱动的内容创作服务。从任意主题生成脚本、图片和视频。
这是一个通过流式HTTP传输访问的MCP服务器。任何兼容MCP的客户端都可以直接连接——无需专有CLI或二进制文件。免费工具无需凭证即可使用。付费工具使用x402协议进行按次USDC支付。
连接
内容引擎是一个标准的MCP服务器。使用任何支持流式HTTP传输的MCP客户端进行连接。
MCP端点: https://content-engine-x402.fly.dev/mcp
服务器发现: https://content-engine-x402.fly.dev/.well-known/mcp.json
无需特殊二进制文件、CLI工具或SDK。该服务器遵循MCP规范,可与任何兼容客户端配合使用。
必需的环境变量
| 变量 | 必需 | 描述 |
|---|
| CONTENTENGINEURL | 是 | MCP服务器URL。默认值:https://content-engine-x402.fly.dev |
| WALLETPRIVATEKEY |
仅付费工具 | 在Base网络上持有USDC的EVM钱包私钥。由x402客户端库用于签署支付授权。
仅在调用付费工具时需要。 免费工具无需此变量。 |
重要提示: WALLETPRIVATEKEY赋予x402客户端库签署USDC转账授权的能力。此密钥应属于一个资金有限的专用代理钱包——而非主钱包。有关资金保护方式的详细信息,请参阅支付部分。
支付——工作原理
付费工具使用x402支付协议在Base网络(EIP-155链8453)上进行USDC支付。
代理控制每笔支付
资金永远不会自动扣款。 支付流程如下:
- 1. 代理调用付费工具(例如create_script)
- 服务器响应HTTP 402 Payment Required,包含确切的USDC金额、收款钱包和网络信息
- 代理的x402客户端库读取402响应并呈现支付请求以供授权——代理决定是否签署
- 如果代理授权,客户端签署指定确切金额的USDC转账,并使用签署的支付证明重试请求
- 服务器验证支付,在链上结算交易,并处理请求
每笔支付都是明确的、按次的,且金额精确。 服务器无法提取资金、收取超出规定金额的费用或发起支付。代理(或其x402客户端)必须主动签署每笔交易。
代理需要什么
要进行付费调用,代理的HTTP客户端必须支持x402。推荐方法:
typescript
import { wrapFetch } from @x402/fetch;
import { createWalletClient, http } from viem;
import { privateKeyToAccount } from viem/accounts;
import { base } from viem/chains;
// 从专用代理钱包密钥创建钱包
const account = privateKeyToAccount(process.env.WALLETPRIVATEKEY);
const wallet = createWalletClient({ account, chain: base, transport: http() });
// 包装fetch——付费请求通过402→签名→重试处理
const x402fetch = wrapFetch(fetch, wallet, eip155:8453);
包装后的fetch处理402质询-响应循环。免费工具使用普通fetch即可——无需钱包。
成本控制
- - 在任何付费工具前调用getquote(免费)查看确切的USDC价格和分阶段明细
- 调用getpricing(免费)查看所有当前费率
- 调用getqueuestatus(免费)检查剩余每日预算
- 使用资金有限的专用钱包来控制总风险敞口
- 使用沙盒模式进行测试而无需任何支付(见下文)
典型定价
定价是动态的——成本根据视频时长、旁白和效果而变化。
| 操作 | 典型成本(USDC) | 变化因素 |
|---|
| 脚本生成 | $0.10–$0.20 | 提示词复杂度 |
| 图片生成 |
$0.15 | 每张图片固定 |
| 视频生成 | $0.50–$2.00 | 时长、镜头、人物出镜 |
| 完整流水线(60秒) | $1.50–$2.00 | 时长、旁白、效果 |
| 发布 | $0.10–$0.15 | 固定 |
始终使用您的参数调用get_quote以获取确切价格。
沙盒模式(免费测试)
无需支付、钱包或USDC即可测试完整的API流程。在任何付费请求中发送Authorization: Bearer sandbox,即可收到附带实际成本报价的模拟响应。
bash
获取报价(始终免费,无需认证)
curl -X POST https://content-engine-x402.fly.dev/agent/quote \
-H Content-Type: application/json \
-d {operation:script,duration_seconds:60}
在沙盒模式下测试付费端点(无需支付,无需钱包)
curl -X POST https://content-engine-x402.fly.dev/agent/script \
-H Content-Type: application/json \
-H Authorization: Bearer sandbox \
-d {topic:How AI is changing music production}
沙盒模式返回:
- - 您将支付的确切USDC价格
- 显示使用了哪些AI服务的分阶段成本明细
- 您的代理应从实际调用中期望的响应结构
- 匹配真实格式的模拟ID(content_id、jobId、transactionId)
沙盒模式不会创建内容、收取USDC、需要钱包或计入速率限制。
可用工具
免费(无需支付或凭证)
| 工具 | 描述 |
|---|
| getpricing | 所有操作的实时USDC定价 |
| getquote |
针对特定参数的确切成本报价及分阶段明细 |
| get
queuestatus | 队列位置、活跃作业、剩余每日预算 |
| get_content | 完整内容项详情,包括视频URL和元数据 |
| get
contentstatus | 轻量级状态轮询(流水线阶段+完成百分比) |
付费(x402 USDC——代理批准每笔支付)
| 工具 | 描述 |
|---|
| createscript | 根据主题生成AI视频脚本。返回用于跟踪的contentid。 |
| create_image |
通过Runway ML根据文本提示生成图片。支持风格和宽高比。 |
| create
video | 根据完成的脚本生成视频。需要createscript返回的content_id。 |
| run
fullpipeline | 端到端:从单个主题生成脚本+视频。完成视频的最快路径。 |
| publish_content | 发布到YouTube、X、TikTok、Instagram、LinkedIn。 |
典型工作流程
快速路径
getquote(operation=fullpipeline) → runfullpipeline → 轮询 getcontentstatus → get_content
逐步路径
- 1. getquote operation=script — 查看确切价格
- createscript topic=... — 生成脚本,保存返回的contentid
- getcontentstatus contentid=... — 轮询直至完成
- getquote operation=video — 查看视频的确切价格
- createvideo contentid=... — 生成视频
- getcontentstatus contentid=... — 轮询直至就绪(1–5分钟)
- getcontent contentid=... — 检索视频URL和元数据
重要说明
- - 视频生成需要1–5分钟。始终轮询getcontentstatus,而非假设即时完成。
- 创建工具返回的contentid(UUID)是所有后续操作的关键。
- 定价是动态的——始终在付费操作前调用getquote以查看确切成本。
- 使用沙盒模式(Authorization: Bearer sandbox)进行测试而无需花费USDC。
- 使用资金有限的专用代理钱包——不要使用主钱包。