A Model Context Protocol (MCP) server that connects LM Studio to Blender, allowing AI assistants powered by LM Studio to control Blender through natural language commands.
- Open Blender → Edit > Preferences > Add-ons
- Click Install...
- Select
blender_rest_api.py - Enable the addon (check the box)
The REST API tab will appear in the 3D Viewport sidebar (N-Panel).
Open the Sidebar (press N) → Look for "REST API" tab → Click Start Server
Or run from Text Editor:
import bpy
bpy.utils.register_module(__name__)
bpy.ops.rest_api.start_server()curl http://localhost:8080/objects
# Should return: {"objects": ["Camera", "Light", ...]}| Method | Endpoint | Description |
|---|---|---|
| POST | /execute | Execute arbitrary Python code |
| GET | /objects | List all scene objects |
| POST | /create_cube | Create a cube |
| POST | /create_sphere | Create a sphere |
| POST | /set_color | Set material color |
To connect Blender with LM Studio, you'll need to add a custom MCP server configuration. Here's how:
Before setting up the integration, install the required dependency:
pip install fastmcpCopy the configuration below into your LM Studio MCP servers settings. Just replace the placeholder paths with your actual paths:
"Blender": {
"command": "/path/to/python",
"args": [
"/path/to/blender_mcp.py"
]
}| Placeholder | Replace with | Example |
|---|---|---|
/path/to/python |
Path to your Python executable | /usr/bin/python3 |
/path/to/blender_mcp.py |
Path to this file on your computer | Wherever you cloned this repo |
Open a terminal and run:
which python3or if using a virtual environment:
source your_venv/bin/activate
which pythonThen copy the path and paste it where /path/to/python appears above.
- Open a file browser and navigate to where you cloned/downloaded this project
- Right-click on
blender_mcp.pyand look for a "Copy path" or "Properties" option - Use that full path in the configuration above
- The server runs in a thread so Blender stays responsive
- All code executes in Blender's
bpycontext - Modify the script to add more endpoints as needed
This project was vibecoded using [Qwen3.6] Local version.