Driving Blender from Claude with blender-mcp
blendermcppythonbpyautomation
blender-mcp (github.com/ahujasid/blender-mcp) lets a Claude session run Python inside a
live Blender GUI. It has two halves: a Blender addon that opens a JSON socket server
inside Blender, and an MCP server (run with uvx blender-mcp) that exposes tools such as
execute_blender_code and get_scene_info to Claude and forwards them to that socket.
Set up on VictusPop in August 2026 with Blender 5.2 LTS.
Installing Blender without sudo
- Use the official Linux tarball, extracted under
~/.local/opt/blender-<ver>-linux-x64, with symlinks~/.local/opt/blenderand~/.local/bin/blender. No root needed. download.blender.orgsits behind a Cloudflare challenge that returns 403 tocurl. Download from a mirror instead, for example NLUUG:https://ftp.nluug.nl/pub/graphics/blender/release/.
Installing the bridge
- Install
uv/uvxwith the standalone astral.sh installer (goes to~/.local/bin). - Copy the addon to
~/.config/blender/<ver>/scripts/addons/blender_mcp_addon.py, enable it, and save user preferences so it stays enabled. - Register the MCP server for all projects:
claude mcp add --scope user blender -- ~/.local/bin/uvx blender-mcp. New sessions then get themcp__blender__*tools; a session started before the registration does not.
The addon listens on 127.0.0.1:9876 (operator blendermcp.start_server).
Starting a modeling session
Launch the GUI with a small autostart script:
DISPLAY=:1 nohup ~/.local/bin/blender --python autostart.py &
ss -tlnp | grep 9876 # confirm the socket is up
The autostart script enables the addon and starts the server from a timer:
bpy.app.timers.register(lambda: bpy.ops.blendermcp.start_server() and None, first_interval=2).
Calling the operator directly at startup fails because the UI context does not exist yet.
The X display number is not fixed on this desktop; read it from ps -C Xorg -o args=.
Talking to the socket without MCP tools
If the MCP tools are not loaded (for example, the server was registered mid-session), send JSON straight to the socket:
{"type": "execute_code", "params": {"code": "import bpy; print(len(bpy.data.objects))"}}
{"type": "get_scene_info"}
A ten-line Python helper that opens a TCP connection, sends one JSON object and reads the reply is enough.
Gotchas
- Long operations block the socket.
open_mainfileandsave_as_mainfileon a large file (hundreds of MB) block until done and can time out the bridge. Wrap them inbpy.app.timers.register(...)so the call returns at once, then poll for completion (for example by checking the file's mtime from bash). - Look up shader nodes by
type, not by name; names are localized. - Material colors belong on shader node inputs;
material.diffuse_coloronly affects the viewport.
See also
- Blender Python scripting, safety audit and gotchas
- Making clothing for a rigged character by duplicating body faces