适用于Claude Code+Godot的Tripo AI MCP服务器
MCP(模型上下文协议)服务器,使Claude能够完全访问 Tripo AI 三维生成API。生成3D模型,装配它们,设置它们的动画,对它们进行样式化,并为游戏做好准备 .glb 通过自然语言将文件直接导入您的Godot项目。
它的作用
用简单的英语告诉克劳德你需要什么,它会处理整个流程:
"Generate an animated goblin with idle, walk, and slash animations for my RPG"
"Turn this concept art into a 3D model and save it to my Godot project"
"Make a lego-style version of my character model"
"Convert my model to FBX with 5000 faces for mobile optimization"
特性
| 能力 | 工具 | 描述 |
|---|
| 文本转换为3D | generate_3d_model | 根据文本描述生成3D模型 |
| 图像到3D | image_to_3d_model | 从参考图像(PNG/JPG/WEBP)生成3D模型 |
| 装配 | rig_3d_model | 将骨架添加到任何生成的模型(Mixamo或Tripo规范) |
| 动画 | animate_3d_model | 将预设动画应用于装配模型 |
| 完整管道 | generate_and_animate | 一次通话中向动画角色发送文本 |
| 风格化 | stylize_3d_model | 应用视觉风格(乐高、体素、卡通、粘土等) |
| 转换 | convert_3d_model | 使用poly控件转换格式(GLB、FBX、USDZ、OBJ、STL、3MF) |
| 纹理化 | texture_3d_model | 使用文本提示生成或重新生成纹理 |
| 精炼 | refine_3d_model | 将草稿模型升级到更高的质量 |
| 戈多场景 | create_godot_scene | 生成一个 .tscn 实例模型的文件 |
| 任务状态 | check_task_status | 检查任何Tripo任务的进度 |
| 平衡 | check_tripo_balance | 检查剩余API信用 |
| 选项 | list_tripo_options | 列出所有可用的动画、样式和格式 |
设置
1.安装依赖项
pip install mcp httpx
或者使用需求文件:
pip install -r requirements.txt
2.获取Tripo API密钥
- 首选 platform.tripo3d.ai
- 登录并导航到 API密钥
- 创建一个新密钥并复制它(仅显示一次)
3.添加到克劳德代码
添加到您的Claude Code MCP配置中(~/.claude.json 或项目级别 .mcp.json):
{
"mcpServers": {
"tripo": {
"command": "python3",
"args": ["/absolute/path/to/TRIPO-MCP-CLAUDE-GODOT/server.py"],
"env": {
"TRIPO_API_KEY": "tsk_your_key_here"
}
}
}
}
重要提示: 使用绝对路径 server.py.
4.重新启动克劳德代码
这 tripo-godot-mcp 服务器将出现在您可用的MCP工具中。
可用的预设动画
运动
| 动画 | 描述 |
|---|
idle | 静止空闲循环 |
walk | 步行自行车 |
run | 运行周期 |
jump | 跳跃动作 |
climb | 攀爬动作 |
fall | 下落运动 |
turn | 原地转弯 |
战斗
| 动画 | 描述 |
|---|
slash | 梅利进攻挥杆 |
shoot | 远程攻击 |
chop | 剪切动作 |
cast_a_spell | 魔法铸造 |
box_01 / box_02 / box_03 | 拳击组合 |
反应和情绪
| 动画 | 描述 |
|---|
hurt | 点击反应 |
afraid | 恐惧反应 |
angry_01 / angry_02 / angry_03 | 愤怒的变化 |
cry | 哭泣 |
complain_01 / complain_02 | 抱怨 |
社交和手势
| 动画 | 描述 |
|---|
agree | 点头协议 |
bow | 鞠躬 |
clap | 拍手 |
cheer | 欢呼 |
wave | 挥手 |
舞蹈
| 动画 | 描述 |
|---|
dance_01 通过 dance_06 | 六种舞蹈风格 |
运动
| 动画 | 描述 |
|---|
basketball_shot | 篮球投篮 |
crossover_dribble | 交叉运球 |
可用样式
| 样式 | 描述 |
|---|
lego | 砖砌外观 |
voxel | 块状体素美学 |
voronoi | 有机细胞模式 |
minecraft | Minecraft风格的方块 |
cartoon | 明亮的色彩,夸张的比例 |
clay | 手工粘土/面团外观 |
alien | 有机超凡美学 |
christmas | 节日主题 |
steampunk | 维多利亚式机械风格 |
gold | 金属金饰面 |
ancient_bronze | 古铜雕像外观 |
输出格式
| 格式 | 最适合 |
|---|
glb | Godot,web查看器(默认) |
fbx | Unity、虚幻、Blender |
usdz | 苹果AR、美元管道 |
obj | 广泛的兼容性 |
stl | 3D打印 |
3mf | 先进的3D打印 |
钻机规格
mixamo --Adobe Mixamo兼容框架(更广泛的动画生态系统)tripo --Tripo原生骨骼
Godot集成指南
导入模型
- 生成
.glb 文件以本机方式导入——将它们拖动到Godot的FileSystem dock中 - Godot自动检测
.glb - 使用 动画播放器 播放单个动画
- 使用 动画树 用于混合和状态机
使用生成的场景
这 create_godot_scene 工具生成 .tscn 您可以直接在Godot中打开的文件。场景实例 .glb 模型位于指定位置。
推荐的导入设置
- 集 导入>网格>生成LOD 到
off 用于角色模型 - Tripo输出使用米——如果您的项目使用不同的单位,请在“导入”选项卡中缩放
- 对于动画模型,请检查 导入>动画>导入 已启用
典型工作流程
1. "Generate an animated knight with idle, walk, run, and slash animations"
→ Claude generates, rigs, and animates the model via Tripo
→ Downloads the .glb to your project's models/ directory
2. "Create a Godot scene with the knight at position (5, 0, 3)"
→ Claude generates a .tscn file referencing the .glb
3. "Convert the knight to FBX with 8000 faces for mobile"
→ Claude converts with poly reduction
4. "Make a lego version of the knight"
→ Claude stylizes the model
示例提示
角色
Generate an animated skeleton warrior with idle, walk, and slash animations.
Save it to ./game/assets/enemies/
Create a friendly NPC shopkeeper with idle and wave animations.
Turn this image into a 3D character and rig it with Mixamo skeleton.
道具与环境
Generate a treasure chest 3D model and save to ./game/assets/props/
Create 3 different rock formations for my cave level.
Generate a medieval sword prop and convert it to FBX with 2000 faces.
风格化
Take the goblin model and make a cartoon version of it.
Stylize my character as voxel art for the retro game mode.
Create a gold trophy version of the player character.
管道
Generate a dragon enemy. Rig it, animate with idle and slash,
then convert to FBX. Make a lego version too.
Save everything to ./game/assets/enemies/dragon/
模型版本
| 版本 | 注释 |
|---|
v2.5-20250123 | 平衡质量和速度,增强几何形状(默认) |
v3.0-20250812 | 最新。更锋利的边缘,更锋利的表面。支持 geometry_quality: "detailed" 最多2M聚酯 |
Turbo-v1.0-20250506 | 生成速度最快,有利于快速迭代 |
v2.0-20240919 | 采用PBR的行业领先几何形状 |
default | 最新稳定版本 |
项目结构
TRIPO-MCP-CLAUDE-GODOT/
├── server.py # MCP server (all Tripo tools)
├── requirements.txt # Python dependencies
├── claude_code_config.json # Example MCP config
├── .gitignore
└── README.md
故障排除
| 问题 | 解决方案 |
|---|
TRIPO_API_KEY not set | 在MCP配置或shell中设置env变量 |
| 任务超时 | 增加超时;复杂的模型需要更长的时间 |
| 结果中没有模型URL | 检查 check_task_status --任务可能已失败 |
Godot无法导入 .glb | 确保Godot 4.x;检查下载的文件是否正确 |
| 动画未播放 | 检查AnimationPlayer节点;动画嵌入在 .glb |
| 型号太大/太小 | 使用 convert_3d_model 随着 scale_factor 或在Godot导入选项卡中进行调整 |
积分和链接