meshwire 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_blender/__init__.py +3 -0
- mcp_blender/blender_client.py +685 -0
- mcp_blender/py.typed +0 -0
- mcp_blender/server.py +6528 -0
- mcp_blender/tools/__init__.py +21 -0
- mcp_blender/tools/animation.py +75 -0
- mcp_blender/tools/export.py +80 -0
- mcp_blender/tools/external.py +553 -0
- mcp_blender/tools/materials.py +96 -0
- mcp_blender/tools/modifiers.py +66 -0
- mcp_blender/tools/objects.py +136 -0
- mcp_blender/tools/render.py +74 -0
- mcp_blender/tools/scene.py +56 -0
- mcp_blender/types.py +106 -0
- mcp_blender/wire.py +478 -0
- meshwire-0.5.0.dist-info/METADATA +476 -0
- meshwire-0.5.0.dist-info/RECORD +20 -0
- meshwire-0.5.0.dist-info/WHEEL +4 -0
- meshwire-0.5.0.dist-info/entry_points.txt +3 -0
- meshwire-0.5.0.dist-info/licenses/LICENSE +661 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: meshwire
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: An independent MCP server for Blender: modeling, materials, animation, AI 3D generation, and MSFS content
|
|
5
|
+
Project-URL: Homepage, https://github.com/RFingAdam/meshwire
|
|
6
|
+
Project-URL: Repository, https://github.com/RFingAdam/meshwire
|
|
7
|
+
Project-URL: Issues, https://github.com/RFingAdam/meshwire/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/RFingAdam/meshwire/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Meshwire contributors
|
|
10
|
+
License-Expression: AGPL-3.0-or-later
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: 3d,ai,aircraft,blender,flight-simulator,livery,mcp,model-context-protocol,msfs
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: mcp>=2.0.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: jsonschema>=4.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.3.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: tomli>=2; (python_version < '3.11') and extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
<p align="center"><img src="https://raw.githubusercontent.com/RFingAdam/meshwire/main/assets/logo.svg" width="140" alt="Meshwire logo"></p>
|
|
32
|
+
|
|
33
|
+
# Meshwire
|
|
34
|
+
|
|
35
|
+
An independent MCP server for Blender. Control Blender from any MCP client, with tools for
|
|
36
|
+
modeling, materials, sculpting, animation, AI 3D generation, and Microsoft Flight Simulator content.
|
|
37
|
+
|
|
38
|
+
[](https://github.com/RFingAdam/meshwire/blob/main/LICENSE)
|
|
39
|
+
[](https://www.python.org/downloads/)
|
|
40
|
+
[](https://www.blender.org/)
|
|
41
|
+
[](https://modelcontextprotocol.io)
|
|
42
|
+
|
|
43
|
+
[Quick start](#quick-start) ·
|
|
44
|
+
[Tools](#tools) ·
|
|
45
|
+
[Self-refinement loop](#self-refinement-loop) ·
|
|
46
|
+
[Security](#security) ·
|
|
47
|
+
[Documentation](#documentation)
|
|
48
|
+
|
|
49
|
+
<!-- generated:status -->
|
|
50
|
+
> **Status:** every pull request runs each tool in real Blender 4.5 LTS and 5.2 LTS.
|
|
51
|
+
> **190 of 225 tools work on both.**
|
|
52
|
+
> 35 need what a headless test cannot provide, such as a GUI, network access, or an earlier call.
|
|
53
|
+
> Each list is under [Tools](#tools), and fixes are tracked in the [issues](https://github.com/RFingAdam/meshwire/issues).
|
|
54
|
+
<!-- /generated:status -->
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## What is Meshwire?
|
|
59
|
+
|
|
60
|
+
Meshwire is an MCP server for AI clients such as Claude Desktop, Claude Code, and Codex CLI.
|
|
61
|
+
The server speaks the Model Context Protocol over stdio. A Blender addon listens on a local TCP
|
|
62
|
+
socket and runs each command on Blender's main thread through `bpy.app.timers`.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
┌─────────────────┐ stdio ┌─────────────────┐ TCP/JSON-RPC ┌─────────────────┐
|
|
66
|
+
│ MCP client │ ◄──────────► │ MCP Server │ ◄──────────────► │ Blender Addon │
|
|
67
|
+
│ (Claude / …) │ │ (Python proc) │ 9876 to 9885 │ (bpy.app.timers)│
|
|
68
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- **Blender coverage:** scene, object, mesh, material, modifier, animation, render, export,
|
|
72
|
+
baking, geometry nodes, sculpting, rigging, physics, and annotations.
|
|
73
|
+
- **MSFS content:** LOD, collision, material, animation, and livery tools for Microsoft Flight
|
|
74
|
+
Simulator. These tools now run in the test harness, but no generated package has been
|
|
75
|
+
loaded in the sim yet, so treat their output as unproven until it has.
|
|
76
|
+
- **AI 3D generation:** text and image to 3D through Hyper3D Rodin, Meshy, Tripo, TripoSR,
|
|
77
|
+
Stable Fast 3D, Hunyuan3D, and ComfyUI.
|
|
78
|
+
- **Self-refinement loop:** render an object from several angles, score it with an Ollama vision
|
|
79
|
+
model, and iterate.
|
|
80
|
+
- **Poly Haven:** free HDRIs, textures, and models with no API key.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Quick start
|
|
85
|
+
|
|
86
|
+
### 1. Run the MCP server
|
|
87
|
+
|
|
88
|
+
With [uv](https://docs.astral.sh/uv/) there is nothing to install up front:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uvx meshwire --help
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or with pip:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install meshwire
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. Install the Blender addon
|
|
101
|
+
|
|
102
|
+
Download `meshwire-addon-<version>.zip` from [Releases](https://github.com/RFingAdam/meshwire/releases),
|
|
103
|
+
or build it from source:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git clone https://github.com/RFingAdam/meshwire
|
|
107
|
+
cd meshwire
|
|
108
|
+
python scripts/package_addon.py
|
|
109
|
+
# creates dist/meshwire-addon-<version>.zip
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
In Blender, open **Edit > Preferences > Get Extensions**, open the dropdown arrow at the top right,
|
|
113
|
+
choose **Install from Disk...**, and select the ZIP. Blender installs it as an extension and enables
|
|
114
|
+
**Meshwire**. Host, port and API keys are add-on preferences, stored per user, so a shared `.blend`
|
|
115
|
+
file carries none of them. Do not unzip the file first.
|
|
116
|
+
|
|
117
|
+
If you installed Meshwire before 0.5.0, remove the old copy first (Edit > Preferences > Add-ons,
|
|
118
|
+
**Meshwire**, Remove) and restart Blender. Two copies enabled together would start two servers, so the
|
|
119
|
+
new one shows a warning in its sidebar tab and does not start while the old one is enabled.
|
|
120
|
+
|
|
121
|
+
`execute_script` is off until you turn it on. Open the **Meshwire** tab in the 3D Viewport sidebar and
|
|
122
|
+
click **Allow Python**. It stays on until Blender closes and is off again at every start.
|
|
123
|
+
|
|
124
|
+
### 3. Configure your MCP client
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"blender": {
|
|
130
|
+
"command": "uvx",
|
|
131
|
+
"args": ["meshwire"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
If you installed with pip, use `"command": "meshwire"` with no `args`.
|
|
138
|
+
|
|
139
|
+
### 4. Connect
|
|
140
|
+
|
|
141
|
+
1. In Blender's 3D viewport, press `N` and open the **Meshwire** tab.
|
|
142
|
+
2. Click **Start Server**.
|
|
143
|
+
3. Restart your MCP client. The Blender tools appear in its tool list.
|
|
144
|
+
|
|
145
|
+
Then try:
|
|
146
|
+
|
|
147
|
+
> Create a red cube at (2, 0, 0), add a subdivision surface modifier with 2 levels, and render
|
|
148
|
+
> it to /tmp/render.png.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Tools
|
|
153
|
+
|
|
154
|
+
Each tool is run in headless Blender with valid input, with every value of each enum, and with no
|
|
155
|
+
arguments at all. A tool counts as working when every valid call succeeds or returns the error it
|
|
156
|
+
should. That does not prove the output is right, so a second test drives Blender through the real
|
|
157
|
+
socket and checks the result for core tools such as object creation, render, and bake. The
|
|
158
|
+
numbers below are generated from the test baselines by `scripts/tool_status.py`, and a test fails
|
|
159
|
+
if they drift. More detail per area is in
|
|
160
|
+
[`docs/tools.md`](https://github.com/RFingAdam/meshwire/blob/main/docs/tools.md).
|
|
161
|
+
|
|
162
|
+
<!-- generated:tools -->
|
|
163
|
+
| Area | Tools | Work on 4.5 | Work on 5.2 | Examples |
|
|
164
|
+
| --- | ---: | ---: | ---: | --- |
|
|
165
|
+
| Scene | 5 | 5 | 5 | `scene_info`, `scene_new` |
|
|
166
|
+
| Objects | 13 | 13 | 13 | `object_create`, `object_duplicate` |
|
|
167
|
+
| Mesh, curves, booleans | 38 | 35 | 35 | `mesh_bevel`, `curve_create` |
|
|
168
|
+
| Materials and nodes | 13 | 13 | 13 | `material_create`, `material_inspect_graph` |
|
|
169
|
+
| Modifiers | 5 | 5 | 5 | `modifier_add`, `modifier_apply` |
|
|
170
|
+
| Animation | 7 | 7 | 7 | `keyframe_delete`, `action_create` |
|
|
171
|
+
| Render | 6 | 5 | 5 | `render_image`, `render_multi_angle` |
|
|
172
|
+
| Import and export | 6 | 6 | 6 | `export_fbx`, `export_usd` |
|
|
173
|
+
| Measurement and validation | 7 | 7 | 7 | `measure_volume`, `measure_clearance` |
|
|
174
|
+
| Baking | 6 | 6 | 6 | `bake_pbr_batch`, `bake_from_multires` |
|
|
175
|
+
| Geometry nodes | 7 | 7 | 7 | `geonode_array_grid`, `geonode_extrude_profile` |
|
|
176
|
+
| Sculpting | 8 | 4 | 4 | `sculpt_setup`, `sculpt_remesh_voxel` |
|
|
177
|
+
| Rigging | 8 | 8 | 8 | `armature_create`, `autorig_preset` |
|
|
178
|
+
| Physics | 6 | 6 | 6 | `physics_rigid_body_add`, `physics_cloth_add` |
|
|
179
|
+
| Collections and session | 8 | 6 | 6 | `collection_create`, `save_as` |
|
|
180
|
+
| Annotations | 6 | 5 | 6 | `annotation_dimension`, `annotation_text` |
|
|
181
|
+
| MSFS content | 20 | 20 | 20 | `msfs_create_lod_hierarchy`, `msfs_setup_material` |
|
|
182
|
+
| MSFS livery | 18 | 15 | 15 | `msfs_livery_transfer`, `msfs_livery_create_package` |
|
|
183
|
+
| AI generation and refinement | 36 | 17 | 17 | `ai_mesh_remesh`, `ai_auto_uv` |
|
|
184
|
+
| Poly Haven | 2 | 0 | 0 | |
|
|
185
|
+
| **Total** | **225** | **190** | **191** | |
|
|
186
|
+
|
|
187
|
+
<details><summary>35 tools that cannot be checked headless</summary>
|
|
188
|
+
|
|
189
|
+
Where a reason names the socket lane, it runs on Blender 4.5 and 5.2 on every pull request, and on 4.2, 4.3, 4.4, 5.0 and 5.1 nightly, best effort.
|
|
190
|
+
|
|
191
|
+
| Tool | Why |
|
|
192
|
+
| --- | --- |
|
|
193
|
+
| `ai_cancel_generation` | needs a job id that only a live AI backend can issue |
|
|
194
|
+
| `ai_evaluate` | needs network access, which the harness turns off |
|
|
195
|
+
| `ai_generate_model` | no AI backend is reachable offline |
|
|
196
|
+
| `ai_generate_model_sync` | no AI backend is reachable offline |
|
|
197
|
+
| `ai_generate_reference_image` | no AI backend is reachable offline |
|
|
198
|
+
| `ai_generate_texture` | no AI backend is reachable offline |
|
|
199
|
+
| `ai_generate_texture_sync` | no AI backend is reachable offline |
|
|
200
|
+
| `ai_generate_variations` | no AI backend is reachable offline |
|
|
201
|
+
| `ai_inpaint_texture` | no AI backend is reachable offline |
|
|
202
|
+
| `ai_model_status` | needs a job id that only a live AI backend can issue |
|
|
203
|
+
| `ai_pipeline_generate` | no AI backend is reachable offline |
|
|
204
|
+
| `ai_pipeline_status` | needs a pipeline id that only a live AI backend can issue |
|
|
205
|
+
| `ai_probe_backends` | needs network access, which the harness turns off |
|
|
206
|
+
| `ai_redo_generation` | needs a previous generation, which only a live AI backend can produce |
|
|
207
|
+
| `ai_refine` | needs network access, which the harness turns off |
|
|
208
|
+
| `ai_texture_from_render` | no AI backend is reachable offline |
|
|
209
|
+
| `analyze_viewport` | needs network access, which the harness turns off |
|
|
210
|
+
| `annotation_add` | Blender 4.3 to 5.1 offers no Python call that creates an annotation stroke, so the tool says so; the socket test annotation_add_draws_or_says_why checks both outcomes |
|
|
211
|
+
| `mesh_edge_slide` | needs a 3D viewport; socket lane covers it |
|
|
212
|
+
| `mesh_knife_project` | needs a 3D viewport; socket lane covers it |
|
|
213
|
+
| `mesh_loop_cut` | needs a 3D viewport; socket lane covers it |
|
|
214
|
+
| `msfs_livery_convert_to_dds` | needs texconv from DirectXTex, which is not installed here |
|
|
215
|
+
| `msfs_livery_export_uv_layout` | the UV exporter draws on the GPU, which background mode lacks; the socket test checks it in a GUI |
|
|
216
|
+
| `msfs_livery_set_paint_brush` | needs texture paint mode from a prior msfs_livery_setup_paint_mode call, which a fresh-scene case cannot make; the socket test msfs_paint_brush_after_setup runs both |
|
|
217
|
+
| `polyhaven_download` | needs network access, which the harness turns off |
|
|
218
|
+
| `polyhaven_search` | needs network access, which the harness turns off |
|
|
219
|
+
| `redo` | Blender disables undo in background mode |
|
|
220
|
+
| `refine_get_session` | needs a session id from a prior refine_create_session call |
|
|
221
|
+
| `refine_iteration` | needs network access, which the harness turns off |
|
|
222
|
+
| `render_screenshot` | needs a 3D viewport; socket lane covers it |
|
|
223
|
+
| `sculpt_face_set_create` | face_sets_init crashes Blender in background mode, so it needs a 3D viewport; socket lane covers it |
|
|
224
|
+
| `sculpt_mask_by_topology` | the mask operators need a 3D viewport and crash Blender in background mode; socket lane covers it |
|
|
225
|
+
| `sculpt_mesh_filter` | needs a 3D viewport; socket lane covers it |
|
|
226
|
+
| `sculpt_multires_reshape` | the fixture mesh has no subdivision levels to rebuild or unsubdivide |
|
|
227
|
+
| `undo` | Blender disables undo in background mode |
|
|
228
|
+
|
|
229
|
+
</details>
|
|
230
|
+
<!-- /generated:tools -->
|
|
231
|
+
|
|
232
|
+
Every tool name takes a `blender_` prefix, for example `blender_scene_info`.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Self-refinement loop
|
|
237
|
+
|
|
238
|
+
The agent writes mesh code, renders from several angles, an Ollama vision model scores the result,
|
|
239
|
+
and the agent applies fixes until the score stops improving.
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
┌───────────┐ execute_script ┌─────────┐ render_multi_angle ┌──────────────┐
|
|
243
|
+
│ agent │ ──────────────► │ Blender │ ───────────────────► │ PNG images │
|
|
244
|
+
│ (LLM) │ │ (bpy) │ └──────┬───────┘
|
|
245
|
+
└─────┬─────┘ └─────────┘ │
|
|
246
|
+
│ analyze_viewport
|
|
247
|
+
│ apply fix │
|
|
248
|
+
│ (loop) ▼
|
|
249
|
+
│ ┌──────────────────┐
|
|
250
|
+
└─────────────────────────────────────────────────────│ Ollama Vision │
|
|
251
|
+
feedback + score │ llama3.2-vision │
|
|
252
|
+
└──────────────────┘
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
# 1. Open a refinement session
|
|
257
|
+
blender_refine_create_session(object_name="Tree", prompt="A realistic low-poly pine tree")
|
|
258
|
+
|
|
259
|
+
# 2. Generate an initial mesh
|
|
260
|
+
blender_execute_script(script="import bmesh; ...")
|
|
261
|
+
|
|
262
|
+
# 3. Evaluate
|
|
263
|
+
blender_refine_iteration(object_name="Tree", iteration=0, max_iterations=5)
|
|
264
|
+
|
|
265
|
+
# 4. Apply fixes from the feedback, then evaluate again
|
|
266
|
+
blender_execute_script(script="# fix issues from analysis ...")
|
|
267
|
+
blender_refine_iteration(object_name="Tree", iteration=1, previous_score=0.6)
|
|
268
|
+
|
|
269
|
+
# 5. Inspect the session
|
|
270
|
+
blender_refine_get_session(session_id="...")
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
See [`docs/usage.md`](https://github.com/RFingAdam/meshwire/blob/main/docs/usage.md) for a walkthrough.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## External integrations
|
|
278
|
+
|
|
279
|
+
### Poly Haven
|
|
280
|
+
|
|
281
|
+
[Poly Haven](https://polyhaven.com) provides free HDRIs, textures, and 3D models with no API key.
|
|
282
|
+
Downloads are cached locally.
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
blender_polyhaven_search(query="brick", asset_type="textures")
|
|
286
|
+
blender_polyhaven_download(asset_id="brick_wall_001", resolution="2k")
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### AI 3D model generation
|
|
290
|
+
|
|
291
|
+
| Backend | Type | Requirements | Capabilities |
|
|
292
|
+
| -------------- | ----- | ------------ | ------------------------------------- |
|
|
293
|
+
| Hyper3D Rodin | Cloud | API key | Text-to-3D, Image-to-3D |
|
|
294
|
+
| Meshy.ai | Cloud | API key | Text-to-3D, Image-to-3D, texturing |
|
|
295
|
+
| Tripo AI | Cloud | API key | Text-to-3D, Image-to-3D |
|
|
296
|
+
| TripoSR | Local | 4 GB VRAM | Image-to-3D |
|
|
297
|
+
| Stable Fast 3D | Local | 6 GB VRAM | Image-to-3D |
|
|
298
|
+
| Hunyuan3D | Local | 16 GB VRAM | Text-to-3D, Image-to-3D |
|
|
299
|
+
| ComfyUI | Local | Varies | Custom workflows |
|
|
300
|
+
|
|
301
|
+
Cloud setup:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
export RODIN_API_KEY="your-rodin-key"
|
|
305
|
+
export MESHY_API_KEY="your-meshy-key"
|
|
306
|
+
export TRIPO_API_KEY="your-tripo-key"
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Local setup:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# TripoSR is not on PyPI: clone it and put it on PYTHONPATH
|
|
313
|
+
git clone https://github.com/VAST-AI-Research/TripoSR
|
|
314
|
+
pip install -r TripoSR/requirements.txt
|
|
315
|
+
export PYTHONPATH="$PWD/TripoSR:$PYTHONPATH"
|
|
316
|
+
|
|
317
|
+
ollama pull llama3.2-vision:11b # vision model for evaluation and refinement
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Usage:
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
blender_ai_generate_model(prompt="a wooden chair", style="realistic")
|
|
324
|
+
blender_ai_generate_model(image_path="/path/to/image.png")
|
|
325
|
+
blender_ai_model_status(job_id="abc123", auto_import=true)
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Styles: `realistic`, `cartoon`, `low_poly`, `sculpture`, `anime`.
|
|
329
|
+
Formats: `glb` (default), `gltf`, `fbx`, `obj`, `usdz`.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Security
|
|
334
|
+
|
|
335
|
+
The add-on's socket needs a token. On first start the add-on makes one in the Meshwire config folder
|
|
336
|
+
(`~/.config/meshwire/token` on Linux, mode 0600) and the server reads it on every connect, so on one
|
|
337
|
+
machine there is nothing to set up. A connection must open with a `hello` within 2 seconds and prove it
|
|
338
|
+
holds the token by HMAC-SHA256 over fresh nonces. The token itself never crosses the socket. Anything
|
|
339
|
+
else is closed. For a server on another machine, set `MESHWIRE_TOKEN` there and use **Copy token** in the
|
|
340
|
+
Meshwire tab. To revoke a token, see "Rotating the token" in
|
|
341
|
+
[SECURITY.md](https://github.com/RFingAdam/meshwire/blob/main/SECURITY.md#rotating-the-token).
|
|
342
|
+
|
|
343
|
+
`blender_execute_script` runs arbitrary Python inside Blender, so it refuses every call until you click
|
|
344
|
+
**Allow Python** in the **Meshwire** sidebar tab. Only that button turns it on, and nothing a client sends
|
|
345
|
+
or a `.blend` file holds can. It resets whenever Blender starts.
|
|
346
|
+
|
|
347
|
+
- The token does not stop other programs running as you. They can read the file, so they can connect.
|
|
348
|
+
- After the handshake the traffic is not encrypted or integrity-protected. Keep the host at localhost.
|
|
349
|
+
If you bind the add-on to a non-loopback address, commands and results travel in plaintext, so anyone on
|
|
350
|
+
the network path can read or change them. For remote use, tunnel over SSH instead.
|
|
351
|
+
- Don't run untrusted prompts or scripts against a Blender session with work you care about.
|
|
352
|
+
|
|
353
|
+
Every version before 0.5.0 (the releases were 0.2.0, 0.3.0, 0.4.0 and 0.5.0a1) had no authentication:
|
|
354
|
+
any process that could reach the port, including a web page sending an HTTP POST, could drive Blender,
|
|
355
|
+
and `execute_script` ran any Python it was sent. Upgrade, and see [SECURITY.md](https://github.com/RFingAdam/meshwire/blob/main/SECURITY.md)
|
|
356
|
+
for what was confirmed and how to report a problem.
|
|
357
|
+
|
|
358
|
+
`blender_ai_configure_backend` accepts only `enabled`, `api_key`, `host` (an http or https URL),
|
|
359
|
+
`timeout`, `device` and `model` (an Ollama model name). Paths and endpoints (ComfyUI workflow, model paths, base URLs) are set in
|
|
360
|
+
**Preferences > Add-ons > Meshwire**.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Configuration
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
meshwire [--host HOST] [--port PORT]
|
|
368
|
+
|
|
369
|
+
--host HOST Blender addon host (default: 127.0.0.1)
|
|
370
|
+
--port PORT Blender addon port (default: find it, see below)
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Which Blender the server talks to is decided in this order:
|
|
374
|
+
|
|
375
|
+
1. `--port`, if given.
|
|
376
|
+
2. The `MESHWIRE_PORT` environment variable, if set.
|
|
377
|
+
3. Discovery. Each running add-on publishes a small file in `instances/` inside the Meshwire config
|
|
378
|
+
folder (next to the token), and the server picks the most recently started Blender. It moves on to an older one
|
|
379
|
+
only past a port that is not a Meshwire add-on holding your token. A busy or full newest
|
|
380
|
+
Blender gives an error naming it.
|
|
381
|
+
It looks again at every connection, so a Blender that starts or restarts later is found, and it
|
|
382
|
+
logs the port, Blender version and `.blend` file it chose. Discovery runs only when `--host` is
|
|
383
|
+
a loopback address.
|
|
384
|
+
4. Port 9876.
|
|
385
|
+
|
|
386
|
+
An explicit port is never second-guessed by discovery. With several Blenders open and no port given,
|
|
387
|
+
the newest one wins; pass `--port` to talk to another.
|
|
388
|
+
|
|
389
|
+
In Blender, the **Meshwire** tab sets the socket port and starts or stops the server. Port 0 (the
|
|
390
|
+
default) takes the first free port from 9876 to 9885, so a second Blender simply gets the next one.
|
|
391
|
+
A port you set yourself is bound exactly or the start fails with a message saying why.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Blender versions
|
|
396
|
+
|
|
397
|
+
Meshwire supports Blender 4.2 through 5.2. Blender 4.5 LTS and 5.2 LTS are tested on every pull
|
|
398
|
+
request. Blender 4.2, 4.3, 4.4, 5.0 and 5.1 are tested nightly on a best-effort basis.
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Troubleshooting
|
|
403
|
+
|
|
404
|
+
**"Connection refused":** make sure Blender is running, the **Meshwire** tab shows the server
|
|
405
|
+
running, and the port matches.
|
|
406
|
+
|
|
407
|
+
**"Python execution is off":** click **Allow Python** in the **Meshwire** sidebar tab. It resets
|
|
408
|
+
whenever Blender starts.
|
|
409
|
+
|
|
410
|
+
**"Tool not found":** restart your MCP client after editing its config, confirm the server command
|
|
411
|
+
runs on its own with `--help`, and check the client's MCP log.
|
|
412
|
+
|
|
413
|
+
**Addon doesn't appear in Blender:** check Blender's system console for errors and try reinstalling
|
|
414
|
+
the ZIP from Get Extensions > Install from Disk.
|
|
415
|
+
|
|
416
|
+
**Poly Haven downloads fail:** check your connection, confirm the asset ID exists on polyhaven.com,
|
|
417
|
+
and check disk space.
|
|
418
|
+
|
|
419
|
+
**AI generation doesn't work:** `blender_ai_list_backends` shows backend status. Check your API keys
|
|
420
|
+
for cloud backends (Preferences > Add-ons > Meshwire, or the `RODIN_API_KEY` and `MESHY_API_KEY`
|
|
421
|
+
environment variables), or your models and VRAM for local ones. Follow a job with
|
|
422
|
+
`blender_ai_model_status`.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Documentation
|
|
427
|
+
|
|
428
|
+
- **[Quick start](https://github.com/RFingAdam/meshwire/blob/main/docs/index.md):** install through first call.
|
|
429
|
+
- **[Tool reference](https://github.com/RFingAdam/meshwire/blob/main/docs/tools.md):** tools grouped by stage.
|
|
430
|
+
- **[Usage examples](https://github.com/RFingAdam/meshwire/blob/main/docs/usage.md):** self-refinement, MSFS, and livery walkthroughs.
|
|
431
|
+
- **[Architecture](https://github.com/RFingAdam/meshwire/blob/main/docs/architecture.md):** how the server and addon fit together.
|
|
432
|
+
- **[MSFS roadmap](https://github.com/RFingAdam/meshwire/blob/main/docs/MSFS_ROADMAP.md):** planned MSFS workflow.
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Development
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
git clone https://github.com/RFingAdam/meshwire
|
|
440
|
+
cd meshwire
|
|
441
|
+
python -m venv .venv
|
|
442
|
+
source .venv/bin/activate # .venv\Scripts\activate on Windows
|
|
443
|
+
pip install -e ".[dev]"
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
pytest tests/ --ignore=tests/blender_integration_test.py # unit tests
|
|
448
|
+
python -m tests.harness.driver --help # truth harness, needs Blender; see CONTRIBUTING.md
|
|
449
|
+
ruff check .
|
|
450
|
+
ruff format .
|
|
451
|
+
python scripts/package_addon.py # builds the addon ZIP
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Contributions are welcome. See [`CONTRIBUTING.md`](https://github.com/RFingAdam/meshwire/blob/main/CONTRIBUTING.md).
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
## License
|
|
459
|
+
|
|
460
|
+
[AGPL-3.0-or-later](https://github.com/RFingAdam/meshwire/blob/main/LICENSE).
|
|
461
|
+
|
|
462
|
+
## Trademarks
|
|
463
|
+
|
|
464
|
+
Meshwire is an independent project. It is not affiliated with, endorsed by, or sponsored by the
|
|
465
|
+
Blender Foundation, Microsoft, or Asobo Studio. Blender is a registered trademark of the Blender
|
|
466
|
+
Foundation. Microsoft Flight Simulator is a trademark of Microsoft Corporation. These names are used
|
|
467
|
+
only to say what Meshwire works with.
|
|
468
|
+
|
|
469
|
+
## Acknowledgments
|
|
470
|
+
|
|
471
|
+
- **[Blender Foundation](https://www.blender.org/)** for Blender.
|
|
472
|
+
- **[Poly Haven](https://polyhaven.com/)** for free 3D assets.
|
|
473
|
+
- **[Hyper3D Rodin](https://hyper3d.ai/)**, **[Meshy.ai](https://www.meshy.ai/)**,
|
|
474
|
+
**[Tripo](https://www.tripo3d.ai/)**, **TripoSR**, **Stable Fast 3D**, **Hunyuan3D**, and
|
|
475
|
+
**ComfyUI** for AI 3D backends.
|
|
476
|
+
- **The MCP working group** for the [Model Context Protocol](https://modelcontextprotocol.io).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
mcp_blender/__init__.py,sha256=gX_5vDFGnwATowqCCeYmon_DGSz38N9aemLlAqTy_08,98
|
|
2
|
+
mcp_blender/blender_client.py,sha256=5FGxBO57ci4DjBD8vF9ewP_BInsovTL_VPEDfTNta3w,28609
|
|
3
|
+
mcp_blender/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
mcp_blender/server.py,sha256=yVQ_UJnOccs619PXq6Evl7MCuF74TvyOXCTrxSR2cKQ,268739
|
|
5
|
+
mcp_blender/types.py,sha256=dUlXQ26GiU0-f7VaBjiKrEiivytv8KsDW4eddaEcsVM,2073
|
|
6
|
+
mcp_blender/wire.py,sha256=eVhm0p8ONoEBoL4HCGiHPHXFgZYS0ErXEYM4iQE0h-Y,17832
|
|
7
|
+
mcp_blender/tools/__init__.py,sha256=Ihza9Sxgbr4TCyes5B8nP2QjrMEAeboO0MlfbGylBhA,654
|
|
8
|
+
mcp_blender/tools/animation.py,sha256=nbsTxdgEmQcQTHV3xhJITrxPvmvmG0M2re4VakaBOEM,2823
|
|
9
|
+
mcp_blender/tools/export.py,sha256=rR-xQsaHyGL5nh2a4C6GdQF_0nLORoklsc4k5R-WYTo,3082
|
|
10
|
+
mcp_blender/tools/external.py,sha256=PLA0zLZxg7G8kT4FRrYZAS79pmiOrIA8hf_vZbSg4q4,22022
|
|
11
|
+
mcp_blender/tools/materials.py,sha256=duVEShsR7fIu0K8h5ev8psgyZi__1zBucO-VthyOxS8,3512
|
|
12
|
+
mcp_blender/tools/modifiers.py,sha256=ikczwt8p2-EMib3I9aCfPShQWMrGMfWjzxjk-duKyJ0,2354
|
|
13
|
+
mcp_blender/tools/objects.py,sha256=qXW1bm0SqbZrw9o2m0-lADyrQotmMdB5gwOdgJ7j9ZY,5074
|
|
14
|
+
mcp_blender/tools/render.py,sha256=Zp-aTXt76poZIZraHt5TZYFiRYtAF7tysQ-iTK7QUb4,2694
|
|
15
|
+
mcp_blender/tools/scene.py,sha256=6-CmgQBGH_0Zuc1KLtNqMPkDtFXu8Cw2pSxfSqEmJ_E,2086
|
|
16
|
+
meshwire-0.5.0.dist-info/METADATA,sha256=YKhriIrkBfOoH2WfNpqy1ucW-3NZe0PB5erTXsd08OI,22734
|
|
17
|
+
meshwire-0.5.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
18
|
+
meshwire-0.5.0.dist-info/entry_points.txt,sha256=Bd_3vmgey1hDep7yUWUySLzR681Go4Nb6hC-d9fF9LA,91
|
|
19
|
+
meshwire-0.5.0.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
20
|
+
meshwire-0.5.0.dist-info/RECORD,,
|