BlenderLens
io.github.pzalutski-pixelv0.2.0Updated Oct 10, 2026
MCP server that lets AI agents build, check, preview and export game assets in Blender
Overview
Lets an assistant build, inspect, preview, check and export 3D game assets inside Blender, then verify the exported file.
- What it does
- BlenderLens drives Blender itself: it creates and edits meshes, materials, modifiers, UVs, animation and collision proxies, renders preview PNGs, measures and checks assets against a triangle budget and project rules, and exports glTF, FBX, OBJ, STL, PLY or USD files that are read back from disk and judged for Godot or three.js. It also exposes raw Python execution inside Blender and an undo step per scene-changing call. A command-line check mode runs the same checks in CI without an agent.
- When to use it
- Use it when an assistant should produce or validate 3D game assets rather than only write Blender scripts blind, for example building props, checking triangle budgets and origins, or confirming that an exported .glb holds what the target engine expects.
- Requirements
- A local process run with npx or uvx, needing Python 3.10+ or Node.js 18+, and Blender 4.2 LTS or later found via BLENDER_BIN, PATH or the usual install folders. The optional add-on is needed only to watch work in a Blender window. No GPU is required; previews and bakes render with Cycles on the CPU. Configuration uses variables such as BLENDERLENS_MODE, BLENDERLENS_HOST, BLENDERLENS_PORT, BLENDERLENS_ALLOWED_DIRS and BLENDERLENS_ALLOW_PYTHON.
Installation
In SourceWeft
- Open BlenderLens in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
BlenderLens: game assets built, checked and exported by Blender itself
[GitHub Release] [npm] [PyPI] [License: Apache 2.0]
An MCP server that lets an AI agent work in Blender itself: build and shape objects with Blender's own
operations, look at a rendered preview, check the asset against a triangle budget and your project's rules, and
export a .glb that is read back from disk and judged for Godot or three.js.
A short animated scene that an AI agent made in Blender through BlenderLens, shown at double speed.
Why
An agent that models through Blender Python is working blind. It cannot see what it built, cannot tell whether the exported file holds what it meant, and learns about a part that did not export, or an import hint it never intended, only when the game shows it.
BlenderLens never judges an asset from what the agent intended. It asks Blender, and the written file. Measured on
Blender 5.0.1, on a scene with a 0.5 m crate, a lid named Lid_col parented to it, and a metaball:
That principle, ask Blender and the file, never assume, runs through every tool. The building tools return what
Blender now holds. render_preview renders the scene with Blender. check_asset reads the mesh as the exporter
will write it. export_glb reads back the file it wrote.
Requirements
Blender 4.2 is the floor because it is the oldest LTS release with the extension system the add-on installs through. An older Blender is refused with a clear message. No GPU is needed: previews and bakes render with Cycles on the CPU.
Install
npx (recommended). The package bundles the server, and needs Python 3.10 or later on PATH.
pip
In Claude Code this goes in a project's .mcp.json. That is all a headless pipeline needs: the first call that
needs Blender starts blender --background, and the server keeps it until the server exits.
Watching it work in Blender
To have the agent work in a Blender window you watch, and can undo, install the add-on:
Then, in the 3D viewport, press N, open the BlenderLens tab and press Start. The add-on listens on this machine only, and serves only a server that holds its token, which it writes to a file the server reads.
The loop
The tools are designed around one cycle. Read it once and the rest of this document is a reference.
- Build.
create_objectmakes a part with its size built into the mesh,edit_meshshapes it,set_materialcolours it, andjoin_objectsandset_parentassemble parts. An existing build script runs as it is withrun_script. - Look.
render_previewrenders the part, or a sheet of several angles, as a PNG to look at.get_objectgives exact sizes and counts. - Check.
check_assetfinds broken geometry, unapplied scale, a misplaced origin, UV and texture problems, parts passing through each other, and anything over budget or against your rules, each with the faces concerned.measure_objectssays what touches what. - Deliver.
export_glbwrites the file for your target engine, reads it back and warns.save_filekeeps the.blend.
Three conventions apply throughout:
- Units are metres, rotations degrees, and Z is up. A model's front faces -Y;
export_glbconverts to glTF's Y-up, where the front faces +Z. - Face indices are what
get_meshlists, and change after any edit that adds or removes faces.edit_meshreturns the faces it made. - A refusal changes nothing. It is a structured error with
error,exit,kindandhint. The kinds, with their exit codes:blender_error1,not_found2,bad_argument3,python_error4,unsaved_changes5,blender_missing6,not_connected7,connection_lost8,start_failed9,version_mismatch10,token_mismatch11,busy12,not_allowed13,internal_error70,deadline124.
Tools
Session
Inspecting
Building
Arranging
Checking
Seeing
Files
Python and undo
Checking in CI
blenderlens-mcp check runs the same checks from the command line, with no agent. It exits 0 when the asset
passes, 1 when it fails, and 2 when it could not be checked; --json prints the full result. A .glb is read on
its own, with no Blender; a .blend is opened in a background Blender.
A project's rules are a JSON object. Each key is optional:
A name may also be a pattern, "re:<regular expression>". examples/rules.json
is a complete rule set, and examples/build_lantern.py
builds, checks and exports a prop through the server from start to finish.
What Blender cannot tell you
Worth knowing before you trust a result:
- Python is unrestricted.
run_pythonandrun_scriptcan do anything Python can inside Blender, including quitting it. SetBLENDERLENS_ALLOW_PYTHON=0, or turn off Allow Python from the agent in the add-on, where that matters. - Blender's glTF exporter writes a metaball as an empty node.
check_assetreports metaballs as errors, andexport_glbwarns about them. dropfinds supports at vertices. When the only contact would be edge against edge, such as one bar lying across another, that support is missed and the object drops past it.- A Principled BSDF inside a node group is invisible to BlenderLens, so it will not change that material's values.
- In a Blender window, a preview marks the file as changed, because Blender does so whenever the render engine is set, even back to the same one.
- Godot 4.7.0 to 4.7.2 ignore vertex colours on a mesh's first primitive.
export_glbwarns about affected meshes when the target isgodot.
Architecture
Two ways to reach Blender, one set of commands.
BLENDERLENS_MODE chooses: auto uses the window when its add-on is started, and a background Blender otherwise.
Both run the same command code, on Blender's main thread, where bpy may be used; mesh work goes through bmesh,
so it behaves the same with or without a window. Each call that changes the scene is one undo step.
The MCP protocol and the link to Blender are implemented on the standard library, so the package has no runtime dependencies. docs/architecture.md maps the modules, and docs/decisions/ records why each part is built as it is.
Configuration
License
Apache License 2.0 — see LICENSE and NOTICE. BlenderLens is not affiliated with or endorsed by the Blender Foundation.
Source: README.md at commit e0558f0
Tools
0Version history
1- v0.2.0LatestOct 10, 2026


