keyshot-mcp 0.6.0 → 0.7.0
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.
- package/README.md +340 -524
- package/assets/star-history-dark.svg +25 -0
- package/assets/star-history-light.svg +25 -0
- package/assets/workflow.svg +48 -0
- package/dist/index.js +7 -4
- package/dist/schemas.js +26 -3
- package/dist/version.js +1 -1
- package/package.json +5 -3
- package/scripts/keyshot-smoke.mjs +52 -10
- package/scripts/keyshot_bridge.py +135 -31
- package/server.json +33 -3
package/README.md
CHANGED
|
@@ -1,705 +1,521 @@
|
|
|
1
1
|
# KeyShot MCP
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/keyshot-mcp)
|
|
4
|
+
[](https://github.com/truman-t3/keyshot-mcp/actions/workflows/ci.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
English | [中文](
|
|
7
|
+
[English](#english) | [中文](#中文)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
KeyShot MCP is a local [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
10
|
+
server for inspecting, editing, and rendering KeyShot scenes through KeyShot
|
|
11
|
+
headless scripting. It lets an MCP-compatible AI agent perform repeatable product
|
|
12
|
+
visualization tasks while scenes, models, licenses, and rendered files remain on
|
|
13
|
+
the local computer.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+

|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## English
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
### What it can do
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
- Inspect scene objects, materials, cameras, model sets, and external references.
|
|
22
|
+
- Import models and optionally center them, place them on the ground, update the
|
|
23
|
+
camera target, and adjust the environment.
|
|
24
|
+
- Render one camera, selected cameras, every camera in a scene, or a sequential
|
|
25
|
+
render queue.
|
|
26
|
+
- Create and update cameras by position, look-at point, distance, field of view,
|
|
27
|
+
focal length, or reusable presets.
|
|
28
|
+
- Apply materials directly or through a local material preset library.
|
|
29
|
+
- Select environments, change brightness, and rotate the active environment.
|
|
30
|
+
- Save edited scenes to a controlled output directory.
|
|
18
31
|
|
|
19
|
-
|
|
20
|
-
- Developers who want a simple stdio MCP bridge for KeyShot.
|
|
21
|
-
- Teams that already have KeyShot licenses configured on their machines.
|
|
32
|
+
### Requirements and compatibility
|
|
22
33
|
|
|
23
|
-
This project does not include KeyShot, does not bypass licensing, and does not store license keys.
|
|
24
|
-
|
|
25
|
-
## What It Can Do
|
|
26
|
-
|
|
27
|
-
- Check whether KeyShot headless can start.
|
|
28
|
-
- Inspect a `.bip` or supported KeyShot scene file.
|
|
29
|
-
- Render a scene to an image.
|
|
30
|
-
- Batch render multiple named cameras from one scene.
|
|
31
|
-
- Automatically discover and render every camera in one scene.
|
|
32
|
-
- Import a model into a scene.
|
|
33
|
-
- Apply a material to an object.
|
|
34
|
-
- Create or update a camera.
|
|
35
|
-
- Apply reusable standard or custom camera presets.
|
|
36
|
-
- Set an environment when the installed KeyShot version exposes that function.
|
|
37
|
-
- Save a scene to a new file.
|
|
38
|
-
|
|
39
|
-
## Example Workflows
|
|
40
|
-
|
|
41
|
-
- Batch render multiple camera views from one KeyShot scene.
|
|
42
|
-
- Test several material options on the same product model.
|
|
43
|
-
- Generate product hero images with consistent resolution and output naming.
|
|
44
|
-
- Import a model, apply a material preset, set a camera, and render in one AI instruction.
|
|
45
|
-
|
|
46
|
-
## Workflow
|
|
47
|
-
|
|
48
|
-

|
|
49
|
-
|
|
50
|
-
## Requirements
|
|
51
|
-
|
|
52
|
-
- KeyShot Studio with `keyshot_headless` support.
|
|
53
34
|
- Node.js 20 or newer.
|
|
54
|
-
- A
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
| --- | --- | --- | --- |
|
|
60
|
-
| Windows 11 | KeyShot Studio 2025 / 14.1 | Node 22 | Tested |
|
|
61
|
-
| macOS | Not tested | - | Need contributors |
|
|
62
|
-
| Linux | Not tested | - | Need contributors |
|
|
63
|
-
|
|
64
|
-
## Install
|
|
65
|
-
|
|
66
|
-
### Install the published npm package
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm install -g keyshot-mcp
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The current release line is `0.6.0`. The published package is the easiest option
|
|
73
|
-
when you only want to use the MCP server. You still need KeyShot Studio and a
|
|
74
|
-
local KeyShot license.
|
|
75
|
-
|
|
76
|
-
### Install from source
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm install
|
|
80
|
-
npm run build
|
|
81
|
-
```
|
|
35
|
+
- A locally installed and licensed KeyShot version with headless scripting.
|
|
36
|
+
- Windows 11 with KeyShot Studio 2025 / KeyShot 14.1 is tested.
|
|
37
|
+
- Other KeyShot versions may work when they expose the same official scripting
|
|
38
|
+
APIs, but they are not currently verified by this project.
|
|
39
|
+
- KeyShot and its license are not included.
|
|
82
40
|
|
|
83
|
-
###
|
|
41
|
+
### Install
|
|
84
42
|
|
|
85
|
-
|
|
43
|
+
The current release is `0.7.0`.
|
|
86
44
|
|
|
87
|
-
|
|
45
|
+
#### Option 1: run with npx
|
|
88
46
|
|
|
89
|
-
|
|
90
|
-
{"mcpServers":{"keyshot":{"command":"keyshot-mcp","env":{"KEYSHOT_HEADLESS_EXE":"/absolute/path/to/keyshot_headless"}}}}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**No installation, run with npx**:
|
|
94
|
-
|
|
95
|
-
```json
|
|
96
|
-
{"mcpServers":{"keyshot":{"command":"npx","args":["-y","keyshot-mcp@0.6.0"],"env":{"KEYSHOT_HEADLESS_EXE":"/absolute/path/to/keyshot_headless"}}}}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Run from a cloned source directory** (after `npm install && npm run build`):
|
|
47
|
+
This requires no global npm installation:
|
|
100
48
|
|
|
101
49
|
```json
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
1. Find my KeyShot headless executable path.
|
|
114
|
-
2. Add a keyshot MCP server using npx -y keyshot-mcp@0.6.0.
|
|
115
|
-
3. Set KEYSHOT_HEADLESS_EXE to the detected keyshot_headless path.
|
|
116
|
-
4. Test the setup by running the keyshot_status tool.
|
|
117
|
-
5. Tell me the exact config that was added and whether the status check passed.
|
|
118
|
-
|
|
119
|
-
Do not store license keys or account passwords. Use my existing local KeyShot license configuration.
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Configure
|
|
123
|
-
|
|
124
|
-
Set the path to your KeyShot headless executable.
|
|
125
|
-
|
|
126
|
-
Windows PowerShell example:
|
|
127
|
-
|
|
128
|
-
```powershell
|
|
129
|
-
$env:KEYSHOT_HEADLESS_EXE="C:\Program Files\KeyShot Studio\bin\keyshot_headless.exe"
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
macOS/Linux shell example:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
export KEYSHOT_HEADLESS_EXE="/Applications/KeyShot Studio.app/Contents/MacOS/keyshot_headless"
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"keyshot": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "keyshot-mcp@0.7.0"],
|
|
55
|
+
"env": {
|
|
56
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
136
61
|
```
|
|
137
62
|
|
|
138
|
-
|
|
63
|
+
#### Option 2: install globally
|
|
139
64
|
|
|
140
65
|
```bash
|
|
141
|
-
npm
|
|
66
|
+
npm install -g keyshot-mcp@0.7.0
|
|
142
67
|
```
|
|
143
68
|
|
|
144
|
-
## MCP Client Example
|
|
145
|
-
|
|
146
|
-
Add a server like this to your MCP client config:
|
|
147
|
-
|
|
148
69
|
```json
|
|
149
70
|
{
|
|
150
71
|
"mcpServers": {
|
|
151
72
|
"keyshot": {
|
|
152
|
-
"command": "
|
|
153
|
-
"args": ["/absolute/path/to/keyshot-mcp/dist/index.js"],
|
|
73
|
+
"command": "keyshot-mcp",
|
|
154
74
|
"env": {
|
|
155
|
-
"KEYSHOT_HEADLESS_EXE": "/
|
|
75
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
156
76
|
}
|
|
157
77
|
}
|
|
158
78
|
}
|
|
159
79
|
}
|
|
160
80
|
```
|
|
161
81
|
|
|
162
|
-
|
|
82
|
+
#### Option 3: run from source
|
|
163
83
|
|
|
164
|
-
```
|
|
165
|
-
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/truman-t3/keyshot-mcp.git
|
|
86
|
+
cd keyshot-mcp
|
|
87
|
+
pnpm install
|
|
88
|
+
pnpm build
|
|
166
89
|
```
|
|
167
90
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
For Codex, add a `keyshot` MCP server entry to your Codex MCP configuration and point it to the built server file:
|
|
91
|
+
Configure the MCP client to run the absolute path to `dist/index.js`:
|
|
171
92
|
|
|
172
93
|
```json
|
|
173
94
|
{
|
|
174
95
|
"mcpServers": {
|
|
175
96
|
"keyshot": {
|
|
176
97
|
"command": "node",
|
|
177
|
-
"args": ["
|
|
98
|
+
"args": ["C:/absolute/path/to/keyshot-mcp/dist/index.js"],
|
|
178
99
|
"env": {
|
|
179
|
-
"KEYSHOT_HEADLESS_EXE": "/
|
|
100
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
180
101
|
}
|
|
181
102
|
}
|
|
182
103
|
}
|
|
183
104
|
}
|
|
184
105
|
```
|
|
185
106
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
## Prompt Examples
|
|
189
|
-
|
|
190
|
-
```text
|
|
191
|
-
Render the current KeyShot scene into three views: front, 45-degree perspective, and top-down. Use 1920x1080 resolution and save the outputs to the configured output folder.
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
```text
|
|
195
|
-
Import the model file at /path/to/model.step, apply a brushed metal material to the main housing, set a 45-degree camera, and render a product hero image.
|
|
196
|
-
```
|
|
107
|
+
Restart the MCP client after changing its configuration.
|
|
197
108
|
|
|
198
|
-
|
|
199
|
-
Inspect this KeyShot scene and summarize the available objects, cameras, materials, and renderable outputs.
|
|
200
|
-
```
|
|
109
|
+
### Agent installation prompt
|
|
201
110
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
save the scene to a new file, and render one preview from that camera.
|
|
205
|
-
```
|
|
111
|
+
The following prompt can be pasted into a coding agent that is allowed to edit
|
|
112
|
+
the MCP client configuration:
|
|
206
113
|
|
|
207
114
|
```text
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
115
|
+
Install KeyShot MCP 0.7.0 and configure it in my MCP client.
|
|
116
|
+
|
|
117
|
+
1. Find the local KeyShot headless executable.
|
|
118
|
+
2. Add an MCP server named "keyshot" that runs:
|
|
119
|
+
npx -y keyshot-mcp@0.7.0
|
|
120
|
+
3. Set KEYSHOT_HEADLESS_EXE to the executable path.
|
|
121
|
+
4. Keep KEYSHOT_ALLOW_EXTERNAL_OUTPUTS disabled.
|
|
122
|
+
5. Restart or reload the MCP client, then call keyshot_status.
|
|
123
|
+
6. Do not upload or publish any KeyShot scenes, models, renders, or license data.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Configuration
|
|
127
|
+
|
|
128
|
+
| Variable | Default | Purpose |
|
|
129
|
+
| --- | --- | --- |
|
|
130
|
+
| `KEYSHOT_HEADLESS_EXE` | `keyshot_headless.exe` on Windows | Absolute executable path or a command available on `PATH`. |
|
|
131
|
+
| `KEYSHOT_OUTPUT_DIR` | Package-local `outputs` | Root directory for rendered images and saved scenes. |
|
|
132
|
+
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false` | Allows output paths outside `KEYSHOT_OUTPUT_DIR` when explicitly set to `true`. |
|
|
133
|
+
| `KEYSHOT_TIMEOUT_MS` | `600000` | Timeout for one KeyShot headless process. |
|
|
134
|
+
| `KEYSHOT_LICENSE_ARGS` | empty | Optional additional KeyShot launch arguments. |
|
|
135
|
+
| `KEYSHOT_MATERIAL_PRESETS` | Built-in `presets/materials.json` | Path to a user-managed material preset file. |
|
|
136
|
+
| `KEYSHOT_CAMERA_PRESETS` | Built-in `presets/cameras.json` | Path to a user-managed camera preset file. |
|
|
137
|
+
|
|
138
|
+
Relative output paths are resolved inside `KEYSHOT_OUTPUT_DIR`. Parent traversal,
|
|
139
|
+
adjacent-prefix paths, and symbolic-link escapes are rejected by default. Input
|
|
140
|
+
scene, model, material, and environment paths may be located elsewhere.
|
|
141
|
+
|
|
142
|
+
### Tools
|
|
143
|
+
|
|
144
|
+
| Tool | Purpose |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| `keyshot_status` | Verify that KeyShot headless can start and report its version. |
|
|
147
|
+
| `keyshot_inspect_scene` | Inspect objects, cameras, materials, model sets, and references. |
|
|
148
|
+
| `keyshot_list_cameras` | List available camera names. |
|
|
149
|
+
| `keyshot_render` | Render one image. |
|
|
150
|
+
| `keyshot_render_queue` | Run independent render jobs sequentially. |
|
|
151
|
+
| `keyshot_batch_render` | Render a supplied list of named cameras from one scene. |
|
|
152
|
+
| `keyshot_render_all_cameras` | Discover and render every camera in one scene. |
|
|
153
|
+
| `keyshot_import_model` | Import a model with optional composition adjustments. |
|
|
154
|
+
| `keyshot_apply_material` | Apply a library material or material file. |
|
|
155
|
+
| `keyshot_list_material_presets` | List local material presets. |
|
|
156
|
+
| `keyshot_apply_material_preset` | Apply a named material preset. |
|
|
157
|
+
| `keyshot_set_camera` | Create or update camera transform, distance, FOV, or focal length. |
|
|
158
|
+
| `keyshot_list_camera_presets` | List standard and custom camera presets. |
|
|
159
|
+
| `keyshot_apply_camera_preset` | Apply a standard or absolute-coordinate camera preset. |
|
|
160
|
+
| `keyshot_set_environment` | Select or adjust an environment, brightness, or rotation. |
|
|
161
|
+
| `keyshot_save_scene` | Save a scene to a new output path. |
|
|
162
|
+
|
|
163
|
+
The server also exposes a `keyshot_product_render` MCP prompt and a
|
|
164
|
+
`keyshot://workflow` resource.
|
|
165
|
+
|
|
166
|
+
### Product composition examples
|
|
167
|
+
|
|
168
|
+
Import a model and prepare its initial composition:
|
|
211
169
|
|
|
212
170
|
```text
|
|
213
|
-
|
|
214
|
-
|
|
171
|
+
Import C:\models\speaker.obj into KeyShot. Center the geometry, place it on the
|
|
172
|
+
ground, update the camera look-at point and environment, then save the scene as
|
|
173
|
+
speaker-prepared.bip.
|
|
215
174
|
```
|
|
216
175
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
- `KEYSHOT_HEADLESS_EXE`: path to `keyshot_headless` or `keyshot_headless.exe`.
|
|
220
|
-
- `KEYSHOT_OUTPUT_DIR`: default output folder for renders.
|
|
221
|
-
- `KEYSHOT_LICENSE_ARGS`: optional KeyShot headless license arguments. Empty by default.
|
|
222
|
-
- `KEYSHOT_TIMEOUT_MS`: operation timeout in milliseconds. Default: `600000`.
|
|
223
|
-
- `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS`: allow output paths outside `KEYSHOT_OUTPUT_DIR`. Default: `false`.
|
|
224
|
-
- `KEYSHOT_CAMERA_PRESETS`: camera preset JSON file. Default: `presets/cameras.json`.
|
|
225
|
-
|
|
226
|
-
By default every output file must stay inside `KEYSHOT_OUTPUT_DIR`. Relative paths
|
|
227
|
-
are placed there automatically. Set the compatibility switch to `true` only when
|
|
228
|
-
an external output location is intentional; input scenes and models are unrestricted.
|
|
229
|
-
|
|
230
|
-
`samples` and `maxTimeSeconds` select different KeyShot render modes. Provide one
|
|
231
|
-
or the other, not both.
|
|
232
|
-
|
|
233
|
-
## MCP Tools
|
|
234
|
-
|
|
235
|
-
- `keyshot_status`
|
|
236
|
-
- `keyshot_inspect_scene`
|
|
237
|
-
- `keyshot_list_cameras`: list available camera names in a scene (handy before batch rendering)
|
|
238
|
-
- `keyshot_render`: render a single image
|
|
239
|
-
- `keyshot_batch_render`
|
|
240
|
-
- `keyshot_render_all_cameras`: discover and render every camera in a scene; continues after individual failures by default
|
|
241
|
-
- `keyshot_render_queue`: run several render jobs sequentially (stops at first failure unless `continueOnError`)
|
|
242
|
-
- `keyshot_import_model`
|
|
243
|
-
- `keyshot_apply_material`
|
|
244
|
-
- `keyshot_list_material_presets`: list presets from the material preset library
|
|
245
|
-
- `keyshot_apply_material_preset`: apply a named preset from the library to an object
|
|
246
|
-
- `keyshot_set_camera`
|
|
247
|
-
- `keyshot_list_camera_presets`: list standard and custom camera presets
|
|
248
|
-
- `keyshot_apply_camera_preset`: create or update a named camera from a preset
|
|
249
|
-
- `keyshot_set_environment`
|
|
250
|
-
- `keyshot_save_scene`
|
|
251
|
-
|
|
252
|
-
### Render every camera automatically
|
|
253
|
-
|
|
254
|
-
`keyshot_render_all_cameras` discovers camera names from the open scene and renders
|
|
255
|
-
them in one KeyShot headless session. `continueOnError` defaults to `true`, so a
|
|
256
|
-
failed camera is reported without blocking the remaining views. Safe duplicate
|
|
257
|
-
filenames receive `-2`, `-3`, and later suffixes. Existing files are preserved
|
|
258
|
-
unless `overwrite` is set to `true`. KeyShot's internal, non-activatable
|
|
259
|
-
`last_active` placeholder is reported and skipped.
|
|
260
|
-
|
|
261
|
-
### Material preset library
|
|
262
|
-
|
|
263
|
-
`keyshot_apply_material_preset` reads a small JSON registry so you can reuse named
|
|
264
|
-
looks instead of remembering exact KeyShot material names. Default location:
|
|
265
|
-
`presets/materials.json` (override with the `KEYSHOT_MATERIAL_PRESETS` env var).
|
|
176
|
+
The corresponding `keyshot_import_model` options are:
|
|
266
177
|
|
|
267
178
|
```json
|
|
268
179
|
{
|
|
269
|
-
"
|
|
270
|
-
"
|
|
180
|
+
"centerGeometry": true,
|
|
181
|
+
"snapToGround": true,
|
|
182
|
+
"adjustCameraLookAt": true,
|
|
183
|
+
"adjustEnvironment": true
|
|
271
184
|
}
|
|
272
185
|
```
|
|
273
186
|
|
|
274
|
-
|
|
275
|
-
`keyshot_list_material_presets` to see what is available.
|
|
276
|
-
|
|
277
|
-
### Camera preset library
|
|
187
|
+
Create a product camera with one lens control:
|
|
278
188
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
Set `KEYSHOT_CAMERA_PRESETS` to a user-managed JSON file for custom presets:
|
|
284
|
-
|
|
285
|
-
```json
|
|
286
|
-
{
|
|
287
|
-
"Front": { "standardView": "front" },
|
|
288
|
-
"Hero": {
|
|
289
|
-
"position": [4.5, 3.5, 4.5],
|
|
290
|
-
"lookAt": [0, 0, 0],
|
|
291
|
-
"up": [0, 1, 0],
|
|
292
|
-
"description": "Custom absolute product camera"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
189
|
+
```text
|
|
190
|
+
Set the Product Hero camera to a 55 mm focal length and distance 6, save a new
|
|
191
|
+
scene, then render a PNG preview.
|
|
295
192
|
```
|
|
296
193
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
## MCP Prompts and Resources
|
|
194
|
+
`fieldOfView` must be greater than `0` and less than `180`. `focalLength` accepts
|
|
195
|
+
`5` to `200` mm. The two controls are mutually exclusive. `position` and
|
|
196
|
+
`lookAt` are optional, but must be supplied together when changing the transform.
|
|
302
197
|
|
|
303
|
-
|
|
304
|
-
- Resource: `keyshot://workflow`
|
|
198
|
+
Rotate the active HDRI or environment:
|
|
305
199
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
- `outputFiles`
|
|
311
|
-
- `warnings`
|
|
312
|
-
- `keyshotStdoutTail`
|
|
313
|
-
- `error`
|
|
200
|
+
```text
|
|
201
|
+
Rotate the current KeyShot environment to 45 degrees, save the edited scene,
|
|
202
|
+
and render all cameras.
|
|
203
|
+
```
|
|
314
204
|
|
|
315
|
-
|
|
205
|
+
`rotation` accepts values from `0` inclusive to `360` exclusive.
|
|
316
206
|
|
|
317
|
-
|
|
207
|
+
For rendering, `samples` and `maxTimeSeconds` select different KeyShot render
|
|
208
|
+
modes and cannot be supplied together.
|
|
318
209
|
|
|
319
|
-
|
|
210
|
+
### Camera and material presets
|
|
320
211
|
|
|
321
|
-
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
- [x] Sequential render queue
|
|
325
|
-
- [x] Safer output directory restrictions
|
|
326
|
-
- [ ] More tested KeyShot versions
|
|
327
|
-
- [ ] macOS compatibility verification
|
|
328
|
-
- [x] Claude Desktop / Cursor / Codex config examples
|
|
212
|
+
The built-in camera library includes Front, Back, Left, Right, Top, Bottom, and
|
|
213
|
+
Isometric views. A custom `KEYSHOT_CAMERA_PRESETS` JSON file may contain standard
|
|
214
|
+
views or absolute `position`, `lookAt`, and optional `up` vectors.
|
|
329
215
|
|
|
330
|
-
|
|
216
|
+
Material presets are stored in JSON and reference KeyShot library material names
|
|
217
|
+
or local material files. The MCP server reads preset files but does not modify
|
|
218
|
+
them.
|
|
331
219
|
|
|
332
|
-
|
|
220
|
+
### Reproducible KeyShot smoke test
|
|
333
221
|
|
|
334
|
-
The
|
|
335
|
-
|
|
222
|
+
The repository includes a smoke test built from generated cube geometry in
|
|
223
|
+
`examples/demo`. It verifies startup, import composition, scene inspection,
|
|
224
|
+
camera presets, focal length, field of view, camera distance, environment
|
|
225
|
+
rotation, scene saving, camera discovery, and real PNG rendering:
|
|
336
226
|
|
|
337
227
|
```bash
|
|
338
228
|
npm run smoke:keyshot
|
|
339
229
|
```
|
|
340
230
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
MIT
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
# 中文说明
|
|
348
|
-
|
|
349
|
-
[English](#keyshot-mcp) | 中文
|
|
350
|
-
|
|
351
|
-
这是一个本地 KeyShot MCP 服务,可以让支持 MCP 的 AI 工具通过 KeyShot 的无界面脚本能力控制 KeyShot Studio。
|
|
352
|
-
|
|
353
|
-
简单说:你可以让 AI 帮你检查 KeyShot 场景、渲染图片、导入模型、替换材质、调整相机、设置环境并保存场景。
|
|
354
|
-
|
|
355
|
-
本项目优先面向 Windows 环境下的 KeyShot Studio 产品渲染自动化流程。
|
|
356
|
-
|
|
357
|
-
与仅面向界面操作的自动化脚本不同,本项目优先面向 KeyShot 无界面工作流,并为 AI Agent 提供稳定的 MCP 工具接口。
|
|
358
|
-
|
|
359
|
-
## 适合谁使用
|
|
360
|
-
|
|
361
|
-
- 希望用 AI 辅助 KeyShot 渲染的设计师。
|
|
362
|
-
- 想要 KeyShot MCP 桥接工具的开发者。
|
|
363
|
-
- 已经在电脑上配置好 KeyShot 授权的团队。
|
|
364
|
-
|
|
365
|
-
这个项目不包含 KeyShot,不绕过 KeyShot 授权,也不会保存许可证密钥。
|
|
366
|
-
|
|
367
|
-
## 能做什么
|
|
368
|
-
|
|
369
|
-
- 检查 KeyShot 无界面程序是否能启动。
|
|
370
|
-
- 检查 `.bip` 或 KeyShot 支持的场景文件。
|
|
371
|
-
- 把场景渲染成图片。
|
|
372
|
-
- 从同一个场景批量渲染多个指定相机。
|
|
373
|
-
- 自动发现并渲染场景中的全部相机。
|
|
374
|
-
- 把模型导入场景。
|
|
375
|
-
- 给对象替换材质。
|
|
376
|
-
- 创建或更新相机。
|
|
377
|
-
- 应用可复用的标准或自定义相机预设。
|
|
378
|
-
- 在当前 KeyShot 版本支持时设置环境。
|
|
379
|
-
- 把场景保存为新文件。
|
|
380
|
-
|
|
381
|
-
## 典型使用场景
|
|
382
|
-
|
|
383
|
-
- 批量渲染同一个 KeyShot 场景的多个相机视角。
|
|
384
|
-
- 对同一个产品模型快速测试多组材质方案。
|
|
385
|
-
- 统一输出产品首图、封面图、详情页渲染图。
|
|
386
|
-
- 用一句自然语言完成导入模型、替换材质、设置相机、渲染出图。
|
|
387
|
-
|
|
388
|
-
## 工作流程
|
|
389
|
-
|
|
390
|
-

|
|
391
|
-
|
|
392
|
-
## 使用要求
|
|
231
|
+
Generated `.bip` files and test renders remain in the configured local output
|
|
232
|
+
directory. The repository includes one representative result:
|
|
393
233
|
|
|
394
|
-
|
|
395
|
-
- Node.js 20 或更新版本。
|
|
396
|
-
- 电脑上已经配置好有效的 KeyShot 授权。
|
|
234
|
+

|
|
397
235
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
| 平台 | KeyShot 版本 | Node 版本 | 状态 |
|
|
401
|
-
| --- | --- | --- | --- |
|
|
402
|
-
| Windows 11 | KeyShot Studio 2025 / 14.1 | Node 22 | 已测试 |
|
|
403
|
-
| macOS | 未测试 | - | 需要贡献者 |
|
|
404
|
-
| Linux | 未测试 | - | 需要贡献者 |
|
|
405
|
-
|
|
406
|
-
## 安装
|
|
407
|
-
|
|
408
|
-
### 安装已发布的 npm 包
|
|
236
|
+
### Development and tests
|
|
409
237
|
|
|
410
238
|
```bash
|
|
411
|
-
|
|
239
|
+
pnpm install
|
|
240
|
+
pnpm check
|
|
241
|
+
pnpm test
|
|
242
|
+
python -m unittest discover -s tests -p "test_*.py"
|
|
243
|
+
npm pack --dry-run
|
|
412
244
|
```
|
|
413
245
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
### 从源码安装
|
|
418
|
-
|
|
419
|
-
```bash
|
|
420
|
-
npm install
|
|
421
|
-
npm run build
|
|
422
|
-
```
|
|
246
|
+
CI runs on Windows and Ubuntu with Node.js 20 and 24. Linux CI validates the MCP
|
|
247
|
+
server, bridge logic, and package; it does not claim that KeyShot itself runs on
|
|
248
|
+
Linux.
|
|
423
249
|
|
|
424
|
-
###
|
|
250
|
+
### Roadmap
|
|
425
251
|
|
|
426
|
-
|
|
252
|
+
- Verify additional KeyShot releases on real installations.
|
|
253
|
+
- Verify macOS installation and headless behavior.
|
|
254
|
+
- Add depth-of-field and additional lens controls when stable headless APIs are
|
|
255
|
+
available.
|
|
427
256
|
|
|
428
|
-
|
|
257
|
+
### Star history
|
|
429
258
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
259
|
+
<picture>
|
|
260
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/star-history-dark.svg">
|
|
261
|
+
<source media="(prefers-color-scheme: light)" srcset="assets/star-history-light.svg">
|
|
262
|
+
<img alt="GitHub star history for truman-t3/keyshot-mcp" src="assets/star-history-light.svg">
|
|
263
|
+
</picture>
|
|
433
264
|
|
|
434
|
-
|
|
265
|
+
The chart uses the actual `starred_at` date for each GitHub star and displays a
|
|
266
|
+
cumulative step line. A weekly GitHub Action updates it only when detailed
|
|
267
|
+
stargazer dates are available.
|
|
435
268
|
|
|
436
|
-
|
|
437
|
-
{"mcpServers":{"keyshot":{"command":"npx","args":["-y","keyshot-mcp@0.6.0"],"env":{"KEYSHOT_HEADLESS_EXE":"C:/KeyShot/bin/keyshot_headless.exe"}}}}
|
|
438
|
-
```
|
|
269
|
+
### License and security
|
|
439
270
|
|
|
440
|
-
|
|
271
|
+
Released under the [MIT License](LICENSE). See [SECURITY.md](SECURITY.md) for
|
|
272
|
+
security guidance and [CONTRIBUTING.md](CONTRIBUTING.md) for development notes.
|
|
273
|
+
Do not commit KeyShot licenses, private scenes, customer assets, or unpublished
|
|
274
|
+
renders.
|
|
441
275
|
|
|
442
|
-
|
|
443
|
-
{"mcpServers":{"keyshot":{"command":"node","args":["C:/path/to/keyshot-mcp/dist/index.js"],"env":{"KEYSHOT_HEADLESS_EXE":"C:/KeyShot/bin/keyshot_headless.exe"}}}}
|
|
444
|
-
```
|
|
276
|
+
---
|
|
445
277
|
|
|
446
|
-
##
|
|
278
|
+
## 中文
|
|
447
279
|
|
|
448
|
-
|
|
280
|
+
KeyShot MCP 是一个本地运行的
|
|
281
|
+
[Model Context Protocol](https://modelcontextprotocol.io/) 服务,通过 KeyShot
|
|
282
|
+
headless 脚本让兼容 MCP 的 AI Agent 检查、编辑和渲染 KeyShot 场景。场景、模型、
|
|
283
|
+
许可证和渲染文件均保留在本机。
|
|
449
284
|
|
|
450
|
-
|
|
451
|
-
请帮我安装 KeyShot MCP 0.6.0,并添加到我的 MCP 客户端。
|
|
285
|
+
### 主要功能
|
|
452
286
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
287
|
+
- 检查场景对象、材质、相机、模型集和外部引用。
|
|
288
|
+
- 导入模型,并可选择自动居中、贴地、调整相机观察点和环境。
|
|
289
|
+
- 渲染单个相机、指定相机、场景中的全部相机或顺序渲染队列。
|
|
290
|
+
- 通过位置、观察点、距离、视野角、焦距或预设创建和更新相机。
|
|
291
|
+
- 直接应用材质,或使用本地材质预设库。
|
|
292
|
+
- 选择环境、调整亮度并旋转当前环境。
|
|
293
|
+
- 将修改后的场景保存到受控输出目录。
|
|
459
294
|
|
|
460
|
-
|
|
461
|
-
```
|
|
295
|
+
### 运行要求与兼容性
|
|
462
296
|
|
|
463
|
-
|
|
297
|
+
- Node.js 20 或更高版本。
|
|
298
|
+
- 本机已安装并获得许可、且支持 headless 脚本的 KeyShot。
|
|
299
|
+
- 已实测:Windows 11、KeyShot Studio 2025 / KeyShot 14.1。
|
|
300
|
+
- 其他 KeyShot 版本在提供相同官方脚本 API 时可能兼容,但本项目尚未完成实机验证。
|
|
301
|
+
- 本项目不包含 KeyShot 软件或许可证。
|
|
464
302
|
|
|
465
|
-
|
|
303
|
+
### 安装
|
|
466
304
|
|
|
467
|
-
|
|
305
|
+
当前版本为 `0.7.0`。
|
|
468
306
|
|
|
469
|
-
|
|
470
|
-
$env:KEYSHOT_HEADLESS_EXE="C:\Program Files\KeyShot Studio\bin\keyshot_headless.exe"
|
|
471
|
-
```
|
|
307
|
+
#### 方式一:使用 npx
|
|
472
308
|
|
|
473
|
-
|
|
309
|
+
无需全局安装 npm 包:
|
|
474
310
|
|
|
475
|
-
```
|
|
476
|
-
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"mcpServers": {
|
|
314
|
+
"keyshot": {
|
|
315
|
+
"command": "npx",
|
|
316
|
+
"args": ["-y", "keyshot-mcp@0.7.0"],
|
|
317
|
+
"env": {
|
|
318
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
477
323
|
```
|
|
478
324
|
|
|
479
|
-
|
|
325
|
+
#### 方式二:全局安装
|
|
480
326
|
|
|
481
327
|
```bash
|
|
482
|
-
npm
|
|
328
|
+
npm install -g keyshot-mcp@0.7.0
|
|
483
329
|
```
|
|
484
330
|
|
|
485
|
-
## MCP 客户端配置示例
|
|
486
|
-
|
|
487
|
-
把类似下面的配置加到你的 MCP 客户端里:
|
|
488
|
-
|
|
489
331
|
```json
|
|
490
332
|
{
|
|
491
333
|
"mcpServers": {
|
|
492
334
|
"keyshot": {
|
|
493
|
-
"command": "
|
|
494
|
-
"args": ["/absolute/path/to/keyshot-mcp/dist/index.js"],
|
|
335
|
+
"command": "keyshot-mcp",
|
|
495
336
|
"env": {
|
|
496
|
-
"KEYSHOT_HEADLESS_EXE": "/
|
|
337
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
497
338
|
}
|
|
498
339
|
}
|
|
499
340
|
}
|
|
500
341
|
}
|
|
501
342
|
```
|
|
502
343
|
|
|
503
|
-
|
|
344
|
+
#### 方式三:从源码运行
|
|
504
345
|
|
|
505
|
-
```
|
|
506
|
-
|
|
346
|
+
```bash
|
|
347
|
+
git clone https://github.com/truman-t3/keyshot-mcp.git
|
|
348
|
+
cd keyshot-mcp
|
|
349
|
+
pnpm install
|
|
350
|
+
pnpm build
|
|
507
351
|
```
|
|
508
352
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
如果你使用 Codex,请在 Codex 的 MCP 配置里添加一个 `keyshot` 服务,并指向构建后的服务文件:
|
|
353
|
+
将 MCP 客户端配置为运行 `dist/index.js` 的绝对路径:
|
|
512
354
|
|
|
513
355
|
```json
|
|
514
356
|
{
|
|
515
357
|
"mcpServers": {
|
|
516
358
|
"keyshot": {
|
|
517
359
|
"command": "node",
|
|
518
|
-
"args": ["
|
|
360
|
+
"args": ["C:/absolute/path/to/keyshot-mcp/dist/index.js"],
|
|
519
361
|
"env": {
|
|
520
|
-
"KEYSHOT_HEADLESS_EXE": "/
|
|
362
|
+
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
521
363
|
}
|
|
522
364
|
}
|
|
523
365
|
}
|
|
524
366
|
}
|
|
525
367
|
```
|
|
526
368
|
|
|
527
|
-
|
|
369
|
+
修改配置后请重启或重新加载 MCP 客户端。
|
|
528
370
|
|
|
529
|
-
|
|
371
|
+
### 复制给 Agent 的安装提示词
|
|
530
372
|
|
|
531
|
-
|
|
532
|
-
把当前 KeyShot 场景渲染成三个视角:正视图、45 度透视图和俯视图。分辨率为 1920x1080,并保存到默认输出文件夹。
|
|
533
|
-
```
|
|
373
|
+
下面的提示词适用于有权限修改 MCP 客户端配置的编程 Agent:
|
|
534
374
|
|
|
535
375
|
```text
|
|
536
|
-
|
|
537
|
-
|
|
376
|
+
请帮我安装 KeyShot MCP 0.7.0,并添加到我的 MCP 客户端。
|
|
377
|
+
|
|
378
|
+
1. 查找本机 KeyShot headless 可执行文件。
|
|
379
|
+
2. 添加名为 keyshot 的 MCP server,运行:
|
|
380
|
+
npx -y keyshot-mcp@0.7.0
|
|
381
|
+
3. 将 KEYSHOT_HEADLESS_EXE 设置为可执行文件路径。
|
|
382
|
+
4. 保持 KEYSHOT_ALLOW_EXTERNAL_OUTPUTS 关闭。
|
|
383
|
+
5. 重启或重新加载 MCP 客户端,然后调用 keyshot_status。
|
|
384
|
+
6. 不要上传或发布任何 KeyShot 场景、模型、渲染图或许可证数据。
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### 配置项
|
|
388
|
+
|
|
389
|
+
| 环境变量 | 默认值 | 用途 |
|
|
390
|
+
| --- | --- | --- |
|
|
391
|
+
| `KEYSHOT_HEADLESS_EXE` | Windows 上为 `keyshot_headless.exe` | KeyShot headless 绝对路径,或系统 `PATH` 中的命令。 |
|
|
392
|
+
| `KEYSHOT_OUTPUT_DIR` | 包内 `outputs` | 渲染图和已保存场景的根目录。 |
|
|
393
|
+
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false` | 明确设为 `true` 时允许写入输出根目录之外。 |
|
|
394
|
+
| `KEYSHOT_TIMEOUT_MS` | `600000` | 单个 KeyShot headless 进程的超时时间。 |
|
|
395
|
+
| `KEYSHOT_LICENSE_ARGS` | 空 | 可选的 KeyShot 启动参数。 |
|
|
396
|
+
| `KEYSHOT_MATERIAL_PRESETS` | 内置 `presets/materials.json` | 自定义材质预设 JSON 路径。 |
|
|
397
|
+
| `KEYSHOT_CAMERA_PRESETS` | 内置 `presets/cameras.json` | 自定义相机预设 JSON 路径。 |
|
|
398
|
+
|
|
399
|
+
相对输出路径会自动放入 `KEYSHOT_OUTPUT_DIR`。默认拒绝 `..`、相邻同名前缀目录和
|
|
400
|
+
软链接逃逸。输入场景、模型、材质和环境文件可位于其他目录。
|
|
401
|
+
|
|
402
|
+
### MCP 工具
|
|
403
|
+
|
|
404
|
+
| 工具 | 用途 |
|
|
405
|
+
| --- | --- |
|
|
406
|
+
| `keyshot_status` | 检查 KeyShot headless 是否可启动并读取版本。 |
|
|
407
|
+
| `keyshot_inspect_scene` | 检查对象、相机、材质、模型集和外部引用。 |
|
|
408
|
+
| `keyshot_list_cameras` | 列出场景中的相机名称。 |
|
|
409
|
+
| `keyshot_render` | 渲染一张图片。 |
|
|
410
|
+
| `keyshot_render_queue` | 顺序执行多个独立渲染任务。 |
|
|
411
|
+
| `keyshot_batch_render` | 渲染用户指定的一组相机。 |
|
|
412
|
+
| `keyshot_render_all_cameras` | 自动发现并渲染场景中的全部相机。 |
|
|
413
|
+
| `keyshot_import_model` | 导入模型并可选择自动构图。 |
|
|
414
|
+
| `keyshot_apply_material` | 应用材质库名称或材质文件。 |
|
|
415
|
+
| `keyshot_list_material_presets` | 列出本地材质预设。 |
|
|
416
|
+
| `keyshot_apply_material_preset` | 应用指定材质预设。 |
|
|
417
|
+
| `keyshot_set_camera` | 创建或更新相机变换、距离、视野角或焦距。 |
|
|
418
|
+
| `keyshot_list_camera_presets` | 列出标准和自定义相机预设。 |
|
|
419
|
+
| `keyshot_apply_camera_preset` | 应用标准视角或绝对坐标相机预设。 |
|
|
420
|
+
| `keyshot_set_environment` | 选择环境并调整亮度或旋转角度。 |
|
|
421
|
+
| `keyshot_save_scene` | 将场景保存到新的输出路径。 |
|
|
422
|
+
|
|
423
|
+
服务还提供 `keyshot_product_render` MCP 提示词和 `keyshot://workflow` 资源。
|
|
424
|
+
|
|
425
|
+
### 产品构图示例
|
|
426
|
+
|
|
427
|
+
导入模型并完成初始构图:
|
|
538
428
|
|
|
539
429
|
```text
|
|
540
|
-
|
|
430
|
+
把 C:\models\speaker.obj 导入 KeyShot,自动居中、贴地、调整相机观察点和环境,
|
|
431
|
+
然后保存为 speaker-prepared.bip。
|
|
541
432
|
```
|
|
542
433
|
|
|
543
|
-
|
|
544
|
-
列出当前 KeyShot 场景中的相机,创建或更新一个名为“Hero”的相机,
|
|
545
|
-
把场景保存为新文件,并用这个相机渲染一张预览图。
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
```text
|
|
549
|
-
自动找出这个 KeyShot 场景里的全部相机,把所有视角渲染到 all-cameras 文件夹。
|
|
550
|
-
某个相机失败时继续处理其他相机,最后告诉我每个视角的结果。
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
```text
|
|
554
|
-
列出可用的相机预设,把 Isometric 等距预设应用为名为“目录等距视图”的相机,
|
|
555
|
-
保存一份新场景,并用这个相机渲染预览图。
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
## 环境变量
|
|
559
|
-
|
|
560
|
-
- `KEYSHOT_HEADLESS_EXE`:`keyshot_headless` 或 `keyshot_headless.exe` 的路径。
|
|
561
|
-
- `KEYSHOT_OUTPUT_DIR`:默认渲染输出文件夹。
|
|
562
|
-
- `KEYSHOT_LICENSE_ARGS`:可选的 KeyShot 无界面许可证参数,默认留空。
|
|
563
|
-
- `KEYSHOT_TIMEOUT_MS`:单次操作超时时间,单位毫秒,默认 `600000`。
|
|
564
|
-
- `KEYSHOT_MATERIAL_PRESETS`:材质预设库 JSON 文件路径,默认 `presets/materials.json`。
|
|
565
|
-
- `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS`:是否允许写到默认输出目录之外,默认 `false`。
|
|
566
|
-
- `KEYSHOT_CAMERA_PRESETS`:相机预设 JSON 文件路径,默认 `presets/cameras.json`。
|
|
567
|
-
|
|
568
|
-
默认情况下,所有输出图片和场景都必须写入 `KEYSHOT_OUTPUT_DIR`,相对路径会自动放入该目录。
|
|
569
|
-
只有确实需要写到外部目录时才设置为 `true`;输入场景和模型路径不受此限制。
|
|
570
|
-
|
|
571
|
-
`samples` 和 `maxTimeSeconds` 是两种不同的 KeyShot 渲染模式,请二选一,不要同时传入。
|
|
572
|
-
|
|
573
|
-
## MCP 工具
|
|
574
|
-
|
|
575
|
-
- `keyshot_status`:检查 KeyShot 是否能启动。
|
|
576
|
-
- `keyshot_inspect_scene`:检查场景内容。
|
|
577
|
-
- `keyshot_list_cameras`:列出场景中所有相机名称(批量渲染前很有用)。
|
|
578
|
-
- `keyshot_render`:渲染单张图片。
|
|
579
|
-
- `keyshot_batch_render`:批量渲染多个相机视角。
|
|
580
|
-
- `keyshot_render_all_cameras`:自动发现并渲染场景中的全部相机,默认单个视角失败后继续。
|
|
581
|
-
- `keyshot_render_queue`:顺序执行多个渲染任务(默认遇错即停,设置 `continueOnError` 可继续)。
|
|
582
|
-
- `keyshot_import_model`:导入模型。
|
|
583
|
-
- `keyshot_apply_material`:替换材质。
|
|
584
|
-
- `keyshot_list_material_presets`:列出材质预设库中的预设。
|
|
585
|
-
- `keyshot_apply_material_preset`:把预设库中的某个命名材质应用到物体上。
|
|
586
|
-
- `keyshot_set_camera`:设置相机。
|
|
587
|
-
- `keyshot_list_camera_presets`:列出标准和自定义相机预设。
|
|
588
|
-
- `keyshot_apply_camera_preset`:用预设创建或更新命名相机。
|
|
589
|
-
- `keyshot_set_environment`:设置环境。
|
|
590
|
-
- `keyshot_save_scene`:保存场景。
|
|
591
|
-
|
|
592
|
-
### 自动渲染全部相机
|
|
593
|
-
|
|
594
|
-
`keyshot_render_all_cameras` 会在同一次 KeyShot 无界面运行中自动读取场景相机并逐个渲染。
|
|
595
|
-
`continueOnError` 默认是 `true`,因此单个相机失败不会阻止其他视角;同名安全文件会自动添加
|
|
596
|
-
`-2`、`-3` 等编号。除非设置 `overwrite: true`,否则不会覆盖已有图片。KeyShot 内部不能激活的
|
|
597
|
-
`last_active` 占位项会被列出并跳过。
|
|
598
|
-
|
|
599
|
-
### 材质预设库
|
|
600
|
-
|
|
601
|
-
`keyshot_apply_material_preset` 会读取一个小的 JSON 注册表,让你用"好记的名字"复用材质,
|
|
602
|
-
而不必记住 KeyShot 里精确的材质名。默认位置:`presets/materials.json`
|
|
603
|
-
(可用环境变量 `KEYSHOT_MATERIAL_PRESETS` 覆盖)。
|
|
434
|
+
对应的 `keyshot_import_model` 参数:
|
|
604
435
|
|
|
605
436
|
```json
|
|
606
437
|
{
|
|
607
|
-
"
|
|
608
|
-
"
|
|
438
|
+
"centerGeometry": true,
|
|
439
|
+
"snapToGround": true,
|
|
440
|
+
"adjustCameraLookAt": true,
|
|
441
|
+
"adjustEnvironment": true
|
|
609
442
|
}
|
|
610
443
|
```
|
|
611
444
|
|
|
612
|
-
|
|
445
|
+
设置产品相机:
|
|
613
446
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
内置的 `presets/cameras.json` 包含 Front、Back、Left、Right、Top、Bottom 和
|
|
617
|
-
Isometric 七个 KeyShot 标准视角。使用 `keyshot_list_camera_presets` 查看预设,
|
|
618
|
-
使用 `keyshot_apply_camera_preset` 创建或更新命名相机。
|
|
619
|
-
|
|
620
|
-
把 `KEYSHOT_CAMERA_PRESETS` 指向用户自己的 JSON 文件即可添加自定义预设:
|
|
621
|
-
|
|
622
|
-
```json
|
|
623
|
-
{
|
|
624
|
-
"正视图": { "standardView": "front" },
|
|
625
|
-
"产品主视角": {
|
|
626
|
-
"position": [4.5, 3.5, 4.5],
|
|
627
|
-
"lookAt": [0, 0, 0],
|
|
628
|
-
"up": [0, 1, 0],
|
|
629
|
-
"description": "自定义绝对坐标相机"
|
|
630
|
-
}
|
|
631
|
-
}
|
|
447
|
+
```text
|
|
448
|
+
把 Product Hero 相机设为 55 mm 焦距、距离 6,保存新场景并渲染 PNG 预览图。
|
|
632
449
|
```
|
|
633
450
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
`position` 与 `lookAt`。MCP 只读取预设文件,不会自动修改它。
|
|
637
|
-
|
|
638
|
-
## MCP 提示词和资源
|
|
639
|
-
|
|
640
|
-
- 提示词:`keyshot_product_render`
|
|
641
|
-
- 资源:`keyshot://workflow`
|
|
451
|
+
`fieldOfView` 必须大于 `0` 且小于 `180`;`focalLength` 支持 `5–200 mm`,
|
|
452
|
+
两者不能同时使用。`position` 和 `lookAt` 可不填写,但修改相机位置时必须成对提供。
|
|
642
453
|
|
|
643
|
-
|
|
454
|
+
旋转当前 HDRI 或环境:
|
|
644
455
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
- `warnings`:警告信息。
|
|
649
|
-
- `keyshotStdoutTail`:KeyShot 输出摘要。
|
|
650
|
-
- `error`:错误信息。
|
|
456
|
+
```text
|
|
457
|
+
把当前 KeyShot 环境旋转到 45 度,保存场景,然后渲染全部相机。
|
|
458
|
+
```
|
|
651
459
|
|
|
652
|
-
|
|
460
|
+
`rotation` 支持大于等于 `0` 且小于 `360` 的数值。
|
|
653
461
|
|
|
654
|
-
|
|
462
|
+
渲染参数 `samples` 和 `maxTimeSeconds` 对应不同的 KeyShot 渲染模式,不能同时使用。
|
|
655
463
|
|
|
656
|
-
|
|
464
|
+
### 相机与材质预设
|
|
657
465
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
- [x] 顺序渲染队列
|
|
662
|
-
- [x] 更安全的输出目录限制
|
|
663
|
-
- [ ] 测试更多 KeyShot 版本
|
|
664
|
-
- [ ] 验证 macOS 兼容性
|
|
665
|
-
- [x] 补充 Claude Desktop / Cursor / Codex 配置示例
|
|
466
|
+
内置相机库包含 Front、Back、Left、Right、Top、Bottom 和 Isometric 七个标准视角。
|
|
467
|
+
自定义 `KEYSHOT_CAMERA_PRESETS` JSON 可使用标准视角,也可提供绝对 `position`、
|
|
468
|
+
`lookAt` 和可选 `up` 向量。
|
|
666
469
|
|
|
667
|
-
|
|
470
|
+
材质预设通过 JSON 引用 KeyShot 材质库名称或本地材质文件。MCP 只读取预设文件,
|
|
471
|
+
不会自动修改它们。
|
|
668
472
|
|
|
669
|
-
|
|
473
|
+
### 可复现的 KeyShot smoke test
|
|
670
474
|
|
|
671
|
-
|
|
672
|
-
|
|
475
|
+
仓库提供基于 `examples/demo` 生成立方体几何体的 smoke test,用于验证 KeyShot
|
|
476
|
+
启动、导入构图、场景检查、相机预设、焦距、视野角、相机距离、环境旋转、场景保存、
|
|
477
|
+
相机发现和真实 PNG 渲染:
|
|
673
478
|
|
|
674
479
|
```bash
|
|
675
480
|
npm run smoke:keyshot
|
|
676
481
|
```
|
|
677
482
|
|
|
678
|
-
|
|
483
|
+
生成的 `.bip` 和测试渲染图只保留在配置的本地输出目录。仓库中包含一张代表性结果:
|
|
679
484
|
|
|
680
|
-
|
|
485
|
+

|
|
681
486
|
|
|
682
|
-
|
|
487
|
+
### 开发与测试
|
|
683
488
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
489
|
+
```bash
|
|
490
|
+
pnpm install
|
|
491
|
+
pnpm check
|
|
492
|
+
pnpm test
|
|
493
|
+
python -m unittest discover -s tests -p "test_*.py"
|
|
494
|
+
npm pack --dry-run
|
|
495
|
+
```
|
|
688
496
|
|
|
689
|
-
|
|
497
|
+
CI 在 Windows 和 Ubuntu 上使用 Node.js 20、24 运行。Linux CI 验证 MCP 服务、
|
|
498
|
+
桥接逻辑和 npm 包,不代表 KeyShot 软件已在 Linux 上通过实机测试。
|
|
690
499
|
|
|
691
|
-
|
|
692
|
-
python tests/test_bridge.py
|
|
693
|
-
```
|
|
500
|
+
### 路线图
|
|
694
501
|
|
|
695
|
-
|
|
502
|
+
- 在更多 KeyShot 正式版本上完成实机验证。
|
|
503
|
+
- 验证 macOS 安装和 headless 行为。
|
|
504
|
+
- 在 headless API 稳定支持后增加景深和更多镜头控制。
|
|
696
505
|
|
|
697
|
-
|
|
506
|
+
### 星标趋势
|
|
698
507
|
|
|
699
|
-
|
|
508
|
+
<picture>
|
|
509
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/star-history-dark.svg">
|
|
510
|
+
<source media="(prefers-color-scheme: light)" srcset="assets/star-history-light.svg">
|
|
511
|
+
<img alt="truman-t3/keyshot-mcp 的 GitHub 星标趋势" src="assets/star-history-light.svg">
|
|
512
|
+
</picture>
|
|
700
513
|
|
|
701
|
-
|
|
514
|
+
趋势图使用每颗 GitHub Star 的真实 `starred_at` 日期绘制累计阶梯线。GitHub Actions
|
|
515
|
+
每周检查一次,并且只在能够取得逐星日期时更新。
|
|
702
516
|
|
|
703
|
-
|
|
517
|
+
### 许可证与安全
|
|
704
518
|
|
|
705
|
-
|
|
519
|
+
项目采用 [MIT License](LICENSE)。安全说明见 [SECURITY.md](SECURITY.md),开发说明
|
|
520
|
+
见 [CONTRIBUTING.md](CONTRIBUTING.md)。请勿提交 KeyShot 许可证、私有场景、客户素材
|
|
521
|
+
或未公开渲染图。
|