DEV Community

Cover image for Controlling Blender with AI — Building an MCP Server for 3D Creation
NISHANT UNAVANE
NISHANT UNAVANE

Posted on

Controlling Blender with AI — Building an MCP Server for 3D Creation

Blender's Python API is powerful but has a steep learning curve. What if you could describe a 3D model in plain language and have an AI build it inside Blender automatically?

That is what Blender MCP does. It is an MCP server that connects AI assistants like Claude and GitHub Copilot to Blender in real-time.

The architecture is simple. The MCP server runs as a Node.js process and spawns Blender as a background subprocess. When you tell the AI to "create an Indian temple with red marble material," the server generates a Python script using Blender's bpy API and executes it in the background Blender instance.

The server includes procedural generation templates for Indian-themed models — temples with detailed pillars and shikharas, auto-rickshaws with functional wheels, traditional thalis with rice and multiple curries, and human figures in traditional attire. Each template is a parameterized Python script that generates geometry procedurally.

Managing the Blender subprocess was the hardest part. Blender takes seconds to start, and long operations can timeout. I built a connection pool that keeps Blender running in the background and automatically reconnects if it crashes.

Material generation uses Blender's node system instead of texture files. Wood grain, marble in multiple colors, metals like gold and copper — each material is a node tree created programmatically.

If you want to see the full source code or read about my other projects, visit my portfolio at nishantunavane.qzz.io.

Check out the Project
View Source Code on GitHub

Have you tried using AI for 3D modeling? What kind of scenes would you generate? Let me know in the comments!

Top comments (2)

Collapse
 
harjjotsinghh profile image
Harjot Singh

The wedge here is dead-on: Blender's bpy API is powerful but the learning curve is exactly the kind of barrier that keeps capable tools locked away from people who know what they want but not the API surface. Letting someone say "Indian temple, red marble" and having the agent write and run the bpy script is the right level of abstraction, the human supplies intent, the model supplies the API fluency. Spawning Blender as a background subprocess and executing generated Python is clean architecture. The one place I'd add a seatbelt: you're executing AI-generated code against a real bpy instance, and a generated script can do more than build a mesh (file ops, infinite loops, a subdivide that hangs the process). For a creative tool that's mostly fine, but the durable version sandboxes or validates the generated script before it runs, because executing model output unverified is the same trust gap whether it's 3D or backend code. That generate-then-gate instinct is core to how I build Moonshift. Are the procedural templates constraining what the model can emit, or is it free-form bpy generation each time?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.