🎬 创建MCP服务器
](https://www.npmjs.com/package/@tsavo/creatify-mcp) ](https://www.npmjs.com/package/@tsavo/creatify-mcp)   ](https://nodejs.org/)    ](https://github.com/TSavo/creatify-mcp) ](https://github.com/TSavo/creatify-mcp/issues) 
用于AI视频生成的终极MCP服务器 -带来 创造人工智能MCP生态系统中的每个AI助手都可以使用强大的视频创建功能。
🌟 概述
这 创建MCP服务器 是一个全面的模型上下文协议(MCP)服务器,它将Creatify AI的视频生成平台的全部功能暴露给AI助手、聊天机器人和自动化工具。建立在坚固的基础上 @tsavo/creatify-api-ts TypeScript客户端库,该服务器将复杂的视频创建工作流转换为简单的自然语言交互。
🎨 高级MCP功能:
- 📝 鼓励 -可重复使用的视频创建模板和工作流程
- 📊 日志记录 -具有多个严重性级别的结构化日志记录
- 🔍 进度跟踪 -视频生成过程中的实时更新
- 🤖 AI自助 -
how_to_useAI助手理解参数的工具 - 📊 通知 -实时状态更新和进度通知
🎯 这能带来什么
想象一下,告诉克劳德桌面: *“创建一个16:9的安娜头像视频,说‘欢迎来到我们的产品演示’,并等待其完成”* -并让它真正发生。这就是MCP服务器的力量。
🏗️ 构建于
- 创造人工智能API -全球领先的AI视频生成平台
- @tsavo/创建api ts -全面的TypeScript客户端库
- 模型上下文协议 -标准化AI助手集成
- TypeScript -全类型安全和出色的开发人员体验
特性
🛠️ MCP工具(12个强大的动作)
create_avatar_video-使用唇形同步创建AI头像视频create_url_to_video-将网站转换为专业视频generate_text_to_speech-从文本生成听起来自然的语音create_multi_avatar_conversation-创建具有多个对话化身的视频create_custom_template_video-使用自定义模板生成视频create_ai_edited_video-自动编辑和增强视频create_ai_shorts-创建短视频(非常适合TikTok、Instagram Reels)generate_ai_script-为视频生成AI驱动的脚本create_custom_avatar-设计和创建自己的自定义头像(DYOA)manage_music-上传、管理和使用背景音乐create_advanced_lipsync-先进的唇同步功能,可控制情绪和手势how_to_use-获取任何工具的详细使用信息get_video_status-检查视频生成任务的状态
📚 MCP资源(6个数据源)
creatify://avatars-可用AI化身列表creatify://voices-文本转语音的可用语音列表creatify://templates-可用的自定义视频模板creatify://music-可用背景音乐库creatify://credits-剩余API信用creatify://avatar/{avatarId}-关于特定化身的详细信息
🏆 为什么选择Creatify MCP服务器?
🚀 API全面覆盖
- ✅ 12个MCP工具 覆盖100%的Creatify API功能
- ✅ 6 MCP资源 用于全面的数据访问
- ✅ 5工作流程提示 用于常见的视频创建场景
- ✅ 企业级日志记录 有8个严重级别
🤖 AI优先设计
- ✅ 自我记录 随着
how_to_useAI助手工具 - ✅ 智能参数验证 以及错误处理
- ✅ 实时进度更新 在视频生成期间
- ✅ 语义版本控制 自动发布
🎨 高级功能
- ✅ 情绪和手势控制 高级唇形同步
- ✅ 自定义头像创建 (DYOA-设计你自己的化身)
- ✅ AI驱动的脚本生成 适用于任何视频类型
- ✅ 短视频优化 TikTok/Instagram/YouTube
- ✅ 背景音乐管理 以及整合
💼 生产就绪
- ✅ TypeScript 用于类型安全和更好的IDE支持
- ✅ 全面的错误处理 具有详细的上下文
- ✅ 专业测井 用于监控和调试
- ✅ 自动化测试 持续集成
- ✅ 语义版本控制 为了获得可靠的更新
📝 MCP提示(5个工作流模板)
create-product-demo-专业的产品演示工作流程create-social-content-参与社交媒体内容创作create-educational-video-教育和教程视频工作流程create-marketing-campaign-营销活动视频制作analyze-video-performance-视频性能分析与优化
先决条件
- Node.js 18或更高版本
- 创建API证书(专业计划或更高版本)
- 从获取您的API证书 创建帐户设置
安装
来自npm(推荐)
npm install -g @tsavo/creatify-mcp来源
git clone https://github.com/TSavo/creatify-mcp.git
cd creatify-mcp
npm install
npm run build
npm link🎬 现场演示示例
创建AI头像视频
User: "Create a professional avatar video with Anna saying 'Welcome to our company!' in 16:9 format"
Claude: I'll create a professional avatar video for you using the Creatify MCP Server.
[Uses create_avatar_video tool with:
- text: "Welcome to our company!"
- avatarId: "anna_costume1_cameraA"
- aspectRatio: "16:9"
- voiceId: "en-US-AriaNeural"]
Your professional avatar video has been created! Anna delivers your message with natural lip-sync and professional presentation.生成TikTok风格的短视频
User: "Make a 30-second TikTok video about coffee brewing tips"
Claude: I'll create an engaging short-form video perfect for TikTok!
[Uses create_ai_shorts tool with:
- prompt: "Quick coffee brewing tips with energetic presentation"
- aspectRatio: "9:16"
- duration: 30
- style: "energetic"]
Your TikTok-ready short video is being generated with optimal 9:16 aspect ratio and engaging content!将网站转换为视频
User: "Turn my product landing page into a marketing video"
Claude: I'll convert your website into a compelling marketing video.
[Uses create_url_to_video tool with:
- url: "https://yourproduct.com"
- aspectRatio: "16:9"
- style: "marketing"]
Your landing page has been transformed into a professional marketing video showcasing your product!AI驱动的脚本生成
User: "Generate a script for a 60-second product demo video"
Claude: I'll create a compelling script for your product demo.
[Uses generate_ai_script tool with:
- topic: "Product demonstration video"
- scriptType: "commercial"
- duration: 60
- tone: "professional"]
Your script is ready! It includes engaging hooks, clear value propositions, and a strong call-to-action optimized for 60-second format.配置
将您的Creatify API凭据设置为环境变量:
export CREATIFY_API_ID="your-api-id"
export CREATIFY_API_KEY="your-api-key"或者创建一个 .env 文件:
CREATIFY_API_ID=your-api-id
CREATIFY_API_KEY=your-api-key用法
使用克劳德桌面
添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在 macOS 上:
{
"mcpServers": {
"creatify": {
"command": "creatify-mcp",
"env": {
"CREATIFY_API_ID": "your-api-id",
"CREATIFY_API_KEY": "your-api-key"
}
}
}
}🎨 高级MCP功能
📝 使用提示(工作流模板)
AI助手现在可以在常见的视频创建场景中使用预定义的工作流模板:
示例:产品演示工作流程
User: "Use the create-product-demo prompt for 'Amazing Widget' with features 'fast, reliable, easy to use' targeting small business owners"
Claude: I'll use the product demo workflow template to create a professional demonstration video.
[Claude automatically follows the complete workflow:
1. Generates an engaging script using generate_ai_script
2. Creates avatar video using create_avatar_video
3. Optimizes for the target audience
4. Includes clear call-to-action]可用提示模板:
create-product-demo-专业产品演示create-social-content-TikTok/Instagram/YouTube内容create-educational-video-教程和教育内容create-marketing-campaign-营销和宣传视频analyze-video-performance-视频优化和分析
📊 实时记录和进度
服务器提供具有多个严重性级别的结构化日志记录:
[INFO] Creatify MCP Server initialized
[INFO] Creating avatar video {avatarId: "anna_costume1_cameraA", aspectRatio: "16:9"}
[INFO] Waiting for avatar video completion...
[INFO] Avatar video completed {videoId: "video_abc123"}日志级别: debug, info, notice, warning, error, critical, alert, emergency
🤖 AI自助系统
AI助手现在可以使用 how_to_use 工具:
Claude: Let me check how to use the avatar video tool...
[Calls how_to_use tool with toolName: "create_avatar_video"]
[Gets comprehensive documentation with:
- Required parameters with descriptions
- Optional parameters with usage notes
- Real code examples
- Tips and best practices]
Now I understand exactly how to create your avatar video!使用自定义MCP客户端
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "creatify-mcp",
env: {
CREATIFY_API_ID: "your-api-id",
CREATIFY_API_KEY: "your-api-key"
}
});
const client = new Client({
name: "my-client",
version: "1.0.0"
});
await client.connect(transport);
// List available tools
const tools = await client.listTools();
console.log("Available tools:", tools.tools.map(t => t.name));
// Create an avatar video
const result = await client.callTool({
name: "create_avatar_video",
arguments: {
text: "Hello, world! This is an AI-generated video.",
avatarId: "anna_costume1_cameraA",
aspectRatio: "16:9",
waitForCompletion: true
}
});独立服务器
# Set environment variables
export CREATIFY_API_ID="your-api-id"
export CREATIFY_API_KEY="your-api-key"
# Run the server
creatify-mcpAI助手提示示例
一旦配置了Claude Desktop或其他MCP客户端,您就可以使用自然语言提示,如:
- *“创建一个16:9的安娜头像视频,说‘欢迎来到我们的产品演示’,并等待其完成”*
- *“转换网站https://example.com进入宣传视频”*
- *“使用专业语音为‘Hello world’生成文本到语音的音频”*
- *“显示所有可用的头像及其详细信息”*
- *“检查我剩余的Creatify积分”*
- *“在讨论我们新产品的两个化身之间创建对话”*
api参考
工具
create_avatar_video
使用唇形同步语音创建AI化身视频。
参数:
text(字符串,必填)-要说出的文本avatarId(字符串,必填)-要使用的头像IDaspectRatio(“16:9”|“9:16”|“1:1”,必填)-视频宽高比voiceId(字符串,可选)-化身的语音IDwaitForCompletion(布尔值,可选)-等待视频完成
create_url_to_video
将网站URL转换为专业视频。
参数:
url(字符串,必填)-要转换的URLvisualStyle(字符串,可选)-视觉样式模板scriptStyle(字符串,可选)-脚本编写风格aspectRatio(“16:9”|“9:16”|“1:1”,可选)-视频宽高比waitForCompletion(布尔值,可选)-等待视频完成
generate_text_to_speech
从文本生成听起来自然的语音。
参数:
text(字符串,必填)-要转换为语音的文本voiceId(字符串,必填)-要使用的语音IDwaitForCompletion(布尔值,可选)-等待音频完成
get_video_status
检查视频生成任务的状态。
参数:
videoId(字符串,必填)-要检查的视频/任务IDvideoType(字符串,必填)-任务类型(“lipsync”、“视频url”等)
资源
creatify://avatars
返回所有可用AI化身及其ID、名称和元数据的JSON列表。
creatify://voices
返回用于文本到语音生成的所有可用语音的JSON列表。
creatify://templates
返回可用自定义视频模板的JSON列表。
creatify://credits
返回当前账户的信用余额和使用信息。
发展
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode with auto-reload
npm run dev
# Run tests
npm test
# Lint and format code
npm run check贡献
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
相关项目
@tsavo/creatify-api-ts-Creatify API的TypeScript客户端- 模型上下文协议 -协议规范
- 创造人工智能 -AI视频生成平台
📚 综合文档
🎬 视频教程
*即将推出-全面的视频教程,展示真实世界的使用场景*
📖 api参考
有关API的详细文档,请参阅:
- 创建API文档 -官方Creatify API文档
- @tsavo/创建api ts文档 -TypeScript客户端库文档
- 模型上下文协议规范 -MCP协议详细信息
🔧 高级配置
环境变量
| 变量 | 必填 | 描述 | 示例 |
|---|---|---|---|
CREATIFY_API_ID | ✅ | 您的Creatify API ID | your-api-id-here |
CREATIFY_API_KEY | ✅ | 您的Creatify API密钥 | your-api-key-here |
MCP_LOG_LEVEL | ❌ | 日志记录级别 | debug, info, warn, error |
Claude桌面高级配置
{
"mcpServers": {
"creatify": {
"command": "creatify-mcp",
"env": {
"CREATIFY_API_ID": "your-api-id",
"CREATIFY_API_KEY": "your-api-key",
"MCP_LOG_LEVEL": "info"
},
"args": ["--verbose"]
}
}
}🚀 性能优化
批量操作
对于多个视频创作,请考虑使用批处理功能:
// Example: Create multiple videos efficiently
const videos = await Promise.all([
client.callTool({
name: "create_avatar_video",
arguments: { text: "Video 1", avatarId: "anna", aspectRatio: "16:9" }
}),
client.callTool({
name: "create_avatar_video",
arguments: { text: "Video 2", avatarId: "john", aspectRatio: "16:9" }
})
]);缓存策略
- 头像/语音列表:缓存1小时(它们很少改变)
- 视频状态:每5-10秒轮询一次活动任务
- 模板:缓存24小时
🔐 安全最佳实践
- 永远不要提交API密钥 到版本控制
- 使用环境变量 对于所有敏感数据
- 旋转API键 定期
- 监控API使用情况 检测未经授权的访问
- 使用HTTPS 对于所有 webhook URL
🐛 故障排除
常见问题
“找不到API凭据”
# Solution: Set environment variables
export CREATIFY_API_ID="your-api-id"
export CREATIFY_API_KEY="your-api-key"“视频创建失败”
- 检查您的Creatify帐户积分
- 验证化身/语音ID是否存在
- 确保文本不为空
- 检查纵横比是否有效
“MCP连接失败”
- 验证服务器是否正在运行
- 检查Claude桌面配置
- 确保Node.js版本>=18
调试模式
# Run with debug logging
MCP_LOG_LEVEL=debug creatify-mcp📊 监控和分析
使用情况跟踪
监控您的Creatify API使用情况:
// Check remaining credits
const credits = await client.readResource({ uri: "creatify://credits" });
console.log(`Remaining credits: ${JSON.parse(credits.contents[0].text).remaining_credits}`);性能指标
- 视频创建时间:通常为2-5分钟
- API响应时间:通常\<2秒
- 成功率:监视失败的请求
🤝 贡献
我们欢迎捐款!以下是如何开始:
🛠️ 开发设置
# Clone the repository
git clone https://github.com/TSavo/creatify-mcp.git
cd creatify-mcp
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your API credentials
# Run tests
npm test
# Build the project
npm run build
# Run in development mode
npm run dev🧪 测试
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run type checking
npm run type-check
# Run linting
npm run lint📝 代码的风格
我们使用:
- ESLint 用于代码过滤
- 更漂亮 用于代码格式化
- TypeScript 用于类型安全
- 常规承诺 用于提交消息
🔄 拉取请求流程
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 进行更改
- 添加新功能的测试
- 确保所有测试通过(
npm test) - 跑linting(
npm run lint:fix) - 提交您的更改(
git commit -m 'feat: add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
📄 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙏 致谢
- 创造人工智能 -提供令人惊叹的AI视频生成平台
- @tsavo/创建api ts -为该服务器提供支持的强大TypeScript客户端库
- Anthropic -克劳德和模型上下文协议
- MCP社区 -对于使这种集成成为可能的标准化协议
📞 支持
______________________________________________________________________
创建于❤️ 靠近 T 萨沃
🌐 地平线城市 - *引发人工智能革命,加速人类灭绝*
*让每个开发人员和人工智能助理都能使用人工智能视频生成——离人类过时又近了一步*
