BlenderLens
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BLENDER_BIN | No | Blender executable, for background sessions, `check` and `install-addon`. Default: auto. | auto |
| BLENDERLENS_HOST | No | Where the server connects to the add-on: `localhost` or a loopback IPv4 address. Default: `127.0.0.1`. | 127.0.0.1 |
| BLENDERLENS_MODE | No | `auto` (the window when its add-on is started, otherwise background), `live` (the window only) or `background`. Default: `auto`. | auto |
| BLENDERLENS_PORT | No | The add-on's port, as set in its preferences. Default: `9877`. | 9877 |
| BLENDERLENS_TOKEN | No | Overrides the token the add-on writes for the server. Default: from the add-on's file. | |
| BLENDERLENS_TIMEOUT | No | Seconds to wait for one call; `render_preview`, `bake_texture`, `run_python` and `run_script` also take `timeout`. Default: `120`. | 120 |
| BLENDERLENS_RENDER_DIR | No | Where previews go when given no `path`; in the default folder they are kept 7 days. Default: a temp folder. | |
| BLENDERLENS_RUNTIME_DIR | No | Where the add-on's token file and recovery copies of unsaved background work are kept. Default: per user. | |
| BLENDERLENS_ALLOWED_DIRS | No | Folders every path given to a tool must be inside; `;` separates them on Windows, `:` elsewhere. Default: not set. | |
| BLENDERLENS_ALLOW_PYTHON | No | `0` removes `run_python` and `run_script`. Default: `1`. | 1 |
| BLENDERLENS_START_TIMEOUT | No | Seconds to wait for a background Blender to start. Default: `90`. | 90 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
BlenderLens gives you a Blender session to model in. In live mode it is the Blender window the user watches, with the BlenderLens add-on running. In background mode it is a Blender the server starts itself when no such window is open.
You work on the open .blend file's objects, their meshes, modifiers, materials, transforms and collections, and on .glb exports and preview renders.
Every call goes to the attached session.
get_statussays which session that is, without starting one. The first call that needs Blender attaches by BLENDERLENS_MODE. In auto mode that is the Blender window running the add-on when it responds, and otherwise a background Blender.open_sessionandclose_sessionchoose explicitly. A background session's unsaved work is lost when it ends, so callsave_fileto keep it.Build with
create_object,create_mesh,edit_mesh,add_modifierandset_material. Look withrender_preview, whose PNG you open (or get inline), andget_object. Check withcheck_assetandmeasure_objects. Deliver withexport_glb, which reads the written file back and reports what it holds.undo_changetakes calls back.Units are metres and rotations are degrees. Z is up, and a model's front faces -Y. export_glb converts to glTF's Y-up, where that front faces +Z. Colours are linear unless given as '#RRGGBB'.
No tool paints textures, sculpts or rigs.
run_pythonandrun_script, when enabled, reach those and anything else, but use the tools first.Read the resource blenderlens://guide for the conventions, the traps and the build, look, check, export loop.
A refusal is a structured error with
error,exit,kindandhint. Kindnot_foundsays what is missing.bad_argumentnames what is accepted.not_connectedmeans no add-on responded.connection_lostmeans Blender went away.unsaved_changesasks for save_file or discard.deadlinemeans this call ran out of time while Blender kept working on it.busymeans Blender was still working on an earlier call, so this one was not sent.not_allowedmeans this server or that Blender forbids it.blender_missingmeans no executable was found.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_statusA | Report the attached Blender without starting one. Returns: the session (busy: what it runs), add-on, Blender, render_dir, recovery copies. WHEN TO CALL: first; after not_connected, connection_lost, busy. |
| open_sessionA | Attach to the live Blender window or start a background one. Returns: the session. WHEN TO CALL: to pick a mode or file; else the first call attaches by BLENDERLENS_MODE. |
| close_sessionA | Disconnect: a background Blender exits, a live one stays open. Returns: the mode closed. WHEN TO CALL: when the work is saved. |
| get_sceneA | Read the scene. Returns: file state, units, and each object's type, parent, location, dimensions, counts, materials, modifiers. WHEN TO CALL: before building; after not_found. |
| get_objectA | Read one object in full. Returns: transform, bounds, properties, counts before and after modifiers, modifier settings by Blender's names, slots. WHEN TO CALL: before set_modifier. |
| get_meshA | List a mesh's faces. Returns: each face's index, center, normal, side, area, material slot. WHEN TO CALL: for face indices; again after faces change. |
| list_materialsA | List materials. Returns: each one's values (linear, as glTF) and users. WHEN TO CALL: before set_material, to reuse one. |
| check_assetA | Check meshes as exported: topology, normals, scale, origin, UVs, textures, morphs, overlaps; and a project's rules or rules_file (the guide lists the keys). Returns: passed; per object stats, issues {code, severity, count, faces}. WHEN TO CALL: before export_glb. |
| measure_objectsA | Measure between objects' surfaces as exported, in world space, or cast a ray. Returns: per pair distance, closest points, touching, overlapping, overlap_faces, inside; ray object, location, normal, face. WHEN TO CALL: to fit parts, find gaps. |
| create_objectA | Add a primitive (tube, lathe and text too) or an empty, sized in the mesh so scale stays 1. Returns: its name (.001 on a clash), transform, counts. WHEN TO CALL: to start a part. |
| create_meshA | Build a mesh object from vertices and faces in its own space. Returns: as create_object. WHEN TO CALL: for a shape no primitive gives. |
| edit_meshA | Run one operation on the faces picked (faces, facing) or all. bevel: the picked faces' rim edges (all edges if all faces), or with angle the edges sharper than it. amount, offset, pivot: mesh space. Returns: result_faces (extrude: the cap; inset: inner faces), counts. WHEN TO CALL: to shape a primitive. |
| add_modifierB | Add a modifier to an object's stack. Returns: its settings, the stack, counts. WHEN TO CALL: for detail that stays editable. |
| set_modifierB | Change a modifier's settings, place or visibility. Returns: as add_modifier. WHEN TO CALL: to tune one. |
| apply_modifierA | Bake a modifier into the mesh; refused for a shared mesh or in edit mode. Returns: the stack, counts. WHEN TO CALL: when edit_mesh must see its result. |
| remove_modifierA | Remove a modifier unapplied. Returns: the stack left, counts. WHEN TO CALL: to undo add_modifier. |
| set_materialA | Create or update a material, optionally on an object or its picked faces; all its users change; '' clears an image or vertex_color. Returns: its values, slot, faces. WHEN TO CALL: after shaping. |
| set_vertex_colorA | Paint the faces picked (faces, facing) or all into a color attribute. Returns: faces painted, materials wired, and not_wired (setups not BlenderLens's). WHEN TO CALL: for colour without textures; exports as COLOR_0. |
| unwrap_uvA | Unwrap a mesh into a UV map; projections are packed. Returns: islands, area used, overlapping and out-of-bounds faces, texel density (px/m at 1024). WHEN TO CALL: before texturing or baking; unwrap needs seams (edit_mesh mark_seams). |
| join_objectsB | Join meshes into the first, keeping each piece's materials and faces. Returns: the object, slots and their faces. WHEN TO CALL: to make one part of pieces. |
| set_transformA | Set an object's location, rotation, scale or dimensions; null keeps a component. Returns: the transform; after drop, landed_on and moved_by. WHEN TO CALL: to place parts. |
| apply_transformA | Bake rotation and scale into the mesh, or move its origin, mesh and children staying put; refused for a shared mesh or in edit mode. Returns: the transform. WHEN TO CALL: after scaling, before bevel or solidify. |
| set_parentA | Parent an object, or clear its parent. Returns: the transform. WHEN TO CALL: to assemble parts into one node tree. |
| set_collectionB | Move objects into a collection. Returns: their collections. WHEN TO CALL: to group parts. |
| set_objectB | Rename or hide an object, or set its display or custom properties (exported as glTF extras). Returns: its state. WHEN TO CALL: to name, hide or tag parts. |
| duplicate_objectA | Copy an object with modifiers, materials and children. Returns: the copies. WHEN TO CALL: for repeated parts. |
| delete_objectB | Delete objects and unused mesh data. Returns: the names deleted. WHEN TO CALL: to remove parts. |
| export_glbA | Write a .glb, Y-up (-Y front becomes +Z), for a target engine; what it cannot load is refused, as is edit mode. Returns: the file read back, with warnings for the target. WHEN TO CALL: to deliver. |
| import_fileB | Import a .glb, .gltf, .obj, .fbx, .stl or .ply, or append from a .blend what is named. Returns: what it added. WHEN TO CALL: for a reference, or to check an export. |
| save_fileA | Save the open file. Returns: path, size. WHEN TO CALL: at milestones; before closing a background session. |
| open_fileC | Open a .blend in place of the open file. Returns: the scene. WHEN TO CALL: to resume work. |
| create_fileB | Start a new, unsaved file in place of the open one. Returns: the scene. WHEN TO CALL: for a new model. |
| render_previewB | Render a PNG of objects (and children) or all visible geometry, framed, others hidden, the scene unchanged. Returns: its path (open it, or inline). WHEN TO CALL: after each build step. |
| animate_objectA | Key an object's transform and shape keys into a named clip on an NLA track, exported as one glTF animation; a call replaces the object's keys in it. Returns: channels, frames, seconds, Godot warnings. WHEN TO CALL: for doors, rotors, morphs. |
| create_collisionA | Add a collision proxy over a mesh, wire-drawn and parented; named for Godot, three.js exports leave it out. Returns: its name, counts, closed, volume_ratio. WHEN TO CALL: for physics props. |
| bake_textureA | Bake a mesh's materials into a PNG through a UV map with Cycles (CPU), wired into them; render settings and selection are put back. Returns: path, size, seconds, image_driven channels. WHEN TO CALL: for procedural materials, AO. |
| export_fileA | Write FBX, OBJ, STL, PLY or USD (by extension), objects chosen as export_glb does; the file is read back in a scratch scene. Returns: path, bytes, read_back counts. WHEN TO CALL: for tools that take no glTF. |
| run_pythonA | Run Python in Blender (bpy, bmesh, mathutils); names persist; set result to return it. Returns: stdout, stderr, result. WHEN TO CALL: only for what no tool covers. |
| run_scriptA | Run a .py file in Blender as run_python does, with args; its folder, and parents up to a blenderlens.toml, are importable afresh each run. Returns: result, stdout, stderr, objects added, removed, changed. WHEN TO CALL: to build a model from its script. |
| undo_changeA | Step back through undo steps, one per call that changed something; Python references go stale. Returns: steps undone, counts, unsaved_changes. WHEN TO CALL: to take back calls that went wrong. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| guide | Conventions, traps, and the build, look, check, export loop, with Godot's part of it. |
TDQS
Scored across 40 tools
Most tools have clearly distinct resource-and-action targets, and the WHEN TO CALL clauses strongly reduce misselection. A few adjacent pairs remain easy to confuse, such as open_session/open_file/create_file, set_object/set_transform, and the modifier lifecycle tools, but the set is still largely intelligible.
All tool names use snake_case and follow a predictable verb_noun pattern: get_scene, create_mesh, set_material, apply_modifier, export_glb, run_python, and so on. The convention is maintained throughout with no mixed naming styles.
At 40 tools, the surface is substantially beyond the typical 3-15 range and is likely to burden an agent with selection overhead. The domain is broad, but several operations could be consolidated or grouped without losing capability.
The set covers the main Blender modeling-to-export lifecycle: session and file management, scene inspection, primitive and mesh creation, transforms, modifiers, materials, UVs, baking, animation, collision proxies, validation, and multiple export formats. Gaps remain around lighting, cameras, armatures/rigging, and explicit collection or material lifecycle management, but core workflows are well covered.