Chris Wahlfeldt/blender-mcp
Built by Metorial, the integration platform for agentic AI.
Chris Wahlfeldt/blender-mcp
Server Summary
Add new scripts
Edit existing scripts
Execute scripts in Blender
View execution results and errors
Track script metadata
A Model Context Protocol (MCP) server for managing and executing Blender scripts.
pip install mcp
)Start the server:
python server.py
Connect to the server using an MCP client (like Claude Desktop)
Use the provided tools to manage scripts:
add_script(name, content)
- Add a new scriptedit_script(name, content)
- Edit an existing scriptexecute_script(name, blend_file=None)
- Execute a script in Blender, optionally specifying a .blend fileremove_script(name)
- Remove a scriptAccess resources to get information:
scripts://list
- Get list of available scriptsscript://{name}
- Get content of a specific scriptresult://{name}
- Get execution result of a script# Add a simple script
add_script("hello_cube", '''
import bpy
# Clear existing objects
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
# Create a cube
bpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0))
print("Cube created!")
''')
# Execute the script
execute_script("hello_cube")
# Get the result
# Access using: result://hello_cube
# Add a script that works with a blend file
add_script("analyze_scene", '''
import bpy
# Print information about the current scene
print(f"Current Blender version: {bpy.app.version_string}")
print(f"Current file: {bpy.data.filepath}")
# List all objects in the scene
print("\\nObjects in the scene:")
for obj in bpy.data.objects:
print(f" - {obj.name} ({obj.type})")
''')
# Execute with a specific blend file
execute_script("analyze_scene", blend_file="/path/to/your/project.blend")
# Get the result
# Access using: result://analyze_scene
script_files/scripts
directoryscript_files/results
directoryscript_files/metadata.json
pip install mcp
MIT