blender-mcp
blender-mcp
一个构建 Blender .blend 文件的 MCP 服务器。它通过两种方式与 Blender 交互:
Headless(无头模式) — 每次调用都会启动一个全新的
blender --background进程。具有确定性、始终可用,是生成文件的正确选择。Live(实时模式) — 一个小型 Blender 插件打开一个本地端口,服务器可以驱动你已经打开的 Blender 窗口,你可以实时观看操作过程。
两种方式运行相同的处理代码,因此脚本的行为完全一致。本地 Web UI 允许你上传参考图像,并使用相同的工具运行生成任务。
系统要求
Blender | 4.2 或更新版本(基于 5.1 开发) |
Python | 3.12+(服务器端,Blender 自带其自身 Python) |
依赖和虚拟环境管理工具 |
Related MCP server: blender-chatgpt-mcp
设置
uv sync # create .venv and install
cp .env.example .env # then set BLENDER_MCP_EXECUTABLE
uv run python scripts/build_addon.py --install # build + install the Blender addon如果跳过 .env,服务器会在你的 PATH 以及每个驱动器上的标准 Program Files/Blender Foundation/Blender <version> 文件夹中搜索,并优先选择找到的最新版本。
启用实时桥接
插件已安装但处于空闲状态,直到你启动它:
打开 Blender。
在 3D 视口中按 N 键显示侧边栏。
打开 MCP 选项卡,然后点击 Start MCP Bridge。
在插件偏好设置中勾选 Start listening on launch 可省去每次手动启动的步骤。
连接 MCP 客户端
.cursor/mcp.json 已为本项目注册了该服务器。若要使其全局可用,请将该块复制到 ~/.cursor/mcp.json:
{
"mcpServers": {
"blender": {
"command": "uv",
"args": ["run", "--directory", "C:\\Users\\josef\\Projects\\blender-mcp", "blender-mcp"]
}
}
}质量工作流
生成质量来自于观察,而不是单一的脚本转储:
list_references/view_reference— 首先打开参考图像使用
studio或product模板调用create_blend通过小的
run_script步骤构建;使用apply_material处理金属/塑料/橡胶/玻璃/木材preview_views— 多角度 EEVEE 预览;通过view_image与参考图像对比修复,再次预览
最终
render/render_and_view(最终渲染使用 CYCLES;迭代时使用 EEVEE)
本地 Web UI
uv run blender-mcp-web
# open http://127.0.0.1:8765上传参考图像,输入提示词,并在 output/jobs/ 下浏览任务。
如果在
.env中设置了BLENDER_MCP_LLM_API_KEY— 该网站会运行一个受限的多模态代理,调用相同的 Blender 工具(通过BLENDER_MCP_LLM_PROVIDER支持 OpenAI 兼容或 Anthropic 接口)。如果没有设置密钥 — 上传和任务页面仍然可用;在 Cursor 中打开任务,并要求 MCP 代理从
output/jobs/<id>/refs构建。
工具
工具 | 用途 |
| 安装信息、输出/参考图像目录、模板、材质、实时桥接状态 |
| 参考图像库,位于 |
| 从模板和可选脚本创建新文件 |
| 任意 bpy Python 代码 |
| 程序化预设材质:金属、塑料、橡胶、玻璃、木材 |
| 场景图 / 材质 / 摄像机 / 灯光 |
| 多角度 EEVEE 预览,用于评审 |
| 静态 PNG;后者返回图像供查看 |
| 加载 PNG 供视觉查看 |
| 实时视口截图 |
|
|
| 在实时 Blender 窗口中打开 |
编写脚本
run_script 和 create_blend 的 script 参数在一个命名空间中执行,其中已绑定 bpy、mathutils、math、D(bpy.data)和 C(bpy.context)。通过赋值给 result 或调用 emit(value) 将数据传回。
模板
名称 | 你得到的内容 |
| 完全空白 |
| Blender 的启动场景:立方体、摄像机、灯光 |
| 灰色地面、三点区域照明、50mm 摄像机、1920×1080 分辨率 |
| 白色无缝背景、柔光、85mm 产品取景框架 |
目录结构
addon/blender_mcp_addon/ Blender extension + shared handlers (incl. preview_views)
src/blender_mcp/
server.py MCP tools
refs.py reference image library
materials.py procedural material presets
templates.py starter scenes
agent/ bounded multimodal generation loop
web/ FastAPI UI (templates + static)
headless.py / bridge.py Blender process / live socket
scripts/ build, install, verification
output/ .blend files, renders, refs/, jobs/测试
uv run pytest -m "not blender" # fast
uv run pytest # includes real Blender runs
uv run python scripts/check_server.py
uv run python scripts/verify_live_bridge.py注意事项与限制
run_script在 Blender 内部执行任意 Python 代码。请将桥接保持在本地回环地址上。长时间渲染会阻塞实时 UI,直到渲染完成。
viewport_screenshot仅适用于实时模式。Cycles 默认使用 CPU,除非你在 Blender 偏好设置中启用 GPU 设备。
Web 代理需要支持工具调用和图像的多模态模型。
许可证
MIT
Available Tools
16 toolsadd_referenceA
Copy an image file into the reference library under output/refs.
Args: source_path: Existing image on disk (absolute or under the output folder). name: Optional destination filename. group: Optional subfolder name for organising guides.
Inputs: source_path (required), name, group.
apply_materialA
Apply a procedural material preset (metal, plastic, rubber, glass, wood) to a mesh.
Args: object_name: Mesh object name in the scene. preset: One of the presets from blender_status.materials. color: Optional RGB or RGBA floats 0-1. blend_file: Open this file first (forces headless). save_as: Save after applying. target: "auto", "live" or "headless".
Inputs: preset (required), object_name (required), color, target, +2 more.
blender_statusC
Report the Blender install, output folder, live-bridge state, templates and materials.
Inputs: no named parameters.
create_blendA
Create a new .blend file from a starter template and save it.
Args: path: Destination, relative to the output folder unless absolute. A ".blend" suffix is added when missing. template: empty, default, studio, or product. script: Optional extra bpy code run after the template. compress: Write a compressed .blend.
Inputs: path (required), script, compress, template.
inspect_blendA
Describe a scene: objects, transforms, materials, cameras, lights and render settings.
Args: blend_file: Inspect this file. Leave empty to inspect the live session instead. include_objects: Include the per-object breakdown, not just the counts. target: Where to look when no file is given.
Inputs: target, blend_file, include_objects.
list_outputsC
List the files produced so far in the output folder.
Inputs: pattern.
list_referencesA
List reference guide images under output/refs (optionally one group folder).
Inputs: group.
open_in_live_sessionB
Load a .blend into the Blender window the user has open, so they can see it.
Inputs: blend_file (required).
preview_viewsB
Render multi-angle EEVEE previews (front, three_quarter, side, top) for critique.
Args: blend_file: .blend to open and preview. output_dir: Folder under output/ for the PNGs. width: Preview width. height: Preview height. samples: Low sample count for speed. engine: Prefer EEVEE. target: Usually headless.
Inputs: blend_file (required), width, engine, height, +3 more.
renderA
Render a still image and write it to disk. Prefer render_and_view so you see it.
Args: output: PNG destination, relative to the output folder unless absolute. blend_file: Render this file rather than the live session. Forces a headless run. engine: "EEVEE", "CYCLES" or "WORKBENCH". EEVEE for iteration; CYCLES for finals. samples: Sample count. Keep it low for previews. width: Output width in pixels. height: Output height in pixels. frame: Frame to render. Defaults to the scene's current frame. transparent: Render the world background as alpha. target: "auto", "live" or "headless".
Inputs: frame, width, engine, height, +5 more.
render_and_viewC
Render a still and return the image so you must look at it.
Args: output: PNG destination under the output folder. blend_file: Optional .blend to open first. engine: Prefer EEVEE while iterating. samples: Sample count. width: Width in pixels. height: Height in pixels. target: "auto", "live" or "headless".
Inputs: width, engine, height, output, +3 more.
run_scriptA
Run Python against Blender's bpy API.
bpy, mathutils, math, D and C are pre-bound. Assign to result or call
emit(value) to send data back; print() output is captured too.
Args: code: The Python to execute. blend_file: Open this .blend first. Supplying it forces a headless run. save_as: Save the file here when the script finishes. target: "auto", "live" or "headless".
Inputs: code (required), target, save_as, blend_file.
view_imageC
Load a rendered image so it can actually be looked at.
Args: path: Image path, relative to the output folder unless absolute.
Inputs: path (required).
viewport_screenshotB
Capture the live Blender window's 3D viewport as it currently looks.
Requires the MCP Bridge addon to be running in an open Blender session.
Inputs: output.
view_previewB
Look at one preview PNG from preview_views or a render.
Args: path: Image path relative to output or absolute.
Inputs: path (required).
view_referenceB
Look at a reference/guide image so you can match it while modeling.
Args: path: Path relative to output/refs, or absolute.
Inputs: path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct action: status, references (list/view/add), file creation, scripting, material application, scene inspection, rendering (with variants for preview and view), screenshot, output listing, and live session opening. Even similar tools like render and render_and_view are clearly differentiated by purpose and parameters.
All tool names use snake_case with a verb_noun pattern (e.g., list_references, create_blend, apply_material). The naming is predictable and follows a consistent structure, making it easy for an agent to infer functionality from the name.
With 16 tools, the set covers a broad range of Blender operations—file management, references, materials, rendering, scripting, and inspection—without being overwhelming. The count is well-scoped for its domain: enough to handle common tasks without unnecessary duplication.
The tool surface covers many essential tasks but lacks direct tools for object creation (e.g., adding primitives), transformation (move/rotate/scale), or animation. While run_script can fill these gaps via Python, the explicit tool set leaves notable gaps for a modeling server, forcing agents to fall back to scripting for basic operations.
Related MCP Connectors
Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.
An MCP server that provides asset auto generator
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for AI-assisted Blender automation, providing layered tools for perception, declarative and imperative writing, and fallback operations.29126 PyPI7MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants like Codex or ChatGPT to inspect and control a local Blender scene, including creating objects, editing materials, setting cameras and lights, rendering previews, and saving safe copies of .blend files.1MIT
- FlicenseBqualityDmaintenanceMCP server that controls Blender via HTTP bridge, enabling 3D modeling, animation, and export operations from Cursor agent.321-
- AlicenseAqualityDmaintenanceMCP server for Blender that connects to the official Blender Lab add-on, exposing 27 tools for scene manipulation, object editing, materials, rendering, and Python execution through the add-on's actual wire protocol.271MIT