BlenderLens
v0.2.0MCP server that lets AI agents build, check, preview and export game assets in Blender
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_status Get Status
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_session Open Session
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.
| Parameter | Type | Description |
|---|---|---|
discard | boolean | Allow losing unsaved or busy work |
file | string | .blend to open |
mode | string | auto (default): live if the add-on replies |
close_session Close Session
Disconnect: a background Blender exits, a live one stays open. Returns: the mode closed. WHEN TO CALL: when the work is saved.
| Parameter | Type | Description |
|---|---|---|
discard | boolean | Allow losing unsaved or busy work |
get_scene Get Scene
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_object Get Object
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
get_mesh Get Mesh
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
evaluated | boolean | After modifiers |
include_vertices | boolean | List vertices too |
limit | integer | Default 200 |
material | integer | string | Its faces only: slot or name |
space | string | Default world |
list_materials List Materials
List materials. Returns: each one's values (linear, as glTF) and users. WHEN TO CALL: before set_material, to reuse one.
check_asset Check Asset
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.
| Parameter | Type | Description |
|---|---|---|
budget | integer | Total triangle limit |
evaluated | boolean | After modifiers (true) |
objects | array | With children (default: all export_glb writes) |
rules | object | The project's rules |
rules_file | string | Rules as a .json file |
measure_objects Measure Objects
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.
| Parameter | Type | Description |
|---|---|---|
direction | Ray, world | |
objects | array | 2 to 16; a ray may hit only these |
origin | array | Ray start |
create_object Create Object
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.
| Parameter | Type | Description |
|---|---|---|
kind * | string | empty has no mesh |
bevel_resolution | integer | tube: 4+2n sides (2) |
collection | string | Created if missing |
depth | number | Cylinder, cone height (2) |
extrude | number | text depth (size/10) |
fill | boolean | Caps (true; circle: false) |
location | array | Metres |
minor_radius | number | Torus tube (0.25) |
name | string | Default from kind |
parent | string | location relative to it |
points | array | tube path, mesh space |
profile | array | lathe: [radius, z] about Z |
radius | number | Default 1; tube 0.05 |
radius_top | number | Cone top (0) |
rings | integer | uv_sphere 16, torus 12 |
rotation | array | Degrees |
scale | Default 1 | |
segments | integer | Default 32, torus 48 |
size | cube edges (2); plane, grid [x, y]; monkey, empty, text: a number | |
smooth | boolean | tube: curved (true) or straight |
subdivisions | integer | ico_sphere 2, grid 10 |
text | string | Its words |
create_mesh Create Mesh
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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Object and mesh |
vertices * | array | Metres |
collection | string | Created if missing |
edges | array | Loose edges |
faces | array | Vertex indices around each |
location | array | Metres |
parent | string | location relative to it |
recalc_normals | boolean | Outward (default true) |
rotation | array | Degrees |
scale | Default 1 |
edit_mesh Edit Mesh
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
operation * | string | What to do |
amount | number | extrude distance, inset border, bevel width, merge distance, solidify thickness (inward) |
angle | number | Degrees: sharper edges stay sharp (shade_smooth), bevel, seam (30); dissolve_planar (5) |
cuts | integer | subdivide (1) |
depth | number | inset: in (-) or out |
direction | extrude this way; bisect plane normal (world) | |
faces | array | Indices from get_mesh |
facing | World direction | |
factor | scale by | |
fill | boolean | bisect: cap the cut (true) |
individual | boolean | inset each face alone |
keep | string | bisect: side kept (below) |
offset | array | translate by |
pivot | array | scale, rotate about; bisect plane point (default center) |
rotation | array | rotate by, degrees |
segments | integer | bevel (1) |
tolerance | number | Degrees off facing (30) |
add_modifier Add Modifier
Add a modifier to an object's stack. Returns: its settings, the stack, counts. WHEN TO CALL: for detail that stays editable.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
type * | string | bevel, array, boolean, subdivision, mirror, solidify... |
name | string | Default from type |
settings | object | Blender's names (width, count, levels, operation...); objects by name |
set_modifier Set Modifier
Change a modifier's settings, place or visibility. Returns: as add_modifier. WHEN TO CALL: to tune one.
| Parameter | Type | Description |
|---|---|---|
modifier * | string | Name |
object * | string | Name |
index | integer | Stack position, 0 first |
settings | object | By Blender's property names |
show | boolean | In viewport and render |
apply_modifier Apply Modifier
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.
| Parameter | Type | Description |
|---|---|---|
modifier * | string | Name |
object * | string | Name |
remove_modifier Remove Modifier
Remove a modifier unapplied. Returns: the stack left, counts. WHEN TO CALL: to undo add_modifier.
| Parameter | Type | Description |
|---|---|---|
modifier * | string | Name |
object * | string | Name |
set_material Set Material
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.
| Parameter | Type | Description |
|---|---|---|
material * | string | Created if missing |
alpha | number | Below 1 blends |
alpha_cutoff | number | clip below (0.5) |
alpha_mode | string | With an image or vertex_color, their alpha |
backface_culling | boolean | Hide back faces (true for new) |
base_color | [r, g, b(, a)] linear, or '#RRGGBB' sRGB | |
base_color_image | string | Image file |
emission_color | Alone sets strength 1 | |
emission_image | string | Image file |
emission_strength | number | Above 1 glows |
faces | array | Indices from get_mesh |
facing | World direction | |
metallic | number | 0 to 1 |
normal_image | string | Image file |
object | string | Mesh to put it on |
roughness | number | 0 to 1 |
tolerance | number | Degrees off facing (30) |
vertex_color | string | Color attribute as base colour |
set_vertex_color Set Vertex Color
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.
| Parameter | Type | Description |
|---|---|---|
color * | As base_color | |
object * | string | Name |
attribute | string | Default Col, made white |
faces | array | Indices from get_mesh |
facing | World direction | |
tolerance | number | Degrees off facing (30) |
use_in_material | boolean | Wire into its materials (true) |
unwrap_uv Unwrap UVs
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).
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
margin | number | Between islands, to 0.1; lightmap to 0.01 (0.01) |
method | string | Default smart |
uv_map | string | Made if missing (default active) |
join_objects Join Objects
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.
| Parameter | Type | Description |
|---|---|---|
objects * | array | The first stays |
set_transform Set Transform
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
dimensions | array | Metres, reached by scale |
drop | boolean | string | Then move along Z to rest on what is below, or on this object |
location | array | Metres, parent space |
rotation | array | Degrees |
scale | Factors |
apply_transform Apply Transform
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
location | boolean | Default false |
origin | New origin, or a world point | |
rotation | boolean | Default true; false with origin |
scale | boolean | Default true; false with origin |
set_parent Set Parent
Parent an object, or clear its parent. Returns: the transform. WHEN TO CALL: to assemble parts into one node tree.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
keep_transform | boolean | Keep world position (true) |
parent | string | null | null clears |
set_collection Set Collection
Move objects into a collection. Returns: their collections. WHEN TO CALL: to group parts.
| Parameter | Type | Description |
|---|---|---|
collection * | string | Created if missing |
objects * | array | Names |
keep_other | boolean | Stay in others too |
parent | string | Parent of a new one |
set_object Set Object Properties
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
display | string | Viewport |
empty_display | string | An empty's shape: ARROWS, CUBE, SPHERE... |
hide | boolean | Viewport; export skips it |
hide_render | boolean | Renders |
properties | object | JSON values, 8 levels deep; null removes |
rename | string | New name |
rename_data | boolean | Unshared mesh too (default true) |
duplicate_object Duplicate Object
Copy an object with modifiers, materials and children. Returns: the copies. WHEN TO CALL: for repeated parts.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
linked | boolean | Share the mesh |
name | string | For the copy |
offset | array | Metres |
with_children | boolean | Default true |
delete_object Delete Objects
Delete objects and unused mesh data. Returns: the names deleted. WHEN TO CALL: to remove parts.
| Parameter | Type | Description |
|---|---|---|
objects * | array | Names |
with_children | boolean | Else they stay in place |
export_glb Export glTF Binary
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Ends in .glb |
animations | boolean | Default true |
apply_modifiers | boolean | Default true |
at_origin | boolean | Roots written at 0,0,0 |
cameras | boolean | Default false |
clean_names | boolean | Drop .001 where unique (true for godot) |
collection | string | Its objects |
draco | boolean | Compress meshes |
extras | boolean | Custom properties (default true) |
image_format | string | Default auto |
lights | boolean | Default false |
objects | array | With children (default all) |
tangents | boolean | For normal maps |
target | string | Default generic; threejs drops -colonly proxies |
texcoords | boolean | UVs (default true) |
vertex_colors | string | Default material: those a material reads |
visible_only | boolean | Default true |
import_file Import File
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | File |
collection | string | For what it adds |
collections | array | .blend |
materials | array | .blend |
objects | array | .blend: with children |
save_file Save File
Save the open file. Returns: path, size. WHEN TO CALL: at milestones; before closing a background session.
| Parameter | Type | Description |
|---|---|---|
copy | boolean | A checkpoint; the open file keeps its path |
path | string | .blend; default the last save |
open_file Open File
Open a .blend in place of the open file. Returns: the scene. WHEN TO CALL: to resume work.
| Parameter | Type | Description |
|---|---|---|
path * | string | .blend |
discard | boolean | Allow losing unsaved changes |
create_file Create File
Start a new, unsaved file in place of the open one. Returns: the scene. WHEN TO CALL: for a new model.
| Parameter | Type | Description |
|---|---|---|
discard | boolean | Allow losing unsaved changes |
empty | boolean | Default true; else Blender's default scene |
render_preview Render Preview
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.
| Parameter | Type | Description |
|---|---|---|
azimuth | number | Degrees, front 0, right 90 |
context | array | Shown, not framed |
elevation | number | Degrees up |
engine | string | Default auto: cycles (CPU); eevee needs GPU |
hide_from_camera | array | Unseen, still casting shadows |
inline | boolean | Return the image too |
lighting | string | Default studio |
margin | number | Framing slack (1.1) |
markers | array | Return their pixels |
objects | array | Default all visible |
ortho_scale | number | Metres on long side |
path | string | *.png, only over a PNG (default render_dir) |
projection | string | Default perspective |
resolution | Pixels (768) | |
samples | integer | Default 32 |
style | string | clay, random use workbench |
timeout | number | Seconds (120) |
transparent | boolean | Background |
view | string | Default three_quarter |
views | array | Several, in one PNG |
animate_object Animate Object
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.
| Parameter | Type | Description |
|---|---|---|
clip * | string | Animation name, shared across objects |
keys * | array | {frame, location, rotation (degrees), scale, shape_key: {name: value}}; null skips an axis |
object * | string | Name |
interpolation | string | Default linear |
loop | boolean | Repeat; default as Godot reads the name |
create_collision Create Collision
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
naming | string | godot (default): -colonly, convex -convcolonly; plain: _collision |
ratio | number | decimated: faces kept (0.25) |
shape | string | Default convex |
bake_texture Bake Texture
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.
| Parameter | Type | Description |
|---|---|---|
object * | string | Name |
path * | string | *.png, only over a PNG |
from_objects | array | High-poly sources |
samples | integer | Default 32 |
size | integer | Pixels a side (1024) |
timeout | number | Seconds (120) |
type | string | Default diffuse; ao multiplies base colour |
use_in_material | boolean | Default true |
uv_map | string | Default active |
export_file Export File
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | .fbx .obj .stl .ply .usd(a|c|z) |
collection | string | Its objects |
objects | array | With children (default all) |
visible_only | boolean | Default true |
run_python Run Python
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.
| Parameter | Type | Description |
|---|---|---|
code * | string | Python source |
timeout | number | Seconds (120) |
run_script Run Script
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | .py file |
args | object | The script's args |
discard | boolean | Allow losing unsaved changes |
fresh | boolean | Start from an empty file |
timeout | number | Seconds (120) |
undo_change Undo Change
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.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Undo steps whatever made them |
list | boolean | Name the steps; undo none |
steps | integer | Default 1 |