keyshot-mcp 0.9.1 → 0.11.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/CHANGELOG.md +44 -0
- package/README.md +243 -93
- package/SECURITY.md +45 -15
- package/assets/logo-lockup.png +0 -0
- package/dist/config.js +4 -2
- package/dist/diagnostics.js +32 -9
- package/dist/index.js +3 -317
- package/dist/output-collisions.js +8 -2
- package/dist/output-paths.js +4 -1
- package/dist/preview.js +138 -0
- package/dist/product-render.js +6 -2
- package/dist/result.js +78 -19
- package/dist/runner.js +17 -7
- package/dist/save-sync.js +203 -0
- package/dist/schemas.js +447 -82
- package/dist/server.js +257 -0
- package/dist/tools/catalog.js +220 -0
- package/dist/version.js +1 -1
- package/docs/TOOLS.md +343 -0
- package/glama.json +1 -3
- package/package.json +15 -1
- package/scripts/clean.mjs +4 -1
- package/scripts/keyshot-smoke.mjs +130 -53
- package/server.json +2 -2
- package/skills/keyshot-mcp/SKILL.md +32 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to KeyShot MCP are documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.11.0] - 2026-08-12
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `keyshot_sync_saved_scene`, which detects the newest saved `.bip`, copies it to
|
|
12
|
+
a collision-safe output, returns a content fingerprint, and optionally embeds a
|
|
13
|
+
preview.
|
|
14
|
+
- Machine-readable interaction-mode diagnostics so Agents can explain that stable
|
|
15
|
+
tools work on saved scenes rather than an unsaved GUI session.
|
|
16
|
+
- An original KeyShot MCP project mark and a clearer README introduction,
|
|
17
|
+
navigation, highlights, and bilingual positioning for easier recognition.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- README, Agent Skill, and MCP workflow guidance now explain the tested KeyShot
|
|
22
|
+
Script Runner limitation and recommend the saved-scene synchronization workflow.
|
|
23
|
+
|
|
24
|
+
## [0.10.0] - 2026-08-11
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `keyshot_preview_render`, which embeds a bounded PNG preview in the MCP response.
|
|
29
|
+
- A generated 18-tool reference at `docs/TOOLS.md`.
|
|
30
|
+
- Documentation drift, formatting, Python lint, and release-integrity checks.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Tool metadata now comes from a shared catalog used by the server, tests, and documentation.
|
|
35
|
+
- The recommended workflow now includes an Agent-visible preview and user confirmation before standard or final rendering.
|
|
36
|
+
- Release automation pins MCP Publisher v1.7.9 and reports Registry failures without undoing a successful npm publication.
|
|
37
|
+
|
|
38
|
+
### Security
|
|
39
|
+
|
|
40
|
+
- Documented that scene metadata and preview images may be sent by an MCP client to its configured model provider.
|
|
41
|
+
|
|
42
|
+
[Unreleased]: https://github.com/truman-t3/keyshot-mcp/compare/v0.11.0...HEAD
|
|
43
|
+
[0.11.0]: https://github.com/truman-t3/keyshot-mcp/compare/v0.10.0...v0.11.0
|
|
44
|
+
[0.10.0]: https://github.com/truman-t3/keyshot-mcp/compare/v0.9.1...v0.10.0
|
package/README.md
CHANGED
|
@@ -1,39 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
>
|
|
11
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo-lockup.png" width="620" alt="KeyShot MCP">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Turn product-rendering requests into safe, repeatable KeyShot workflows.</strong><br>
|
|
7
|
+
<strong>将产品渲染需求转化为安全、可重复执行的 KeyShot 工作流。</strong>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
Inspect scenes, prepare product views, adjust materials, cameras and environments,
|
|
12
|
+
and return Agent-visible renders through local KeyShot headless scripting.<br>
|
|
13
|
+
检查场景、准备产品视图、调整材质、相机和环境,并通过本地 KeyShot headless 脚本将渲染结果返回给 Agent。
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/keyshot-mcp"><img src="https://img.shields.io/npm/v/keyshot-mcp.svg" alt="npm version"></a>
|
|
18
|
+
<a href="https://github.com/truman-t3/keyshot-mcp/actions/workflows/ci.yml"><img src="https://github.com/truman-t3/keyshot-mcp/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
|
|
19
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
|
|
20
|
+
<img src="https://img.shields.io/badge/tools-19-55E6A5" alt="19 MCP tools">
|
|
21
|
+
<img src="https://img.shields.io/badge/MCP-Model_Context_Protocol-111827" alt="Model Context Protocol">
|
|
22
|
+
<img src="https://img.shields.io/badge/KeyShot-14.1_tested-00AEEF" alt="KeyShot 14.1 tested">
|
|
23
|
+
<img src="https://img.shields.io/badge/Node.js-20%2B-339933" alt="Node.js 20 or newer">
|
|
24
|
+
<img src="https://img.shields.io/badge/TypeScript-5.9-3178C6" alt="TypeScript 5.9">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="#quick-start-for-designers">Quick start</a> ·
|
|
29
|
+
<a href="#highlights">Highlights</a> ·
|
|
30
|
+
<a href="#common-workflows">Workflows</a> ·
|
|
31
|
+
<a href="#tools">Tools</a> ·
|
|
32
|
+
<a href="#configuration">Configuration</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center"><a href="#english">English</a> · <a href="#中文">简体中文</a></p>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<strong>Useful for your KeyShot workflow? Star the repository to help other designers discover it.</strong><br>
|
|
39
|
+
<strong>如果它改善了你的 KeyShot 工作流,欢迎点一个 Star,让更多设计师发现这个项目。</strong>
|
|
40
|
+
</p>
|
|
12
41
|
|
|
13
42
|
KeyShot MCP connects an MCP-compatible AI agent to a licensed KeyShot installation
|
|
14
|
-
on the same computer.
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
on the same computer. KeyShot file processing stays local; however, an MCP client
|
|
44
|
+
may send tool results, scene metadata, or embedded previews to its configured model
|
|
45
|
+
provider. See [Security](SECURITY.md) before using confidential work.
|
|
17
46
|
|
|
18
47
|

