Blender Ollama Integration
HTTP-SSEIntegrates Blender with local AI models for natural language control of 3D modeling.
Integrates Blender with local AI models for natural language control of 3D modeling.
blender-open-mcp
is an open source project that integrates Blender with local AI models (via Ollama) using the Model Context Protocol (MCP). This allows you to control Blender using natural language prompts, leveraging the power of AI to assist with 3D modeling tasks.
pip install uv
.Clone the Repository:
git clone https://github.com/dhakalnirajan/blender-open-mcp.git cd blender-open-mcp
Create and Activate a Virtual Environment (Recommended):
uv venv source .venv/bin/activate # On Linux/macOS .venv\Scripts\activate # On Windows
Install Dependencies:
uv pip install -e .
Install the Blender Add-on:
Edit -> Preferences -> Add-ons
.Install...
.addon.py
file from the blender-open-mcp
directory.Download an Ollama Model (if not already installed):
ollama run llama3.2
(Other models like Gemma3
can also be used.)
Start the Ollama Server: Ensure Ollama is running in the background.
Start the MCP Server:
blender-mcp
Or,
python src/blender_open_mcp/server.py
By default, it listens on http://0.0.0.0:8000
, but you can modify settings:
blender-mcp --host 127.0.0.1 --port 8001 --ollama-url http://localhost:11434 --ollama-model llama3.2
Start the Blender Add-on Server:
N
to open the sidebar.Interact with blender-open-mcp
using the mcp
command-line tool:
Basic Prompt:
mcp prompt "Hello BlenderMCP!" --host http://localhost:8000
Get Scene Information:
mcp tool get_scene_info --host http://localhost:8000
Create a Cube:
mcp prompt "Create a cube named 'my_cube'." --host http://localhost:8000
Render an Image:
mcp prompt "Render the image." --host http://localhost:8000
Using PolyHaven (if enabled):
mcp prompt "Download a texture from PolyHaven." --host http://localhost:8000
Tool Name | Description | Parameters |
---|---|---|
get_scene_info | Retrieves scene details. | None |
get_object_info | Retrieves information about an object. | object_name (str) |
create_object | Creates a 3D object. | type , name , location , rotation , scale |
modify_object | Modifies an object’s properties. | name , location , rotation , scale , visible |
delete_object | Deletes an object. | name (str) |
set_material | Assigns a material to an object. | object_name , material_name , color |
render_image | Renders an image. | file_path (str) |
execute_blender_code | Executes Python code in Blender. | code (str) |
get_polyhaven_categories | Lists PolyHaven asset categories. | asset_type (str) |
search_polyhaven_assets | Searches PolyHaven assets. | asset_type , categories |
download_polyhaven_asset | Downloads a PolyHaven asset. | asset_id , asset_type , resolution , file_format |
set_texture | Applies a downloaded texture. | object_name , texture_id |
set_ollama_model | Sets the Ollama model. | model_name (str) |
set_ollama_url | Sets the Ollama server URL. | url (str) |
get_ollama_models | Lists available Ollama models. | None |
If you encounter issues:
blender-open-mcp
server are running.For further assistance, visit the GitHub Issues page.
Happy Blending with AI! 🚀