blendersessiond
blendersessiond launches, configures, and owns local GUI Blender Sessions
for agent workflows. It installs a pinned BlenderMCP addon at startup,
allocates an isolated loopback port for each Session, reports process and
addon Health, and stops only the Blender process trees it launched.
It supports macOS, Windows, and Linux with Python 3.11 or newer.
Highlights
- No manual addon installation or Blender preference setup.
- Named Sessions with independent state, logs, and MCP ports.
- Static MCP client configuration despite dynamically allocated ports.
- Health checks require both a live Blender process and a responsive addon.
- Existing
.blendscenes and direct raw addon calls are supported. stopis predictable: it terminates the owned process tree and never saves.
Requirements and compatibility
- uv with
uvxavailable onPATH. - Python 3.11 or newer.
- Blender installed on macOS, Windows, or Linux.
blendersessiond is GUI-only and same-machine: the CLI and Blender Session run on the same machine, and blendersessiond has no remote control plane or headless mode. The real-Blender smoke workflow currently validates Blender 5.2.0 on all three platforms; macOS and Windows GUI runs are best-effort in hosted CI. See the compatibility record for the exact Blender, addon, and MCP server pins.
The addon is vendored from
ahujasid/blender-mcp at commit
da4e16d,
then minimally patched for loopback binding, per-Session ports, and managed
startup. The MCP stdio server is not vendored: mcp-serve runs the validated
blender-mcp==1.6.4 package through uvx. The complete patch and re-pin
procedure are in the compatibility record, with upstream
licensing in third-party attribution.
Install
Install the published CLI from PyPI:
uv tool install blendersessiond
Or install from a source checkout:
git clone https://github.com/BramVR/blendersessiond.git
cd blendersessiond
uv tool install .
Ensure uv's tool executable directory is on PATH. Pass Blender explicitly
when automatic discovery does not find it.
Quickstart
These commands check the machine, start the default Session with a factory-empty scene, make one raw addon call, and stop the Session:
blendersessiond doctor
blendersessiond start
blendersessiond call get_scene_info
blendersessiond stop
Use a specific Blender executable or open an existing scene when starting:
blendersessiond doctor --blender /path/to/blender
blendersessiond start --blender /path/to/blender --scene /path/to/shot.blend
--scene must name an existing .blend file. Without it, Blender opens a
factory-empty file.
Commands
doctor: Check whether this machine can host a Session and report recorded Session Health.start: Launch and own a Blender Session, optionally from an existing scene.status: Report one named Session or list every recorded Session.call: Send one raw command and optional JSON parameters to a healthy Session's addon.stop: Terminate an owned Session process tree without saving.mcp-serve: Connect the validatedblender-mcpstdio server to one healthy Session.
Run blendersessiond COMMAND --help for each command's flags. doctor,
start, status, and stop support versioned JSON output with --json;
successful call invocations always print the addon's JSON result, while
call --json also makes failures machine-readable. mcp-serve reserves
standard input and output for the MCP protocol.
Exit codes follow one convention:
0: success or healthy status;1: operation failure, including unhealthy, stale, or not-found status;2: command-line usage error.
MCP client registration
Start the default Session before launching the MCP client:
blendersessiond start
Register the installed CLI in the project's .mcp.json:
{
"mcpServers": {
"blender": {
"command": "blendersessiond",
"args": ["mcp-serve"]
}
}
}
mcp-serve requires uvx on PATH. It checks Session Health, then runs the
validated blender-mcp server against that Session's loopback port. Keep the
Session running while the MCP client uses it.
Multiple Sessions
The default Session Name is default. Use --name to run independent
Sessions side by side:
blendersessiond start --name modeling
blendersessiond start --name lighting --scene /path/to/lighting.blend
blendersessiond status
blendersessiond call get_scene_info --name modeling
blendersessiond call get_object_info --name lighting --params '{"name":"Cube"}'
blendersessiond stop --name modeling
blendersessiond stop --name lighting
Give each Session its own MCP server registration and MCP client connection:
{
"mcpServers": {
"blender-modeling": {
"command": "blendersessiond",
"args": ["mcp-serve", "--name", "modeling"]
},
"blender-lighting": {
"command": "blendersessiond",
"args": ["mcp-serve", "--name", "lighting"]
}
}
}
Save before stop
stop never saves and never prompts. Check status for the unsaved-changes
warning, then save explicitly through Blender, MCP, or call before stopping
when work must persist.
Save an already named scene through call:
blendersessiond call execute_code --params '{"code":"bpy.ops.wm.save_mainfile()"}'
blendersessiond stop
Give a factory-empty scene a path before stopping:
blendersessiond call execute_code --params '{"code":"bpy.ops.wm.save_as_mainfile(filepath=\"/absolute/path/to/scene.blend\")"}'
blendersessiond stop
Use --name SESSION on both commands for a named Session.
Configuration and state
Blender discovery uses the first available source in this order:
--blender PATHondoctororstart;- the
BLENDERSESSIOND_BLENDERenvironment variable; blenderorblender.exeonPATH;- standard platform installation locations.
When multiple valid standard installations are present, blendersessiond uses the newest version it can probe.
Session records and Blender stdout/stderr logs live under the per-user state directory:
- macOS:
~/Library/Application Support/blendersessiond - Windows:
%LOCALAPPDATA%\blendersessiond - Linux:
$XDG_STATE_HOME/blendersessiondwhen set, otherwise~/.local/state/blendersessiond
Set BLENDERSESSIOND_STATE_DIR to an absolute path to override this location.
blendersessiond status prints each Session's log paths; use --json when a
script needs the complete state record.
Session MCP ports are allocated upward from 9876 on loopback. Set
BLENDERSESSIOND_BASE_MCP_PORT to start allocation from a different port —
the test suite uses this to keep fake-Blender Sessions off the ports a real
Session on the same machine may hold.
Security and limitations
The vendored addon binds to IPv4 loopback (127.0.0.1) but its protocol is
deliberately unauthenticated and permits arbitrary Python execution inside
Blender. Any local account or process that can reach a Session's loopback port
can drive that Session. Do not expose or forward the port to an untrusted
network or machine.
The addon protocol is single-client. Give each concurrent MCP client its own
named Session. blendersessiond does not supervise or restart Sessions in the
background; status checks their Health on demand.
Development
Install the locked development environment, then run the same lint and test gates used by CI:
uv sync --locked
uv run ruff check .
uv run pytest
Real-Blender tests are opt-in because they launch the GUI. For example, on macOS or Linux:
BLENDERSESSIOND_REAL_E2E=1 \
BLENDERSESSIOND_BLENDER=/path/to/blender \
uv run pytest -m real_blender
CI runs unit and fake-Blender lifecycle tests on macOS, Windows, and Linux, plus a pinned real-Blender round trip.
Reference
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 blendersessiond-0.1.0.tar.gz.
File metadata
- Download URL: blendersessiond-0.1.0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bd2cd63caf66475a638a0277b3751194f69e669f19a8e5bbeb2b00d242b51b9
|
|
| MD5 |
fce11e4275999475ea3b5cdba0636737
|
|
| BLAKE2b-256 |
8782bf8da40340cf6567b736ea0830453f8f71338a974d68aa5cbf37c206ea0a
|
Provenance
The following attestation bundles were made for blendersessiond-0.1.0.tar.gz:
Publisher:
release.yml on BramVR/blendersessiond
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blendersessiond-0.1.0.tar.gz -
Subject digest:
2bd2cd63caf66475a638a0277b3751194f69e669f19a8e5bbeb2b00d242b51b9 - Sigstore transparency entry: 2233984561
- Sigstore integration time:
-
Permalink:
BramVR/blendersessiond@bc0fa224a2a693ac537805c6f2dad65f9beefe93 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/BramVR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc0fa224a2a693ac537805c6f2dad65f9beefe93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file blendersessiond-0.1.0-py3-none-any.whl.
File metadata
- Download URL: blendersessiond-0.1.0-py3-none-any.whl
- Upload date:
- Size: 57.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92ebb1d335cb4d587cdff978adf4d873b4952d3d8479f7a7251ac86bfdf7e41f
|
|
| MD5 |
d7da27d016e64de33a20f9de1947912a
|
|
| BLAKE2b-256 |
66c9ae831648c4043eed8bf2bbef127f8684c6a14a2c92b48727c3f6b04343a1
|
Provenance
The following attestation bundles were made for blendersessiond-0.1.0-py3-none-any.whl:
Publisher:
release.yml on BramVR/blendersessiond
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blendersessiond-0.1.0-py3-none-any.whl -
Subject digest:
92ebb1d335cb4d587cdff978adf4d873b4952d3d8479f7a7251ac86bfdf7e41f - Sigstore transparency entry: 2233985188
- Sigstore integration time:
-
Permalink:
BramVR/blendersessiond@bc0fa224a2a693ac537805c6f2dad65f9beefe93 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/BramVR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc0fa224a2a693ac537805c6f2dad65f9beefe93 -
Trigger Event:
push
-
Statement type: