hy3d-mcp
Turns a single concept image into a game-ready textured 3D model (GLB) locally on Apple Silicon by wrapping Hunyuan3D-MLX, with tools for generation, finishing, preview, and setup diagnostics.
README
hy3d-mcp
An MCP server that turns a single concept image into a game-ready textured 3D model (GLB), fully locally on Apple Silicon, by wrapping the Hunyuan3D-MLX pipeline (Swift + MLX). One tool call: background cutout → shape → PBR paint → optional game-look finishing pass. Proven in production on a real game fleet.
Models land as file paths, never blobs — importing them into your
engine is the caller's job (for Godot: copy into the project and run
godot --headless --import).
Requirements
- Apple Silicon Mac with ~48GB unified memory (texture paint peaks ~25–33GB)
- Xcode or the Command Line Tools (for
swift), and uv - ~15GB free disk: 12GB of weights, 1.3GB of build output
- A built Hunyuan3D-MLX
checkout and a worker Python environment —
./install.shbuilds both for you; see that section before doing any of it by hand.
The server itself carries no ML dependencies; it shells out to the Swift binary and the worker venv.
Install as a Claude Code plugin (recommended)
The repo is also a Claude Code plugin that bundles the MCP server plus a
create-3d-model skill (prompt → concept image → GLB, with all the
input doctrine baked in):
/plugin marketplace add JimCline/hy3d-mcp
/plugin install hy3d-gen@hy3d-mcp
Once installed, ask for a 3D model in plain language or invoke
/hy3d-gen:create-3d-model. The server starts via
uv run --project <plugin-root> hy3d-mcp — uv resolves the venv on first
run.
Install as a bare MCP server
git clone https://github.com/JimCline/hy3d-mcp ~/git/repos/hy3d-mcp
Register with your MCP client (e.g. in .mcp.json or Claude Code's
claude mcp add):
"hy3d-gen": {
"command": "uv",
"args": ["run", "--project", "~/git/repos/hy3d-mcp", "hy3d-mcp"],
"env": {
"HY3D_REPO": "~/git/repos/hunyuan3d-mlx",
"HY3D_PY": "~/.hy3d/worker-venv/bin/python",
"HY3D_OUT": "~/hy3d-output"
}
}
All three env vars are optional; the values above are the defaults.
HY3D_PY is any python interpreter with the worker packages installed.
Set up the engine
The server is a thin wrapper — the actual pipeline is a separate Swift checkout that has to be cloned, built, and fed 12GB of weights. Either let the installer do it or follow the manual sequence below; both end at the same place.
The installer
./install.sh --plan # print exactly what it would do, change nothing
./install.sh # do it, confirming the build and the download
Seven phases — preflight, clone, swift build, metallib, weights,
paint-large relayout, worker venv. Every phase inspects before it
acts, so it is safe to re-run: finished work is skipped and a failed
run resumes where it stopped. The cheap and idempotent phases run
unattended; the two expensive ones (a ~4 minute build, a ~12GB download)
stop and ask first. --yes runs unattended, --only N runs one phase,
and --repo / --worker-venv relocate the targets.
From inside an MCP client, the setup_engine tool is the same script.
It defaults to a dry run and returns the plan; it only executes when
called again with confirm=true, so the agent has to show you the cost
before spending it.
When it finishes it prints the HY3D_REPO and HY3D_PY values to put in
your MCP config, and server_status should then come back all green.
Or by hand
The engine's own README covers steps 2–4; steps 5–7 are the parts it does not mention.
# 1. clone
git clone https://github.com/ZimengXiong/Hunyuan3D-MLX.git ~/git/repos/hunyuan3d-mlx
cd ~/git/repos/hunyuan3d-mlx
# 2. build (~4 min)
swift build -c release
# 3-4. weights (~12GB)
uvx --from huggingface_hub hf download \
zimengxiong/hunyuan3d-mlx-shape-small --local-dir weights/shape-small
uvx --from huggingface_hub hf download \
zimengxiong/hunyuan3d-mlx-paint-large --local-dir weights/paint-large
# 5. metallib — swift build never emits it; harvest it from the pip mlx wheel.
# NOTE: mlx-swift and pip mlx are separate version series. Package.resolved
# pins mlx-swift 0.31.4, but no such pip release exists — take the newest
# pip mlx in the matching 0.31.x series (0.31.2 at time of writing).
uv venv /tmp/mlxharvest
uv pip install --python /tmp/mlxharvest/bin/python mlx==0.31.2
SRC=$(find /tmp/mlxharvest -name mlx.metallib | head -1)
for d in metallib .build/arm64-apple-macosx/release; do
mkdir -p "$d" && cp "$SRC" "$d/mlx.metallib" && cp "$SRC" "$d/default.metallib"
done
# 6. paint-large ships flat, the binary wants it nested
cd weights/paint-large
mkdir -p hunyuan3d-paint-v2-0 hunyuan3d-paintpbr-v2-1
ln -s ../vae ../unet hunyuan3d-paint-v2-0/
ln -s ../vae ../unet hunyuan3d-paintpbr-v2-1/
ln -s dinov2 dinov2-giant
cd ../..
# 7. worker venv — uv, not pip: uv-created venvs have no pip in them
uv venv ~/.hy3d/worker-venv
uv pip install --python ~/.hy3d/worker-venv/bin/python \
opencv-python numpy trimesh pillow scipy pyrender
Then set HY3D_REPO=~/git/repos/hunyuan3d-mlx and
HY3D_PY=~/.hy3d/worker-venv/bin/python.
Either way, verify with the server_status tool. It re-checks every
requirement and each failing check carries its own fix.
The three setup gotchas
install.sh handles all three; they are documented here because they are
what a by-the-book install of the upstream repo gets wrong, and what
server_status is looking for when it fails.
- Metallib —
swift buildnever emits the MLX metallib (mlx-swift SwiftPM limitation). Harvestmlx.metallibfrom the pipmlxwheel — not the version string in Package.resolved, which is mlx-swift's own series and has no pip counterpart (there is no pipmlx0.31.4). Take the newest pipmlxsharing its major.minor, and copy it as bothmlx.metallibanddefault.metallibintometallib/and into.build/arm64-apple-macosx/release/(the real dir —.build/releaseis a symlink). - Weight layout — the paint-large HF repo ships flat, the binary
expects nested: symlink
hunyuan3d-paint-v2-0/{vae,unet}andhunyuan3d-paintpbr-v2-1/{vae,unet}→../vae,../unet, anddinov2-giant→dinov2, insideweights/paint-large. - Paint model flag — the server always passes
--paint-model pbr; the rgb default targets a weight set that isn't installed.
Tools
| Tool | What it does | Typical time |
|---|---|---|
generate_model |
image → textured GLB (auto cutout, optional finish) | ~3–4 min (shape only: ~20s) |
prepare_concept |
plain-background image → centered square RGBA | seconds |
finish_model |
game-look texture pass: toned albedo + accent/seam emissive | seconds |
render_preview |
offscreen PNG renders (iso/front/back/top/side) | seconds |
server_status |
full setup diagnostic, queue depth, last job | instant |
setup_engine |
runs install.sh; dry run unless confirm=true |
instant (plan) / up to an hour (apply) |
Generation is serialized — one job at a time; concurrent calls queue rather than OOM the machine.
Input doctrine
- Feed naturally lit concept art — the model de-lights internally. Pre-flattened "albedo-style" input bakes pale and featureless.
- No drop shadows in the source image — they reconstruct as literal geometry under the model.
- Single object, plain background, roughly centered; ¾ view works best.
prepare_concept/auto_cutouthandle the background keying.
Non-goals
- No cloud fallback.
- No mesh post-processing (decimation/repair proved destructive on generated meshes; LODs belong to your engine's importer).
- No batch tool — loop
generate_model; the queue serializes.
License
MIT — but that covers this wrapper code only. This repo distributes no model weights and no Tencent code.
Model weights license (read this)
The pipeline runs on Tencent's Hunyuan3D weights, which you download yourself and which are governed by the Tencent Hunyuan 3D 2.0 / 2.1 Community License Agreements (2.0, 2.1) — the paint stage uses both generations, so both apply. Highlights, not legal advice; read the licenses:
- Territory: the license does not apply in the European Union, the United Kingdom, or South Korea. If you're there, you may not use the weights at all.
- Scale: products/services exceeding 1M monthly active users require written permission from Tencent.
- Attribution: distributing or productizing anything built on the weights requires the Tencent license notice; 2.1 asks for a "Powered by Tencent Hunyuan" mark.
- Acceptable use: no training competing models on it, no undisclosed synthetic-media deception, no military use, among others.
- Your outputs are yours: Tencent claims no rights to generated 3D models; you own them and are responsible for how you use them.
The Hunyuan3D-MLX Swift port this server shells out to is itself MIT-licensed.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。