File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,18 @@ Otherwise installation instructions are on their website: [Install uv](https://d
91
91
92
92
** ⚠️ Do not proceed before installing UV**
93
93
94
+ ### Environment Variables
95
+
96
+ The following environment variables can be used to configure the Blender connection:
97
+
98
+ - ` BLENDER_HOST ` : Host address for Blender socket server (default: "localhost")
99
+ - ` BLENDER_PORT ` : Port number for Blender socket server (default: 9876)
100
+
101
+ Example:
102
+ ``` bash
103
+ export BLENDER_HOST=' host.docker.internal'
104
+ export BLENDER_PORT=9876
105
+ ```
94
106
95
107
### Claude for Desktop Integration
96
108
Original file line number Diff line number Diff line change 18
18
format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' )
19
19
logger = logging .getLogger ("BlenderMCPServer" )
20
20
21
+ # Default configuration
22
+ DEFAULT_HOST = "localhost"
23
+ DEFAULT_PORT = 9876
24
+
21
25
@dataclass
22
26
class BlenderConnection :
23
27
host : str
@@ -225,7 +229,9 @@ def get_blender_connection():
225
229
226
230
# Create a new connection if needed
227
231
if _blender_connection is None :
228
- _blender_connection = BlenderConnection (host = "localhost" , port = 9876 )
232
+ host = os .getenv ("BLENDER_HOST" , DEFAULT_HOST )
233
+ port = int (os .getenv ("BLENDER_PORT" , DEFAULT_PORT ))
234
+ _blender_connection = BlenderConnection (host = host , port = port )
229
235
if not _blender_connection .connect ():
230
236
logger .error ("Failed to connect to Blender" )
231
237
_blender_connection = None
You can’t perform that action at this time.
0 commit comments