Skip to main content

blendersessiond: agent-controlled local Blender Sessions

blendersessiond website PyPI version CI status Real Blender smoke status Python 3.11 or newer Supported platforms: macOS, Windows, and Linux Blender 5.2.0 validated

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 .blend scenes and direct raw addon calls are supported.
  • stop is predictable: it terminates the owned process tree and never saves.

Requirements and compatibility

  • uv with uvx available on PATH.
  • 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 validates Blender 5.2.0 on Ubuntu as a required check and on macOS as a best-effort check. It has no Windows leg, because hosted Windows runners cannot create Blender's OpenGL context. 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, managed startup, and telemetry removal. Upstream BlenderMCP includes default-on telemetry that reports usage — and, when it believes consent was given, prompts, code, and screenshots — to the upstream maintainer's hosted backend. blendersessiond does not want that telemetry: the vendored addon has all of it deleted, and mcp-serve runs the stock server with DISABLE_TELEMETRY=true, so managed Sessions send no telemetry at all. The MCP stdio server itself 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 --json
SESSION_ID=bss_replace_with_session_id_from_start
blendersessiond call get_scene_info --expect-session-id "$SESSION_ID"
blendersessiond stop --expect-session-id "$SESSION_ID"

Copy session.session_id from the start --json result. Session Names route to current state; this opaque ID proves that later calls and stops still refer to the same lifecycle. status --json reports the current ID for recovery.

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

  • capabilities: Require and report a versioned machine integration contract without touching Session state.
  • 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 validated blender-mcp stdio server to one healthy Session.
  • setup-owner: Own one fenced Blender Box setup process tree on Windows. This integration-only command is not a general remote command runner.

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.

Remote wrappers can fail closed on the exact Blender Box contract without launching Blender or reading Session state:

blendersessiond capabilities --require blender-box-v1

Wrappers that persist timeout state should also pass --require-capability typed-call-error-reason. With call --json, wire failures include a stable reason; a read-timeout expiration uses timeout.

Blender Box setup also requires the runtime-gated Windows owner contract:

blendersessiond capabilities --require blender-box-v1 --require-capability windows-setup-owner-v1

That probe creates an inert suspended Windows process inside a kill-on-close Job Object, verifies membership, and terminates it without resuming it. The capability fails closed when the current host context cannot provide atomic Job assignment. Blender Box alone drives the private setup-owner launch, status, and stop protocol with immutable Attempt and Launch identities.

Raw calls wait up to 180 seconds by default. Use call --read-timeout SECONDS for a known long render or script, up to the hard 3,600-second maximum. Keep an outer workflow deadline and choose a read timeout no later than its remaining time.

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
MODELING_ID=bss_replace_with_modeling_session_id
LIGHTING_ID=bss_replace_with_lighting_session_id
blendersessiond call get_scene_info --name modeling --expect-session-id "$MODELING_ID"
blendersessiond call get_object_info --name lighting --params '{"name":"Cube"}' --expect-session-id "$LIGHTING_ID"
blendersessiond stop --name modeling --expect-session-id "$MODELING_ID"
blendersessiond stop --name lighting --expect-session-id "$LIGHTING_ID"

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()"}' --expect-session-id "$SESSION_ID"
blendersessiond stop --expect-session-id "$SESSION_ID"

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\")"}' --expect-session-id "$SESSION_ID"
blendersessiond stop --expect-session-id "$SESSION_ID"

Use --name SESSION on both commands for a named Session.

Configuration and state

Blender discovery uses the first available source in this order:

  1. --blender PATH on doctor or start;
  2. the BLENDERSESSIOND_BLENDER environment variable;
  3. blender or blender.exe on PATH;
  4. 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/blendersessiond when 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.

On Windows, Blender Box setup attempts use the reserved setup-attempts subdirectory below this state directory. Their request, launch receipt, and terminal records are create-once. The staged script name is derived from the Attempt ID, and the owner validates its size, SHA-256, and strict UTF-8 bytes again before it can resume PowerShell.

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

Metadata

Release files for blendersessiond 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blendersessiond 0.2.0
File Size Uploaded Provenance Actions
blendersessiond-0.2.0.tar.gz 3.3 MB With provenance Details for blendersessiond-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for blendersessiond 0.2.0
File Interpreter ABI Platform Actions
blendersessiond-0.2.0-py3-none-any.whl Python 3 none any Details for blendersessiond-0.2.0-py3-none-any.whl

Total release size: 3.4 MB

Release files / blendersessiond-0.2.0.tar.gz

Download URL blendersessiond-0.2.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
3c79457530c16bfa2bc9825c66e5c1f78084481f3dff9bb19e71ee5e89d50730
BLAKE2b-256 checksum
How to use checksums
ebc7b9e9607b9c620eb8005d6b3d36784ca309a17abce7689cc5eaf6e44ee066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / blendersessiond-0.2.0-py3-none-any.whl

Download URL blendersessiond-0.2.0-py3-none-any.whl
Size 81.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1363000036f0b959f639b63bba5a4ebfd45c5a1a923c04e0e98a3e654bc51a7d
BLAKE2b-256 checksum
How to use checksums
381969a829ef979c447cd40ffa97b8b6b860ca89138f805a4c3173d61a1680ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for blendersessiond 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for blendersessiond-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page