blender_exec
Execute Python scripts within Blender to automate 3D content creation, query scene data, and control the software remotely through the MCP Bridge.
Instructions
Execute a Python script inside Blender.
IMPORTANT RULES:
- The script MUST define a main() function and call it
- Use send_status("message") to report progress
- Use bpy.data.* APIs instead of bpy.ops.* when possible
- Script MUST terminate - no infinite loops
- Catch exceptions and handle errors gracefully
Args:
script: Python code to execute in Blender. Has access to 'bpy' and 'send_status()'.
Returns:
JSON string with execution results including status and any messages.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "blender_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |