Automate Blender workflows with external Python control, background operation, and LLM integration
Project description
blender-remote
Control Blender remotely using Python API and LLM through MCP (Model Context Protocol).
Key Features
1. Dual Control Interface: Python API + LLM
Use both Python API and LLM simultaneously to control Blender. The MCP protocol enables LLMs to experiment with Blender operations and help you create new APIs based on their interactions.
# Python API
import blender_remote
client = blender_remote.connect_to_blender(port=6688)
scene_manager = blender_remote.create_scene_manager(client)
cube_name = scene_manager.add_cube(location=(2, 0, 0), size=1.5)
# LLM via MCP
uvx blender-remote # Start MCP server for Claude, VSCode, Cursor, etc.
2. Background Mode Support
Run Blender completely headless for automation without GUI.
# GUI mode with auto-start service
export BLD_REMOTE_MCP_START_NOW=1
blender &
# Background mode for automation
blender --background --python start_service.py &
Installation
pip install blender-remote
Quick Start
1. Install Blender Addon
Option A: Automated (Recommended)
blender-remote-cli init /path/to/blender
blender-remote-cli install
Option B: Manual
cd blender-remote/blender_addon/
zip -r bld_remote_mcp.zip bld_remote_mcp/
# Install via Blender: Edit > Preferences > Add-ons > Install > Enable "BLD Remote MCP"
2. Start Blender with Service
# GUI mode
export BLD_REMOTE_MCP_START_NOW=1
blender &
# Background mode
echo 'import bld_remote; bld_remote.start_mcp_service()' > start_service.py
blender --background --python start_service.py &
3. Use Python API
import blender_remote
# Connect to Blender
client = blender_remote.connect_to_blender(port=6688)
# High-level scene operations
scene_manager = blender_remote.create_scene_manager(client)
cube_name = scene_manager.add_cube(location=(0, 0, 0), size=2.0)
scene_manager.set_camera_location(location=(7, -7, 5), target=(0, 0, 0))
# Direct code execution
result = client.execute_python("bpy.ops.mesh.primitive_sphere_add()")
4. Use with LLM
Configure LLM IDE (VSCode/Claude/Cursor):
{
"mcpServers": {
"blender-remote": {
"command": "uvx",
"args": ["blender-remote"]
}
}
}
Then ask your LLM:
- "What objects are in the current Blender scene?"
- "Create a blue metallic cube at position (2, 0, 0)"
- "Show me the current viewport"
- "Help me create a new API function for batch object creation"
Available MCP Tools
| Tool | Description |
|---|---|
get_scene_info() |
List all objects, materials, and scene properties |
get_object_info(name) |
Get detailed object properties |
execute_blender_code(code) |
Run Python code in Blender context |
get_viewport_screenshot() |
Capture viewport image (GUI mode only) |
check_connection_status() |
Verify service health |
How It Works
External Python ←─────┐
│
LLM (Claude/VSCode) ←─┼─→ MCP/JSON-TCP (port 6688) ←─ BLD_Remote_MCP (addon)
│ ↓
Python Control API ←──┘ Blender Python API
↓
Blender (GUI/background)
Example: LLM-Assisted API Development
- LLM experiments: "Try creating 10 cubes in a grid pattern"
- LLM observes: Uses
execute_blender_code()to test different approaches - LLM creates API: "Based on what worked, let me create a
create_cube_grid()function" - You integrate: Add the LLM-created function to your Python automation
CLI Configuration Tool
# Setup and management
blender-remote-cli init /path/to/blender
blender-remote-cli install
blender-remote-cli start --background
blender-remote-cli config set mcp_service.default_port=7777
blender-remote-cli status
Socket-Level Communication
import socket, json
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 6688))
command = {"type": "execute_code", "params": {"code": "bpy.ops.mesh.primitive_cube_add()"}}
sock.send(json.dumps(command).encode())
response = json.loads(sock.recv(4096).decode())
sock.close()
Documentation
- Full Documentation: https://igamenovoer.github.io/blender-remote/
- Examples: examples/
- Issues: Report bugs
License
Credits
Inspired by ahujasid/blender-mcp with enhanced background mode support, thread-safe operations, and production-ready deployment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blender_remote-1.2.0rc3.tar.gz.
File metadata
- Download URL: blender_remote-1.2.0rc3.tar.gz
- Upload date:
- Size: 90.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5be67b699a0922b641da4c411f4c35d7a36e00569d4e84f3e20eb5f10d1f58c1
|
|
| MD5 |
b966571a996728be7e4d25c63c45744e
|
|
| BLAKE2b-256 |
2ea314fea9a7917c5bf0c05ae268c8825ec2fd9e4e3af28e49dc1faf6a7ad6dd
|
File details
Details for the file blender_remote-1.2.0rc3-py3-none-any.whl.
File metadata
- Download URL: blender_remote-1.2.0rc3-py3-none-any.whl
- Upload date:
- Size: 47.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dd8e3e4ff83da33e18fb5a631477459509313de4686794755af2d1119b8b6d9
|
|
| MD5 |
3251ae007723439e51c173e080f556e1
|
|
| BLAKE2b-256 |
24e7e5db08890ef293ae3e92f3fdb560d8742112fd4e9296f4951dd034d28b29
|