|
|
19
48
|
|
|
20
49
|
## English
|
|
21
50
|
|
|
51
|
+
### Highlights
|
|
52
|
+
|
|
53
|
+
- **Start with a request, not a render-settings checklist.** Use one product tool
|
|
54
|
+
for model import, object materials, camera, environment, scene copy, and output.
|
|
55
|
+
- **See before committing.** Bounded PNG previews are returned directly to the
|
|
56
|
+
Agent for composition, material, and lighting feedback.
|
|
57
|
+
- **Keep source scenes protected.** Editing workflows write controlled copies and
|
|
58
|
+
reject output paths outside the configured safe directory by default.
|
|
59
|
+
- **Continue from the latest save.** Saved-scene sync detects real file changes,
|
|
60
|
+
creates a collision-safe copy, and avoids duplicate work with fingerprints.
|
|
61
|
+
- **Use focused controls when needed.** Nineteen documented tools cover inspection,
|
|
62
|
+
presets, cameras, materials, environments, render queues, and all-camera output.
|
|
63
|
+
|
|
64
|
+
> [!NOTE]
|
|
65
|
+
> Tested on Windows 11 with KeyShot Studio 2025 / KeyShot 14.1. KeyShot and a valid
|
|
66
|
+
> license are required and are not included with this independent project.
|
|
67
|
+
|
|
22
68
|
### Quick start for designers
|
|
23
69
|
|
|
24
70
|
The easiest setup is to send this prompt to an agent that can edit your MCP
|
|
25
71
|
configuration:
|
|
26
72
|
|
|
27
73
|
```text
|
|
28
|
-
Install KeyShot MCP 0.
|
|
74
|
+
Install KeyShot MCP 0.11.0 and configure it in my MCP client.
|
|
29
75
|
|
|
30
|
-
1. Use: npx -y keyshot-mcp@0.
|
|
76
|
+
1. Use: npx -y keyshot-mcp@0.11.0
|
|
31
77
|
2. Find my local keyshot_headless.exe and set KEYSHOT_HEADLESS_EXE to its full path.
|
|
32
78
|
3. Keep outputs in the default KeyShot MCP Outputs folder unless I choose another safe folder.
|
|
33
79
|
4. Keep KEYSHOT_ALLOW_EXTERNAL_OUTPUTS disabled.
|
|
34
80
|
5. Restart or reload the MCP client and run keyshot_status.
|
|
35
81
|
6. Explain any problem and its suggested fix in plain language.
|
|
36
|
-
7. Do not upload or publish my KeyShot files, renders, or license information.
|
|
82
|
+
7. Do not upload or publish my KeyShot files, persistent renders, or license information.
|
|
83
|
+
8. Before sending a preview image to the configured model provider, remind me when the scene is confidential.
|
|
37
84
|
```
|
|
38
85
|
|
|
39
86
|
After setup, try:
|
|
@@ -52,9 +99,41 @@ from C:\models\speaker.obj.
|
|
|
52
99
|
they are not currently verified by this project.
|
|
53
100
|
- KeyShot, its license, materials, and environments are not included.
|
|
54
101
|
|
|
102
|
+
### Why the stable release does not control the open KeyShot window
|
|
103
|
+
|
|
104
|
+
The stable server works on saved scene files through KeyShot headless scripting;
|
|
105
|
+
it does not control the currently open, unsaved KeyShot GUI session. This is a
|
|
106
|
+
boundary of the public KeyShot scripting execution model, not an omitted MCP
|
|
107
|
+
connection. KeyShot's Script Runner keeps a GUI script active until that script
|
|
108
|
+
returns. In our Live Companion prototype, keeping a bridge alive also kept the
|
|
109
|
+
Script Runner open and blocked normal interaction with the KeyShot window.
|
|
110
|
+
|
|
111
|
+
Calling `lux.sync()` can flush pending KeyShot operations, but it does not provide
|
|
112
|
+
a documented background service, GUI event callback, or plugin lifecycle that can
|
|
113
|
+
safely host a persistent MCP bridge. Calling `lux` from an arbitrary worker thread
|
|
114
|
+
would also risk unsafe access to the scene. For that reason, the project does not
|
|
115
|
+
present the experimental bridge as production-ready realtime control.
|
|
116
|
+
|
|
117
|
+
For a reliable workflow, save the scene first. The Agent can inspect or edit a
|
|
118
|
+
safe copy through headless KeyShot, return a preview, and preserve the original
|
|
119
|
+
file. True realtime GUI control can be reconsidered if KeyShot exposes a supported
|
|
120
|
+
non-blocking GUI extension or main-thread callback API.
|
|
121
|
+
|
|
122
|
+
Use `keyshot_sync_saved_scene` for the closest stable alternative to realtime
|
|
123
|
+
collaboration. Give it a saved `.bip` file or one folder containing `.bip` files.
|
|
124
|
+
It selects the newest saved scene, computes a content fingerprint, copies it to a
|
|
125
|
+
collision-safe output name, and returns an embedded preview by default. Pass the
|
|
126
|
+
returned fingerprint on the next call; if the user has not saved a new change,
|
|
127
|
+
the tool reports `changed: false` without creating another copy or render.
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
I saved my KeyShot scene in C:\projects\speaker. Sync the newest .bip from that
|
|
131
|
+
folder, show me a preview, and do not overwrite the original scene.
|
|
132
|
+
```
|
|
133
|
+
|
|
55
134
|
### Install
|
|
56
135
|
|
|
57
|
-
The current release is `0.
|
|
136
|
+
The current release is `0.11.0`.
|
|
58
137
|
|
|
59
138
|
#### Run with npx
|
|
60
139
|
|
|
@@ -65,7 +144,7 @@ No global npm installation is required:
|
|
|
65
144
|
"mcpServers": {
|
|
66
145
|
"keyshot": {
|
|
67
146
|
"command": "npx",
|
|
68
|
-
"args": ["-y", "keyshot-mcp@0.
|
|
147
|
+
"args": ["-y", "keyshot-mcp@0.11.0"],
|
|
69
148
|
"env": {
|
|
70
149
|
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
71
150
|
}
|
|
@@ -77,7 +156,7 @@ No global npm installation is required:
|
|
|
77
156
|
#### Install globally
|
|
78
157
|
|
|
79
158
|
```bash
|
|
80
|
-
npm install -g keyshot-mcp@0.
|
|
159
|
+
npm install -g keyshot-mcp@0.11.0
|
|
81
160
|
```
|
|
82
161
|
|
|
83
162
|
```json
|
|
@@ -111,6 +190,16 @@ output access, bridge files, preset JSON, and a minimal KeyShot startup.
|
|
|
111
190
|
|
|
112
191
|
### Common workflows
|
|
113
192
|
|
|
193
|
+
#### Preview before final rendering
|
|
194
|
+
|
|
195
|
+
Use `keyshot_preview_render` after checking a scene. It returns a PNG directly to
|
|
196
|
+
the Agent, so composition, materials, and lighting can be described and confirmed
|
|
197
|
+
before a standard or final render. Temporary previews are deleted automatically;
|
|
198
|
+
set `outputPath` only when a persistent PNG copy is needed.
|
|
199
|
+
|
|
200
|
+
Recommended loop: status check -> scene inspection -> preview -> Agent feedback ->
|
|
201
|
+
user confirmation -> standard or final render.
|
|
202
|
+
|
|
114
203
|
#### One-call product render
|
|
115
204
|
|
|
116
205
|
`keyshot_product_render` is the recommended high-level tool for ordinary product
|
|
@@ -155,11 +244,11 @@ different KeyShot render modes and cannot be combined.
|
|
|
155
244
|
|
|
156
245
|
### Quality presets
|
|
157
246
|
|
|
158
|
-
| Preset
|
|
159
|
-
|
|
|
160
|
-
| `preview`
|
|
161
|
-
| `standard` | 1920 x 1080 |
|
|
162
|
-
| `final`
|
|
247
|
+
| Preset | Resolution | Samples | Use |
|
|
248
|
+
| ---------- | ----------: | ------: | ------------------------------------ |
|
|
249
|
+
| `preview` | 960 x 540 | 16 | Fast composition and material checks |
|
|
250
|
+
| `standard` | 1920 x 1080 | 64 | Default for `keyshot_product_render` |
|
|
251
|
+
| `final` | 3840 x 2160 | 256 | High-resolution final output |
|
|
163
252
|
|
|
164
253
|
Explicit `width`, `height`, and `samples` override the corresponding preset values.
|
|
165
254
|
Explicit `maxTimeSeconds` switches to time-based rendering instead of preset samples.
|
|
@@ -167,42 +256,45 @@ Lower-level render tools preserve their existing behavior when no preset is give
|
|
|
167
256
|
|
|
168
257
|
### Tools
|
|
169
258
|
|
|
170
|
-
| Tool
|
|
171
|
-
|
|
|
172
|
-
| `keyshot_status`
|
|
173
|
-
| `keyshot_product_render`
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
259
|
+
| Tool | Purpose |
|
|
260
|
+
| ------------------------------- | ----------------------------------------------------------------------------- |
|
|
261
|
+
| `keyshot_status` | Diagnose local configuration, output access, presets, and KeyShot startup. |
|
|
262
|
+
| `keyshot_product_render` | Prepare, save, and render a model or scene in one process. |
|
|
263
|
+
| `keyshot_preview_render` | Return a temporary or saved PNG directly to the Agent for visual review. |
|
|
264
|
+
| `keyshot_sync_saved_scene` | Copy the newest saved scene safely, detect changes, and return a preview. |
|
|
265
|
+
| `keyshot_inspect_scene` | List scene metadata, objects, cameras, materials, model sets, and references. |
|
|
266
|
+
| `keyshot_list_cameras` | Return saved camera names before a selected-camera render. |
|
|
267
|
+
| `keyshot_render` | Render one active or named camera. |
|
|
268
|
+
| `keyshot_render_queue` | Run independent render jobs sequentially. |
|
|
269
|
+
| `keyshot_batch_render` | Render selected named cameras from one scene. |
|
|
270
|
+
| `keyshot_render_all_cameras` | Discover and render every saved camera. |
|
|
271
|
+
| `keyshot_import_model` | Import a model into an empty or base scene and save it. |
|
|
272
|
+
| `keyshot_apply_material` | Apply a KeyShot material name or local material file to one object. |
|
|
273
|
+
| `keyshot_list_material_presets` | List configured material presets. |
|
|
274
|
+
| `keyshot_apply_material_preset` | Apply a configured material preset to one object. |
|
|
275
|
+
| `keyshot_set_camera` | Create or update camera transform, distance, FOV, or focal length. |
|
|
276
|
+
| `keyshot_list_camera_presets` | List standard and custom camera presets. |
|
|
277
|
+
| `keyshot_apply_camera_preset` | Create or update a camera from a preset. |
|
|
278
|
+
| `keyshot_set_environment` | Select or adjust an environment, brightness, and rotation. |
|
|
279
|
+
| `keyshot_save_scene` | Save an existing scene to a controlled output path. |
|
|
189
280
|
|
|
190
281
|
The server also exposes one MCP Prompt for product rendering and one MCP Resource
|
|
191
|
-
describing the KeyShot headless workflow. The
|
|
282
|
+
describing the KeyShot headless workflow. The complete generated reference for
|
|
283
|
+
all 19 tools is available in [`docs/TOOLS.md`](docs/TOOLS.md). The bundled Agent Skill in
|
|
192
284
|
[`skills/keyshot-mcp`](skills/keyshot-mcp) teaches compatible agents how to install,
|
|
193
285
|
diagnose, and use the server safely.
|
|
194
286
|
|
|
195
287
|
### Configuration
|
|
196
288
|
|
|
197
|
-
| Variable
|
|
198
|
-
|
|
|
199
|
-
| `KEYSHOT_HEADLESS_EXE`
|
|
200
|
-
| `KEYSHOT_OUTPUT_DIR`
|
|
201
|
-
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false`
|
|
202
|
-
| `KEYSHOT_TIMEOUT_MS`
|
|
203
|
-
| `KEYSHOT_LICENSE_ARGS`
|
|
204
|
-
| `KEYSHOT_MATERIAL_PRESETS`
|
|
205
|
-
| `KEYSHOT_CAMERA_PRESETS`
|
|
289
|
+
| Variable | Default | Description |
|
|
290
|
+
| -------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------- |
|
|
291
|
+
| `KEYSHOT_HEADLESS_EXE` | `keyshot_headless.exe` on Windows | Full executable path or a command available on `PATH`. |
|
|
292
|
+
| `KEYSHOT_OUTPUT_DIR` | `<home>/Documents/KeyShot MCP Outputs` | Root for rendered images and saved scenes. |
|
|
293
|
+
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false` | Allow output outside the configured root only when explicitly set to `true`. |
|
|
294
|
+
| `KEYSHOT_TIMEOUT_MS` | `600000` | Timeout for one KeyShot process. |
|
|
295
|
+
| `KEYSHOT_LICENSE_ARGS` | empty | Optional launch arguments; diagnostics never echo their values. |
|
|
296
|
+
| `KEYSHOT_MATERIAL_PRESETS` | bundled JSON | Optional user-managed material preset file. |
|
|
297
|
+
| `KEYSHOT_CAMERA_PRESETS` | bundled JSON | Optional user-managed camera preset file. |
|
|
206
298
|
|
|
207
299
|
All KeyShot operations run sequentially to reduce license and output conflicts.
|
|
208
300
|
Input scenes and models may come from any local path. By default, generated images
|
|
@@ -275,20 +367,39 @@ bypass licensing or redistribute proprietary KeyShot software or assets.
|
|
|
275
367
|
|
|
276
368
|
## 中文
|
|
277
369
|
|
|
370
|
+
KeyShot MCP 在本机处理 KeyShot 文件;但 MCP 客户端可能会把工具结果、场景元数据或
|
|
371
|
+
内嵌预览发送给它所配置的模型服务。处理保密项目之前请先阅读[安全说明](SECURITY.md)。
|
|
372
|
+
|
|
373
|
+
### 核心特点
|
|
374
|
+
|
|
375
|
+
- **从设计需求开始,而不是先填写一堆渲染参数。** 一个产品出图工具即可完成模型导入、
|
|
376
|
+
指定对象材质、相机、环境、场景副本和渲染输出。
|
|
377
|
+
- **正式出图前先看预览。** 预览 PNG 会直接返回给 Agent,用于检查构图、材质和光线。
|
|
378
|
+
- **保护源场景。** 编辑流程默认生成受控副本,并拒绝向安全输出目录之外写入文件。
|
|
379
|
+
- **从最近一次保存继续。** 保存同步会识别真实文件变化、创建不重名副本,并用内容指纹
|
|
380
|
+
避免重复处理。
|
|
381
|
+
- **需要精细控制时仍然可用。** 19 个工具覆盖场景检查、预设、相机、材质、环境、
|
|
382
|
+
渲染队列和全部相机出图。
|
|
383
|
+
|
|
384
|
+
> [!NOTE]
|
|
385
|
+
> 已实测 Windows 11 + KeyShot Studio 2025 / KeyShot 14.1。使用时需要另行安装并合法
|
|
386
|
+
> 授权 KeyShot;本项目是独立开源项目,不包含 KeyShot 软件或许可证。
|
|
387
|
+
|
|
278
388
|
### 设计师快速开始
|
|
279
389
|
|
|
280
390
|
最简单的安装方式,是把下面这段话发给能够修改 MCP 配置的 Agent:
|
|
281
391
|
|
|
282
392
|
```text
|
|
283
|
-
请安装 KeyShot MCP 0.
|
|
393
|
+
请安装 KeyShot MCP 0.11.0,并配置到我的 MCP 客户端。
|
|
284
394
|
|
|
285
|
-
1. 使用:npx -y keyshot-mcp@0.
|
|
395
|
+
1. 使用:npx -y keyshot-mcp@0.11.0
|
|
286
396
|
2. 查找本机 keyshot_headless.exe,并把完整路径设置为 KEYSHOT_HEADLESS_EXE。
|
|
287
397
|
3. 默认把结果保存在“文档/KeyShot MCP Outputs”,除非我明确选择其他安全目录。
|
|
288
398
|
4. 保持 KEYSHOT_ALLOW_EXTERNAL_OUTPUTS 关闭。
|
|
289
399
|
5. 重启或重新加载 MCP 客户端,然后运行 keyshot_status。
|
|
290
400
|
6. 用普通设计师能理解的语言说明问题和修复建议。
|
|
291
|
-
7. 不要上传或发布我的 KeyShot
|
|
401
|
+
7. 不要上传或发布我的 KeyShot 文件、保留的渲染图或许可证信息。
|
|
402
|
+
8. 如果场景属于保密项目,在把预览发送给模型服务之前先提醒我。
|
|
292
403
|
```
|
|
293
404
|
|
|
294
405
|
安装后可以这样说:
|
|
@@ -305,9 +416,36 @@ bypass licensing or redistribute proprietary KeyShot software or assets.
|
|
|
305
416
|
- 暴露相同脚本 API 的其他 KeyShot 版本可能可用,但本项目暂未完成实机验证。
|
|
306
417
|
- 本项目不包含 KeyShot、许可证、官方材质或环境资源。
|
|
307
418
|
|
|
419
|
+
### 为什么稳定版不能控制当前打开的 KeyShot 窗口
|
|
420
|
+
|
|
421
|
+
稳定版通过 KeyShot headless 脚本处理已经保存的场景文件,不能直接控制 KeyShot
|
|
422
|
+
窗口中尚未保存的当前会话。这是 KeyShot 现有公开脚本执行方式的边界,并不是 MCP
|
|
423
|
+
连接功能遗漏。
|
|
424
|
+
|
|
425
|
+
我们已经制作并实机测试过 Live Companion 原型。为了等待 Agent 指令,Bridge 脚本
|
|
426
|
+
必须长期保持运行;但 KeyShot Script Runner 会一直等待脚本结束,导致脚本窗口持续
|
|
427
|
+
占用并阻挡 KeyShot GUI 的正常交互。`lux.sync()` 只能同步待处理操作,公开文档没有
|
|
428
|
+
提供可安全承载常驻 MCP Bridge 的后台服务、GUI 事件回调或插件生命周期。让普通后台
|
|
429
|
+
线程直接调用 `lux` 也可能造成不安全的场景访问。因此,本项目没有把这个实验方案包装成
|
|
430
|
+
可用于正式工作的“实时控制”。
|
|
431
|
+
|
|
432
|
+
可靠的工作方式是先保存场景,再让 Agent 使用 headless KeyShot 检查或修改安全副本、
|
|
433
|
+
返回预览并保留原文件。如果 KeyShot 后续公开非阻塞 GUI 扩展接口或主线程回调 API,
|
|
434
|
+
本项目可以重新评估真正的实时 GUI 控制。
|
|
435
|
+
|
|
436
|
+
`keyshot_sync_saved_scene` 是目前最接近实时协作、同时保持稳定的方案。向它提供一个已
|
|
437
|
+
保存的 `.bip` 文件,或只包含当前项目场景的文件夹。工具会选择最近保存的场景、计算
|
|
438
|
+
内容指纹、复制到不会重名的安全输出路径,并默认返回内嵌预览。下一次调用时传入上次的
|
|
439
|
+
指纹;如果用户没有保存新的修改,工具会返回 `changed: false`,不会重复复制或渲染。
|
|
440
|
+
|
|
441
|
+
```text
|
|
442
|
+
我已经把 KeyShot 场景保存在 C:\projects\speaker。请同步这个文件夹中最新的 .bip,
|
|
443
|
+
给我看预览,而且不要覆盖原场景。
|
|
444
|
+
```
|
|
445
|
+
|
|
308
446
|
### 安装
|
|
309
447
|
|
|
310
|
-
当前正式版本为 `0.
|
|
448
|
+
当前正式版本为 `0.11.0`。
|
|
311
449
|
|
|
312
450
|
#### 使用 npx 免安装运行
|
|
313
451
|
|
|
@@ -316,7 +454,7 @@ bypass licensing or redistribute proprietary KeyShot software or assets.
|
|
|
316
454
|
"mcpServers": {
|
|
317
455
|
"keyshot": {
|
|
318
456
|
"command": "npx",
|
|
319
|
-
"args": ["-y", "keyshot-mcp@0.
|
|
457
|
+
"args": ["-y", "keyshot-mcp@0.11.0"],
|
|
320
458
|
"env": {
|
|
321
459
|
"KEYSHOT_HEADLESS_EXE": "C:/Program Files/KeyShot Studio/bin/keyshot_headless.exe"
|
|
322
460
|
}
|
|
@@ -328,7 +466,7 @@ bypass licensing or redistribute proprietary KeyShot software or assets.
|
|
|
328
466
|
#### 全局安装
|
|
329
467
|
|
|
330
468
|
```bash
|
|
331
|
-
npm install -g keyshot-mcp@0.
|
|
469
|
+
npm install -g keyshot-mcp@0.11.0
|
|
332
470
|
```
|
|
333
471
|
|
|
334
472
|
```json
|
|
@@ -361,6 +499,15 @@ pnpm build
|
|
|
361
499
|
|
|
362
500
|
### 常用工作流
|
|
363
501
|
|
|
502
|
+
#### 正式渲染前先看预览
|
|
503
|
+
|
|
504
|
+
检查场景后调用 `keyshot_preview_render`。它会把 PNG 直接返回给 Agent,便于
|
|
505
|
+
先检查构图、材质和光线,再由用户确认是否继续标准或最终渲染。临时预览会自动
|
|
506
|
+
删除;只有需要保留图片时才填写 `outputPath`。
|
|
507
|
+
|
|
508
|
+
推荐流程:状态检查 -> 场景检查 -> 预览 -> Agent 描述问题 -> 用户确认 ->
|
|
509
|
+
标准或最终渲染。
|
|
510
|
+
|
|
364
511
|
#### 一句话完成产品出图
|
|
365
512
|
|
|
366
513
|
普通产品工作优先使用 `keyshot_product_render`。它能在一个 KeyShot 进程中导入模型
|
|
@@ -402,52 +549,55 @@ pnpm build
|
|
|
402
549
|
|
|
403
550
|
### 质量预设
|
|
404
551
|
|
|
405
|
-
| 预设
|
|
406
|
-
|
|
|
407
|
-
| `preview`
|
|
408
|
-
| `standard` | 1920 x 1080 |
|
|
409
|
-
| `final`
|
|
552
|
+
| 预设 | 分辨率 | 采样 | 用途 |
|
|
553
|
+
| ---------- | ----------: | ---: | --------------------------------- |
|
|
554
|
+
| `preview` | 960 x 540 | 16 | 快速检查构图和材质 |
|
|
555
|
+
| `standard` | 1920 x 1080 | 64 | `keyshot_product_render` 的默认值 |
|
|
556
|
+
| `final` | 3840 x 2160 | 256 | 高清最终输出 |
|
|
410
557
|
|
|
411
558
|
显式填写的 `width`、`height` 和 `samples` 会分别覆盖预设值;填写
|
|
412
559
|
`maxTimeSeconds` 会改用限时渲染。底层渲染工具在没有指定预设时保持原有行为。
|
|
413
560
|
|
|
414
561
|
### 工具
|
|
415
562
|
|
|
416
|
-
| 工具
|
|
417
|
-
|
|
|
418
|
-
| `keyshot_status`
|
|
419
|
-
| `keyshot_product_render`
|
|
420
|
-
| `
|
|
421
|
-
| `
|
|
422
|
-
| `
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
427
|
-
| `
|
|
428
|
-
| `
|
|
429
|
-
| `
|
|
430
|
-
| `
|
|
431
|
-
| `
|
|
432
|
-
| `
|
|
433
|
-
| `
|
|
434
|
-
| `
|
|
563
|
+
| 工具 | 用途 |
|
|
564
|
+
| ------------------------------- | -------------------------------------------------- |
|
|
565
|
+
| `keyshot_status` | 检查本机配置、输出目录、预设和 KeyShot 启动状态。 |
|
|
566
|
+
| `keyshot_product_render` | 在一个进程中整理、保存并渲染模型或场景。 |
|
|
567
|
+
| `keyshot_preview_render` | 将临时或保留的 PNG 直接返回给 Agent 进行视觉检查。 |
|
|
568
|
+
| `keyshot_sync_saved_scene` | 安全同步最近保存的场景、检测变化并返回预览。 |
|
|
569
|
+
| `keyshot_inspect_scene` | 查看场景、对象、相机、材质、模型集和外部引用。 |
|
|
570
|
+
| `keyshot_list_cameras` | 返回场景中的相机名称。 |
|
|
571
|
+
| `keyshot_render` | 渲染当前或指定相机。 |
|
|
572
|
+
| `keyshot_render_queue` | 顺序执行多个独立渲染任务。 |
|
|
573
|
+
| `keyshot_batch_render` | 渲染选定的多个相机。 |
|
|
574
|
+
| `keyshot_render_all_cameras` | 自动发现并渲染全部相机。 |
|
|
575
|
+
| `keyshot_import_model` | 导入模型并保存为场景。 |
|
|
576
|
+
| `keyshot_apply_material` | 给指定对象应用材质名称或本地材质文件。 |
|
|
577
|
+
| `keyshot_list_material_presets` | 列出材质预设。 |
|
|
578
|
+
| `keyshot_apply_material_preset` | 给指定对象应用材质预设。 |
|
|
579
|
+
| `keyshot_set_camera` | 创建或修改相机位置、距离、视野角或焦距。 |
|
|
580
|
+
| `keyshot_list_camera_presets` | 列出标准与自定义相机预设。 |
|
|
581
|
+
| `keyshot_apply_camera_preset` | 根据预设创建或修改相机。 |
|
|
582
|
+
| `keyshot_set_environment` | 选择或调整环境、亮度和旋转。 |
|
|
583
|
+
| `keyshot_save_scene` | 将场景保存到受控输出路径。 |
|
|
435
584
|
|
|
436
585
|
服务还提供一个产品渲染 MCP Prompt,以及一个说明 headless 工作流程的 MCP Resource。
|
|
586
|
+
完整的 19 个工具参考由代码自动生成在 [`docs/TOOLS.md`](docs/TOOLS.md)。
|
|
437
587
|
[`skills/keyshot-mcp`](skills/keyshot-mcp) 中的 Agent Skill 会指导兼容的 Agent 安装、
|
|
438
588
|
诊断并安全使用这些工具。
|
|
439
589
|
|
|
440
590
|
### 配置
|
|
441
591
|
|
|
442
|
-
| 环境变量
|
|
443
|
-
|
|
|
444
|
-
| `KEYSHOT_HEADLESS_EXE`
|
|
445
|
-
| `KEYSHOT_OUTPUT_DIR`
|
|
446
|
-
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false`
|
|
447
|
-
| `KEYSHOT_TIMEOUT_MS`
|
|
448
|
-
| `KEYSHOT_LICENSE_ARGS`
|
|
449
|
-
| `KEYSHOT_MATERIAL_PRESETS`
|
|
450
|
-
| `KEYSHOT_CAMERA_PRESETS`
|
|
592
|
+
| 环境变量 | 默认值 | 说明 |
|
|
593
|
+
| -------------------------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
594
|
+
| `KEYSHOT_HEADLESS_EXE` | Windows 上为 `keyshot_headless.exe` | 完整路径,或系统 `PATH` 中可执行的命令。 |
|
|
595
|
+
| `KEYSHOT_OUTPUT_DIR` | `<用户目录>/Documents/KeyShot MCP Outputs` | 渲染图和场景副本的根目录。 |
|
|
596
|
+
| `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` | `false` | 只有明确设为 `true` 时才允许写到输出根目录之外。 |
|
|
597
|
+
| `KEYSHOT_TIMEOUT_MS` | `600000` | 单次 KeyShot 进程超时时间。 |
|
|
598
|
+
| `KEYSHOT_LICENSE_ARGS` | 空 | 可选启动参数;诊断结果不会回显具体内容。 |
|
|
599
|
+
| `KEYSHOT_MATERIAL_PRESETS` | 内置 JSON | 可选的用户材质预设文件。 |
|
|
600
|
+
| `KEYSHOT_CAMERA_PRESETS` | 内置 JSON | 可选的用户相机预设文件。 |
|
|
451
601
|
|
|
452
602
|
所有 KeyShot 操作串行执行,减少许可证和文件冲突。输入模型和场景可以位于任意本地
|
|
453
603
|
路径;生成的场景和图片默认只能写入 `KEYSHOT_OUTPUT_DIR`。系统会拒绝 `..`、同名前缀
|
package/SECURITY.md
CHANGED
|
@@ -2,32 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
## English
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
KeyShot MCP runs KeyShot headless on the local computer. It can read local scene,
|
|
6
|
+
model, material, and environment files and can write rendered images or scene copies.
|
|
6
7
|
|
|
7
|
-
###
|
|
8
|
+
### Model-provider data flow
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
MCP clients normally send tool inputs and results to the model service selected by
|
|
11
|
+
the user. Scene metadata returned by inspection tools and images returned by
|
|
12
|
+
`keyshot_preview_render` may therefore leave the local computer through that MCP
|
|
13
|
+
client. Review the client and model provider's privacy settings before using private
|
|
14
|
+
or customer work.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
KeyShot MCP itself does not upload files, run a remote service, or collect telemetry.
|
|
17
|
+
It never requires license keys in prompts and does not expose arbitrary Python
|
|
18
|
+
execution.
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
### Safe use
|
|
21
|
+
|
|
22
|
+
- Connect the server only to MCP clients and model providers you trust.
|
|
23
|
+
- Open only scene, model, material, and environment files from trusted sources.
|
|
24
|
+
- Do not put license keys, account passwords, private tokens, or confidential asset
|
|
25
|
+
contents in prompts.
|
|
26
|
+
- Use KeyShot's existing local license configuration.
|
|
27
|
+
- Keep `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` disabled unless an external destination is
|
|
28
|
+
explicitly required and trusted.
|
|
29
|
+
- Review a preview before approving edits or final renders, and preserve source scenes.
|
|
30
|
+
|
|
31
|
+
### Reporting issues
|
|
32
|
+
|
|
33
|
+
Report vulnerabilities through a private GitHub security advisory before posting
|
|
34
|
+
technical details publicly.
|
|
17
35
|
|
|
18
36
|
---
|
|
19
37
|
|
|
20
38
|
## 中文
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
KeyShot MCP 在本机运行 KeyShot headless。它可以读取本地场景、模型、材质和环境
|
|
41
|
+
文件,也可以写入渲染图片或场景副本。
|
|
42
|
+
|
|
43
|
+
### 模型服务的数据流
|
|
44
|
+
|
|
45
|
+
MCP 客户端通常会把工具输入和结果发送给用户选择的模型服务。因此,场景检查工具
|
|
46
|
+
返回的元数据,以及 `keyshot_preview_render` 返回的预览图片,可能通过 MCP 客户端
|
|
47
|
+
离开本机。处理私有项目或客户项目之前,请先确认 MCP 客户端和模型服务商的隐私设置。
|
|
48
|
+
|
|
49
|
+
KeyShot MCP 本身不会上传文件、运行远程服务或收集遥测数据。它不会要求用户在提示词
|
|
50
|
+
中提供许可证密钥,也不开放任意 Python 执行。
|
|
23
51
|
|
|
24
|
-
###
|
|
52
|
+
### 安全使用
|
|
25
53
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
54
|
+
- 只连接可信的 MCP 客户端和模型服务。
|
|
55
|
+
- 只打开来源可信的场景、模型、材质和环境文件。
|
|
56
|
+
- 不要在提示词中填写许可证密钥、账号密码、私有 Token 或保密素材内容。
|
|
57
|
+
- 使用 KeyShot 已有的本机许可证配置。
|
|
58
|
+
- 除非明确需要并信任外部位置,否则保持 `KEYSHOT_ALLOW_EXTERNAL_OUTPUTS` 关闭。
|
|
59
|
+
- 批准修改或最终渲染前先检查预览,并保留原始场景。
|
|
30
60
|
|
|
31
61
|
### 报告安全问题
|
|
32
62
|
|
|
33
|
-
|
|
63
|
+
请先通过 GitHub 私密安全公告报告漏洞,不要直接公开技术细节。
|
|
Binary file
|
package/dist/config.js
CHANGED
|
@@ -15,8 +15,10 @@ export function getConfig() {
|
|
|
15
15
|
keyshotTimeoutMs: parsePositiveInt(process.env.KEYSHOT_TIMEOUT_MS, DEFAULT_TIMEOUT_MS),
|
|
16
16
|
tmpDir: path.join(projectRoot, "work", "tmp"),
|
|
17
17
|
bridgeScriptPath: path.join(projectRoot, "scripts", "keyshot_bridge.py"),
|
|
18
|
-
materialPresetsPath: path.resolve(process.env.KEYSHOT_MATERIAL_PRESETS ??
|
|
19
|
-
|
|
18
|
+
materialPresetsPath: path.resolve(process.env.KEYSHOT_MATERIAL_PRESETS ??
|
|
19
|
+
path.join(projectRoot, "presets", "materials.json")),
|
|
20
|
+
cameraPresetsPath: path.resolve(process.env.KEYSHOT_CAMERA_PRESETS ??
|
|
21
|
+
path.join(projectRoot, "presets", "cameras.json")),
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
export function defaultOutputDir() {
|