sceneview-mcp 4.0.16 → 4.1.1
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 +246 -62
- package/dist/analyze-project.js +4 -2
- package/dist/artifact.js +38 -13
- package/dist/debug-issue.js +101 -19
- package/dist/discover.js +106 -0
- package/dist/extra-guides.js +3 -3
- package/dist/generate-scene.js +380 -61
- package/dist/generated/llms-txt.js +1 -1
- package/dist/generated/symbols.js +1040 -22
- package/dist/generated/version.js +12 -3
- package/dist/guides.js +10 -6
- package/dist/http.js +178 -0
- package/dist/index.js +34 -139
- package/dist/issues.js +1 -1
- package/dist/migrate-code.js +5 -3
- package/dist/platform-setup.js +33 -16
- package/dist/samples.js +31 -31
- package/dist/search-models.js +1 -1
- package/dist/server.js +197 -0
- package/dist/surfaces.js +32 -0
- package/dist/telemetry.js +14 -8
- package/dist/tools/definitions.js +176 -14
- package/dist/tools/handler.js +207 -66
- package/dist/tools/index.js +4 -4
- package/dist/tools/types.js +0 -4
- package/dist/validator.js +262 -161
- package/dist/widgets.js +915 -0
- package/package.json +16 -12
- package/dist/proxy.js +0 -176
- package/dist/tiers.js +0 -138
package/README.md
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/sceneview-mcp)
|
|
6
6
|
[](https://www.npmjs.com/package/sceneview-mcp)
|
|
7
|
-
[](#quality)
|
|
8
|
+
[](https://modelcontextprotocol.io/)
|
|
9
9
|
[](https://registry.modelcontextprotocol.io)
|
|
10
10
|
[](./LICENSE)
|
|
11
11
|
[](https://nodejs.org/)
|
|
12
12
|
|
|
13
13
|
The official [Model Context Protocol](https://modelcontextprotocol.io/) server for **[SceneView](https://sceneview.github.io)** — the cross-platform 3D & AR SDK for Android (Jetpack Compose + Filament), iOS / macOS / visionOS (SwiftUI + RealityKit), and Web (Filament.js + WebXR).
|
|
14
14
|
|
|
15
|
-
Connect it to Claude, Cursor,
|
|
15
|
+
Connect it to Claude Code, Cline, Codex, Cursor, GitHub Copilot, JetBrains AI Assistant — or any other MCP client — locally over stdio, or remotely over Streamable HTTP at **`https://mcp.sceneview.dev/mcp`** (see [Remote server](#remote-server-streamable-http)). Your AI assistant gets specialized tools, compilable code samples, the full API reference, a code validator, and an inline 3D viewer widget — so it writes correct, working 3D/AR code on the first try.
|
|
16
16
|
|
|
17
17
|
> **Disclaimer:** Generated code is provided "as is" without warranty. Always review before production use. See [TERMS.md](./TERMS.md) and [PRIVACY.md](./PRIVACY.md).
|
|
18
18
|
|
|
@@ -26,9 +26,11 @@ Connect it to Claude, Cursor, Windsurf, or any MCP client. Your AI assistant get
|
|
|
26
26
|
npx sceneview-mcp
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Every client below runs that same server. Three config shapes exist across the ecosystem —
|
|
30
|
+
`mcpServers` (most clients), `servers` (VS Code) and `[mcp_servers.*]` (Codex TOML) — but the
|
|
31
|
+
command and arguments are identical in all three.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
### Any MCP client
|
|
32
34
|
|
|
33
35
|
```json
|
|
34
36
|
{
|
|
@@ -41,51 +43,234 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
|
41
43
|
}
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
Restart Claude Desktop after saving.
|
|
45
|
-
|
|
46
46
|
### Claude Code
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
```bash
|
|
49
|
+
claude mcp add sceneview -- npx -y sceneview-mcp
|
|
50
|
+
```
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
Or commit `.mcp.json` at the repository root so the whole team gets it:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{ "mcpServers": { "sceneview": { "type": "stdio", "command": "npx", "args": ["-y", "sceneview-mcp"] } } }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Optionally, the [SceneView Claude Code plugin](https://github.com/sceneview/claude-marketplace)
|
|
59
|
+
bundles this server with 11 namespaced contributor commands and cross-platform reminder hooks:
|
|
51
60
|
|
|
52
61
|
```bash
|
|
53
62
|
/plugin marketplace add sceneview/claude-marketplace
|
|
54
63
|
/plugin install sceneview@sceneview
|
|
55
64
|
```
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
### Claude Desktop
|
|
67
|
+
|
|
68
|
+
Settings → Developer → Edit Config, then add the standard `mcpServers` block above to
|
|
69
|
+
`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or
|
|
70
|
+
`%APPDATA%\Claude\claude_desktop_config.json` (Windows). Restart after saving.
|
|
71
|
+
|
|
72
|
+
### Cline
|
|
73
|
+
|
|
74
|
+
MCP Servers icon → Configure → Configure MCP Servers, or `~/.cline/mcp.json`:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{ "mcpServers": { "sceneview": { "command": "npx", "args": ["-y", "sceneview-mcp"], "disabled": false, "autoApprove": [] } } }
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Codex
|
|
58
81
|
|
|
59
82
|
```bash
|
|
60
|
-
|
|
83
|
+
codex mcp add sceneview -- npx -y sceneview-mcp
|
|
61
84
|
```
|
|
62
85
|
|
|
86
|
+
Or `~/.codex/config.toml` — TOML, and the table is `mcp_servers`, not `mcpServers`:
|
|
87
|
+
|
|
88
|
+
```toml
|
|
89
|
+
[mcp_servers.sceneview]
|
|
90
|
+
command = "npx"
|
|
91
|
+
args = ["-y", "sceneview-mcp"]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The same config serves the Codex CLI, the IDE extension and the app.
|
|
95
|
+
|
|
63
96
|
### Cursor
|
|
64
97
|
|
|
65
|
-
|
|
98
|
+
Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global) — the standard
|
|
99
|
+
`mcpServers` block above. Cursor also accepts an install link:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
cursor://anysphere.cursor-deeplink/mcp/install?name=sceneview&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNjZW5ldmlldy1tY3AiXX0=
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Gemini CLI
|
|
106
|
+
|
|
107
|
+
The repository root carries a [`gemini-extension.json`](../gemini-extension.json), so the CLI
|
|
108
|
+
installs the server straight from GitHub — no JSON to paste:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
gemini extensions install https://github.com/sceneview/sceneview
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**This clones the whole monorepo** — over 2 GB of history — because the CLI installs an
|
|
115
|
+
extension by cloning the repository that declares it, and SceneView's manifest sits in a
|
|
116
|
+
repository that also carries the Android, Apple, Web, Flutter and React Native sources. If you
|
|
117
|
+
want the server and not the clone, paste the standard `mcpServers` block into
|
|
118
|
+
`~/.gemini/settings.json` instead; it is the same command, `npx -y sceneview-mcp`, and it costs
|
|
119
|
+
a download of the npm package.
|
|
120
|
+
|
|
121
|
+
Either way, `npx` resolves `sceneview-mcp` to the **latest version published on npm**, which is
|
|
122
|
+
not necessarily the version this manifest declares — the manifest's `version` describes the
|
|
123
|
+
extension, and the server it launches updates on npm's cadence.
|
|
124
|
+
|
|
125
|
+
The extension declares nothing but the server: `npx -y sceneview-mcp` over stdio, no context
|
|
126
|
+
file and no tool exclusions, so it adds the SceneView tools to a session and changes nothing
|
|
127
|
+
else about it.
|
|
128
|
+
|
|
129
|
+
### Gemini in Android Studio
|
|
130
|
+
|
|
131
|
+
Android Studio's MCP integration **does not support stdio** — it connects over HTTP only, so
|
|
132
|
+
point it at the hosted endpoint. Settings → Tools → AI → MCP Servers:
|
|
66
133
|
|
|
67
134
|
```json
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
135
|
+
{ "mcpServers": { "sceneview": { "httpUrl": "https://mcp.sceneview.dev/mcp", "enabled": true } } }
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### GitHub Copilot
|
|
139
|
+
|
|
140
|
+
In VS Code, `.vscode/mcp.json` — note the `servers` key, not `mcpServers`:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{ "servers": { "sceneview": { "type": "stdio", "command": "npx", "args": ["-y", "sceneview-mcp"] } } }
|
|
76
144
|
```
|
|
77
145
|
|
|
78
|
-
|
|
146
|
+
VS Code also accepts an install link:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
vscode:mcp/install?%7B%22name%22%3A%22sceneview%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22sceneview-mcp%22%5D%7D
|
|
150
|
+
```
|
|
79
151
|
|
|
80
|
-
|
|
152
|
+
In Copilot CLI:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
copilot mcp add sceneview -- npx -y sceneview-mcp
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### JetBrains AI Assistant / Junie
|
|
159
|
+
|
|
160
|
+
Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add, then paste the standard
|
|
161
|
+
`mcpServers` block above.
|
|
162
|
+
|
|
163
|
+
### MCP Bundle (`.mcpb`)
|
|
164
|
+
|
|
165
|
+
[`mcp/manifest.json`](manifest.json) describes this server in the [MCP Bundle
|
|
166
|
+
format](https://github.com/modelcontextprotocol/mcpb) (spec 0.3), for desktop apps that install
|
|
167
|
+
a local server from a bundle rather than a command line. It runs the built `dist/index.js` with
|
|
168
|
+
the host's Node — the host provides the runtime and **nothing else**, so the bundle has to carry
|
|
169
|
+
its own `node_modules`. Zipping this directory after `npm run build` alone produces a bundle
|
|
170
|
+
that fails at launch with `Cannot find package '@modelcontextprotocol/sdk'`:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npm ci # dev dependencies — the build needs them
|
|
174
|
+
npm run build # writes dist/
|
|
175
|
+
npm ci --omit=dev --ignore-scripts # drop the dev tree, keep dist/
|
|
176
|
+
zip -r sceneview-mcp.mcpb manifest.json package.json dist node_modules
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`--ignore-scripts` is not optional: this package's `prepare` script ends in `tsc`, and the same
|
|
180
|
+
command that omits the dev dependencies omits TypeScript, so without it npm runs `prepare`,
|
|
181
|
+
fails to find `tsc` and exits 127. Reinstall with a plain `npm ci` afterwards to get the dev
|
|
182
|
+
tree back.
|
|
183
|
+
|
|
184
|
+
The manifest is not published as a `.mcpb` artefact by CI: it is the descriptor, and packing it
|
|
185
|
+
stays a manual step for whoever needs a bundle. `mcp/src/packaging.test.ts` keeps its name,
|
|
186
|
+
version, licence, entry point and Node range equal to `package.json`'s — and does the same for
|
|
187
|
+
[`server.json`](server.json) and the root `gemini-extension.json` — because nothing else would
|
|
188
|
+
notice them drifting.
|
|
189
|
+
|
|
190
|
+
### Use as a remote connector
|
|
191
|
+
|
|
192
|
+
No install, nothing to run: SceneView is hosted as a remote MCP server at
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
https://mcp.sceneview.dev/mcp
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Any client that accepts a Streamable HTTP MCP URL can use it. In claude.ai, that is
|
|
199
|
+
**Settings → Connectors → Add custom connector**.
|
|
200
|
+
|
|
201
|
+
**Authless and read-only.** There is no sign-in, no API key and no account: every tool is a pure
|
|
202
|
+
function of the SDK's own documentation, samples and API surface, so there is nothing to
|
|
203
|
+
authenticate and nothing of yours stored. All tools are annotated `readOnlyHint` except
|
|
204
|
+
`generate_3d_model`, which calls an external generation service and is therefore marked
|
|
205
|
+
open-world rather than read-only.
|
|
206
|
+
|
|
207
|
+
**Prefer it local?** `npx -y sceneview-mcp` runs the exact same server over stdio. The local
|
|
208
|
+
route is the one that reads your project from disk (`analyze_project`) and the one that accepts
|
|
209
|
+
your own `SKETCHFAB_API_KEY` / `TRIPO_API_KEY`; the hosted connector, being shared and anonymous,
|
|
210
|
+
cannot.
|
|
211
|
+
|
|
212
|
+
### Remote server (Streamable HTTP)
|
|
213
|
+
|
|
214
|
+
Some hosts cannot spawn a local process: they need MCP's **Streamable HTTP** transport at a public URL. The same package serves it:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npx sceneview-mcp --http
|
|
218
|
+
# [sceneview-mcp] v4.x — HTTP (remote tool surface)
|
|
219
|
+
# [sceneview-mcp] MCP endpoint: http://127.0.0.1:3333/mcp
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
| Route | What it does |
|
|
223
|
+
|---|---|
|
|
224
|
+
| `POST /mcp` | MCP JSON-RPC (Streamable HTTP, stateless — no sessions, safe behind any load balancer) |
|
|
225
|
+
| `GET` / `DELETE /mcp` | `405` (no standalone SSE stream, no session to delete) |
|
|
226
|
+
| `GET /health` | `{"status":"ok","version":"4.x.y"}` |
|
|
227
|
+
| `GET /.well-known/openai-apps-challenge` | OpenAI domain verification — returns `OPENAI_APPS_CHALLENGE_TOKEN` as `text/plain`, `404` when unset |
|
|
228
|
+
| anything else | `404` |
|
|
229
|
+
|
|
230
|
+
Configuration: `PORT` (default `3333`), `HOST` (default `127.0.0.1` — set `HOST=0.0.0.0` to expose it, and put HTTPS in front), `OPENAI_APPS_CHALLENGE_TOKEN` (the value OpenAI gives you when you submit the domain). CORS allows any origin. The usual `SKETCHFAB_API_KEY` / `TRIPO_API_KEY` / `SCENEVIEW_TELEMETRY=0` knobs apply.
|
|
231
|
+
|
|
232
|
+
**Everything is free, but not everything is remote.** Three generation tools (`render_3d_preview`, `create_3d_artifact`, `generate_scene`) need your own third-party credentials, which a shared anonymous endpoint cannot hold, so the remote surface omits them and refuses those names at call time with a clear `isError` message pointing at the local `npx sceneview-mcp` path. stdio lists and runs all 32.
|
|
233
|
+
|
|
234
|
+
**Inline 3D viewer.** `view_3d_model` returns `structuredContent` plus `_meta.ui.resourceUri = ui://widget/3d-viewer.html`; the widget (SceneView.js + Filament.js, served by `resources/read` with the `text/html;profile=mcp-app` mime type and its `_meta.ui.csp`) renders the model inline in ChatGPT and any MCP Apps host.
|
|
235
|
+
|
|
236
|
+
Smoke test with curl (the `Accept` header is required by the spec):
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
curl -s http://127.0.0.1:3333/mcp \
|
|
240
|
+
-H 'Content-Type: application/json' \
|
|
241
|
+
-H 'Accept: application/json, text/event-stream' \
|
|
242
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
|
|
243
|
+
# {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","capabilities":{"resources":{},"tools":{}},"serverInfo":{"name":"sceneview-mcp","version":"4.x.y"}}}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Point the ChatGPT connector / OpenAI `mcp` tool at `https://<your-host>/mcp`.
|
|
247
|
+
|
|
248
|
+
**Already hosted.** You do not have to run it yourself to get a public URL: the same code is
|
|
249
|
+
deployed at `https://mcp.sceneview.dev/mcp` (`GET /health` answers `{"status":"ok"}`), which is
|
|
250
|
+
what the [remote connector](#use-as-a-remote-connector) above points at. Self-host when you want
|
|
251
|
+
your own keys, your own rate limits, or `analyze_project` against a local checkout.
|
|
81
252
|
|
|
82
253
|
---
|
|
83
254
|
|
|
84
255
|
## What you get
|
|
85
256
|
|
|
86
|
-
Every
|
|
257
|
+
Every tool is free and there is no API key. The three generation tools that talk to a
|
|
258
|
+
third-party service use *your* credentials; everything else works the moment the server starts.
|
|
259
|
+
|
|
260
|
+
### Start here
|
|
261
|
+
|
|
262
|
+
Six tools carry most of what assistants actually do with SceneView. If you read nothing else:
|
|
87
263
|
|
|
88
|
-
|
|
264
|
+
| Tool | What it does | Ask your assistant |
|
|
265
|
+
|---|---|---|
|
|
266
|
+
| `validate_code` | Compile-checks generated Kotlin or Swift against the real public API — symbol existence, 30+ rules, did-you-mean suggestions — before it reaches you | *"Check that this SceneView code actually compiles"* |
|
|
267
|
+
| `get_node_reference` | The exact signature, defaults and example for any of 48+ node types, instead of an invented one | *"What are the parameters of ModelNode?"* |
|
|
268
|
+
| `list_samples` | Browse 38 scenarios by tag (`ar`, `3d`, `ios`, `animation`, `geometry`, …) | *"What SceneView samples involve AR planes?"* |
|
|
269
|
+
| `get_sample` | Returns one of them complete and compilable, in Kotlin or Swift | *"Give me the AR plane-placement sample in Kotlin"* |
|
|
270
|
+
| `get_setup` | Gradle and manifest setup for Android 3D or AR | *"Set up SceneView in my Android app"* |
|
|
271
|
+
| `get_ar_setup` | Permissions, session options, plane detection, image tracking | *"Add ARCore plane detection to this screen"* |
|
|
272
|
+
|
|
273
|
+
### Full tool reference
|
|
89
274
|
|
|
90
275
|
#### Setup & integration
|
|
91
276
|
|
|
@@ -101,7 +286,7 @@ Every developer tool is **free**: setup guides for every platform, code samples,
|
|
|
101
286
|
|
|
102
287
|
| Tool | What it does |
|
|
103
288
|
|---|---|
|
|
104
|
-
| `get_sample` | Returns a complete, compilable code sample for any of
|
|
289
|
+
| `get_sample` | Returns a complete, compilable code sample for any of 38 scenarios (Kotlin or Swift) |
|
|
105
290
|
| `list_samples` | Browse all samples, filter by tag (`ar`, `3d`, `ios`, `animation`, `geometry`, ...) |
|
|
106
291
|
| `validate_code` | Checks generated code against 30+ rules — including symbol existence against the real public API, with did-you-mean suggestions — before presenting it to the user |
|
|
107
292
|
| `migrate_code` | Automatically migrates SceneView 2.x / 3.x code with detailed changelog |
|
|
@@ -111,7 +296,7 @@ Every developer tool is **free**: setup guides for every platform, code samples,
|
|
|
111
296
|
|
|
112
297
|
| Tool | What it does |
|
|
113
298
|
|---|---|
|
|
114
|
-
| `get_node_reference` | Full API reference for any of
|
|
299
|
+
| `get_node_reference` | Full API reference for any of 48+ node types — exact signatures, defaults, examples |
|
|
115
300
|
| `list_platforms` | Supported platforms with their status, renderer, and framework |
|
|
116
301
|
| `get_platform_roadmap` | Multi-platform status and timeline |
|
|
117
302
|
|
|
@@ -129,12 +314,21 @@ Every developer tool is **free**: setup guides for every platform, code samples,
|
|
|
129
314
|
| `search_android_docs` | Searches Google's stock Android docs knowledge base (needs the `android` CLI on PATH) |
|
|
130
315
|
| `fetch_android_doc` | Fetches a full Android docs entry by its `kb://...` URI (needs the `android` CLI on PATH) |
|
|
131
316
|
|
|
132
|
-
|
|
317
|
+
#### Inline 3D viewer (MCP Apps widget)
|
|
318
|
+
|
|
319
|
+
| Tool | What it does |
|
|
320
|
+
|---|---|
|
|
321
|
+
| `view_3d_model` | Renders a public GLB / glTF URL in an interactive SceneView.js + Filament.js viewer inline in ChatGPT and any MCP Apps host (orbit, auto-rotate). For an https model it adds an "Open in AR on your phone" action (an `ar.sceneview.dev/open` link to the 3D AR Model Viewer app, with a QR code on desktop). Returns `structuredContent` + `_meta.ui.resourceUri` |
|
|
322
|
+
|
|
323
|
+
### 5 resources
|
|
133
324
|
|
|
134
325
|
| Resource URI | What it provides |
|
|
135
326
|
|---|---|
|
|
136
|
-
| `sceneview://api` | Complete SceneView 4.
|
|
327
|
+
| `sceneview://api` | Complete SceneView 4.x API reference (the full `llms.txt`) |
|
|
137
328
|
| `sceneview://known-issues` | Live open issues from GitHub (cached 10 min) |
|
|
329
|
+
| `examples://demo-with-settings` | DemoScaffold v2 pattern — full-screen scene + Material 3 bottom sheet |
|
|
330
|
+
| `examples://sketchfab-streaming` | Streaming Sketchfab CC-BY models into a demo instead of bundling GLBs |
|
|
331
|
+
| `ui://widget/3d-viewer.html` | The 3D viewer widget (`text/html;profile=mcp-app`) that `view_3d_model` renders into |
|
|
138
332
|
|
|
139
333
|
---
|
|
140
334
|
|
|
@@ -238,31 +432,32 @@ The assistant calls `validate_code` with the generated snippet and checks it aga
|
|
|
238
432
|
- Have no knowledge of SceneView's iOS/Swift API at all
|
|
239
433
|
|
|
240
434
|
**With** this MCP server, AI assistants:
|
|
241
|
-
- Always use the current SceneView 4.
|
|
435
|
+
- Always use the current SceneView 4.x API surface
|
|
242
436
|
- Generate correct **Compose-native** 3D/AR code for Android
|
|
243
437
|
- Generate correct **SwiftUI-native** code for iOS/macOS/visionOS
|
|
244
|
-
- Know about all
|
|
438
|
+
- Know about all 48+ node types and their exact parameters
|
|
245
439
|
- Validate code against 30+ rules before presenting it
|
|
246
|
-
- Provide working, tested sample code for
|
|
440
|
+
- Provide working, tested sample code for 38 scenarios
|
|
247
441
|
|
|
248
442
|
---
|
|
249
443
|
|
|
250
444
|
## Quality
|
|
251
445
|
|
|
252
|
-
The MCP server is tested with **
|
|
446
|
+
The MCP server is tested with **2,015 unit tests** across 91 test files covering:
|
|
253
447
|
|
|
254
448
|
- Every tool response (correct output, error handling, edge cases)
|
|
255
|
-
- All
|
|
449
|
+
- All 38 code samples (compilable structure, correct imports, no deprecated APIs)
|
|
256
450
|
- Code validator rules (true positives and false-positive resistance)
|
|
257
451
|
- Node reference parsing (all node types extracted correctly from `llms.txt`)
|
|
258
|
-
- Resource responses (API reference, GitHub issues integration)
|
|
452
|
+
- Resource responses (API reference, GitHub issues integration, the 3D viewer widget)
|
|
453
|
+
- The Streamable HTTP surface end to end (initialize, free-only tools/list, widget resource, health, OpenAI challenge)
|
|
259
454
|
|
|
260
455
|
```
|
|
261
|
-
Test Files
|
|
262
|
-
Tests
|
|
456
|
+
Test Files 91 passed (91)
|
|
457
|
+
Tests 2015 passed (2015)
|
|
263
458
|
```
|
|
264
459
|
|
|
265
|
-
All tools work **fully offline** except `sceneview://known-issues` (GitHub API, cached 10 min), `search_models` (Sketchfab, BYOK), and `generate_3d_model` (Tripo AI, BYOK).
|
|
460
|
+
All tools work **fully offline** except `sceneview://known-issues` (GitHub API, cached 10 min), `search_models` (Sketchfab, BYOK), and `generate_3d_model` (Tripo AI, BYOK). Anonymous telemetry also makes a network call unless `SCENEVIEW_TELEMETRY=0` (see [below](#anonymous-telemetry)).
|
|
266
461
|
|
|
267
462
|
---
|
|
268
463
|
|
|
@@ -286,7 +481,7 @@ Install Node.js from [nodejs.org](https://nodejs.org/) (LTS recommended). npm an
|
|
|
286
481
|
|
|
287
482
|
### Firewall or proxy issues
|
|
288
483
|
|
|
289
|
-
The only network calls are to the GitHub API (for known issues), Sketchfab (when `SKETCHFAB_API_KEY` is set),
|
|
484
|
+
The only network calls are to the GitHub API (for known issues), Sketchfab (when `SKETCHFAB_API_KEY` is set), Tripo AI (when `TRIPO_API_KEY` is set and `generate_3d_model` is called), and the anonymous telemetry endpoint (off with `SCENEVIEW_TELEMETRY=0`). Everything else works offline.
|
|
290
485
|
|
|
291
486
|
```json
|
|
292
487
|
{
|
|
@@ -304,30 +499,15 @@ The only network calls are to the GitHub API (for known issues), Sketchfab (when
|
|
|
304
499
|
|
|
305
500
|
---
|
|
306
501
|
|
|
307
|
-
## Optional: vertical packages
|
|
308
|
-
|
|
309
|
-
A small set of domain-specific tools is gated behind an optional subscription. They aren't required for general 3D/AR work — only useful if you happen to be building one of these specific verticals:
|
|
310
|
-
|
|
311
|
-
- **Automotive** — car configurator, paint shader, parts catalog, HUD overlay, AR showroom
|
|
312
|
-
- **Gaming** — physics, particles, level editor, character viewer, inventory 3D
|
|
313
|
-
- **Healthcare** — surgical planning, dental viewer, medical imaging, anatomy, molecule viewer
|
|
314
|
-
- **Interior** — room planner, lighting design, material switcher, furniture placement, room tour
|
|
315
|
-
|
|
316
|
-
Plus 3 generation helpers: `render_3d_preview`, `create_3d_artifact`, `generate_scene`.
|
|
317
|
-
|
|
318
|
-
The base SDK and every developer tool listed above stay free, always.
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
502
|
## Sponsor
|
|
323
503
|
|
|
324
|
-
If sceneview-mcp saves you time, consider [
|
|
504
|
+
If sceneview-mcp saves you time, consider [donating on Open Collective](https://opencollective.com/sceneview), or [GitHub Sponsors](https://github.com/sponsors/sceneview) if you prefer. Building this is a one-dev labor of love; every tool is free with or without a donation.
|
|
325
505
|
|
|
326
506
|
---
|
|
327
507
|
|
|
328
508
|
## Anonymous telemetry
|
|
329
509
|
|
|
330
|
-
Enabled by default
|
|
510
|
+
Enabled by default (MCP client name/version and tool names — no personal data, no prompt content). Opt out with `SCENEVIEW_TELEMETRY=0`. See [PRIVACY.md](./PRIVACY.md#telemetry) for the full payload shape.
|
|
331
511
|
|
|
332
512
|
---
|
|
333
513
|
|
|
@@ -337,7 +517,9 @@ Enabled by default on the free tier (MCP client name/version and tool names —
|
|
|
337
517
|
cd mcp
|
|
338
518
|
npm install
|
|
339
519
|
npm run prepare # Copy llms.txt + build TypeScript
|
|
340
|
-
npm test #
|
|
520
|
+
npm test # vitest suite
|
|
521
|
+
npm run lint # Biome (repo-root biome.json) — lint + format + import assists
|
|
522
|
+
npm run lint:fix # same, applying the safe fixes
|
|
341
523
|
npm run dev # Start with tsx (hot reload)
|
|
342
524
|
```
|
|
343
525
|
|
|
@@ -346,10 +528,13 @@ npm run dev # Start with tsx (hot reload)
|
|
|
346
528
|
```
|
|
347
529
|
mcp/
|
|
348
530
|
src/
|
|
349
|
-
index.ts #
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
531
|
+
index.ts # CLI entry point — stdio, or Streamable HTTP with --http
|
|
532
|
+
server.ts # The MCP Server (resources + tools), shared by both transports
|
|
533
|
+
http.ts # Streamable HTTP entrypoint (/mcp, /health, OpenAI challenge)
|
|
534
|
+
widgets.ts # MCP Apps widget: ui://widget/3d-viewer.html (SceneView.js + Filament.js)
|
|
535
|
+
tools/handler.ts # Tool dispatcher
|
|
536
|
+
surfaces.ts # Which tools the anonymous remote surface serves
|
|
537
|
+
samples.ts # 38 compilable code samples (Kotlin + Swift)
|
|
353
538
|
validator.ts # Code validator (30+ rules)
|
|
354
539
|
node-reference.ts # Node type parser
|
|
355
540
|
guides.ts # Best practices, AR setup, roadmap, troubleshooting
|
|
@@ -360,7 +545,6 @@ mcp/
|
|
|
360
545
|
search-models.ts # Sketchfab BYOK search
|
|
361
546
|
generate-model.ts # Tripo BYOK text/image -> GLB generation
|
|
362
547
|
analyze-project.ts # Local project scanner
|
|
363
|
-
proxy.ts # Pro-tool proxy to hosted gateway
|
|
364
548
|
llms.txt # Bundled API reference (copied from repo root)
|
|
365
549
|
```
|
|
366
550
|
|
|
@@ -369,7 +553,7 @@ mcp/
|
|
|
369
553
|
1. Fork the repository
|
|
370
554
|
2. Create a feature branch
|
|
371
555
|
3. Add tests for new tools or rules
|
|
372
|
-
4. Run `npm test` — all
|
|
556
|
+
4. Run `npm test` — all tests must pass
|
|
373
557
|
5. Submit a pull request
|
|
374
558
|
|
|
375
559
|
See [CONTRIBUTING.md](../CONTRIBUTING.md) for the full guide.
|
package/dist/analyze-project.js
CHANGED
|
@@ -254,7 +254,8 @@ async function detectProject(rootDir) {
|
|
|
254
254
|
];
|
|
255
255
|
for (const rel of androidCandidates) {
|
|
256
256
|
const read = await tryRead(rootDir, rel);
|
|
257
|
-
if (read &&
|
|
257
|
+
if (read &&
|
|
258
|
+
/io\.github\.sceneview:(sceneview|arsceneview|sceneview-core)/.test(read.contents)) {
|
|
258
259
|
return {
|
|
259
260
|
projectType: "android",
|
|
260
261
|
sceneViewVersion: extractGradleVersion(read.contents),
|
|
@@ -445,7 +446,8 @@ export async function analyzeProject(input = {}) {
|
|
|
445
446
|
"`withContext(Dispatchers.Main)`.",
|
|
446
447
|
});
|
|
447
448
|
}
|
|
448
|
-
if (result.projectType !== "unknown" &&
|
|
449
|
+
if (result.projectType !== "unknown" &&
|
|
450
|
+
result.warnings.filter((w) => !w.type.startsWith("scan/")).length === 0) {
|
|
449
451
|
result.suggestions.push({
|
|
450
452
|
type: "suggestion/no-issues",
|
|
451
453
|
message: "No known anti-patterns detected in the scanned files. Call `validate_code` on " +
|
package/dist/artifact.js
CHANGED
|
@@ -11,12 +11,23 @@
|
|
|
11
11
|
// - chart-3d: 3D bar/pie charts for data visualization (CSS 3D)
|
|
12
12
|
// - scene: multi-model 3D scene with lighting and environment (Filament.js)
|
|
13
13
|
// - product-360: product turntable with hotspot annotations (Filament.js)
|
|
14
|
+
import { FILAMENT_WEB_NPM_VERSION } from "./generated/version.js";
|
|
14
15
|
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
15
|
-
|
|
16
|
+
// The npm `filament` pin from gradle/libs.versions.toml (`filamentWeb`),
|
|
17
|
+
// snapshotted at build time — never a hand-copied version (#3173).
|
|
18
|
+
const FILAMENT_CDN = `https://cdn.jsdelivr.net/npm/filament@${FILAMENT_WEB_NPM_VERSION}/filament.js`;
|
|
16
19
|
const DEFAULT_MODEL = "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/DamagedHelmet/glTF-Binary/DamagedHelmet.glb";
|
|
17
20
|
const DEFAULT_COLORS = [
|
|
18
|
-
"#4285F4",
|
|
19
|
-
"#
|
|
21
|
+
"#4285F4",
|
|
22
|
+
"#EA4335",
|
|
23
|
+
"#FBBC04",
|
|
24
|
+
"#34A853",
|
|
25
|
+
"#FF6D01",
|
|
26
|
+
"#46BDC6",
|
|
27
|
+
"#7BAAF7",
|
|
28
|
+
"#F07B72",
|
|
29
|
+
"#FCD04F",
|
|
30
|
+
"#57BB8A",
|
|
20
31
|
];
|
|
21
32
|
const BRANDING = `<div style="position:absolute;bottom:8px;right:12px;font-size:11px;color:#888;font-family:system-ui,sans-serif;pointer-events:none">Powered by SceneView</div>`;
|
|
22
33
|
// ─── Shared HTML skeleton ────────────────────────────────────────────────────
|
|
@@ -39,11 +50,21 @@ ${body}
|
|
|
39
50
|
</html>`;
|
|
40
51
|
}
|
|
41
52
|
function escapeHtml(s) {
|
|
42
|
-
return s
|
|
53
|
+
return s
|
|
54
|
+
.replace(/&/g, "&")
|
|
55
|
+
.replace(/</g, "<")
|
|
56
|
+
.replace(/>/g, ">")
|
|
57
|
+
.replace(/"/g, """);
|
|
43
58
|
}
|
|
44
59
|
// ─── Validation ──────────────────────────────────────────────────────────────
|
|
45
60
|
export function validateArtifactInput(input) {
|
|
46
|
-
const validTypes = [
|
|
61
|
+
const validTypes = [
|
|
62
|
+
"model-viewer",
|
|
63
|
+
"chart-3d",
|
|
64
|
+
"scene",
|
|
65
|
+
"product-360",
|
|
66
|
+
"geometry",
|
|
67
|
+
];
|
|
47
68
|
if (!validTypes.includes(input.type)) {
|
|
48
69
|
return `Invalid type "${input.type}". Must be one of: ${validTypes.join(", ")}`;
|
|
49
70
|
}
|
|
@@ -106,7 +127,7 @@ export function generateArtifact(input) {
|
|
|
106
127
|
// and product-360 artifact types.
|
|
107
128
|
function filamentRendererScript(options) {
|
|
108
129
|
const { modelUrl, bgColor, autoRotate, orbitRadius = 3.5, orbitHeight = 0.8, sunIntensity = 110000, fillIntensity = 30000, } = options;
|
|
109
|
-
return `<script src="${FILAMENT_CDN}"
|
|
130
|
+
return `<script src="${FILAMENT_CDN}"></script>
|
|
110
131
|
<script>
|
|
111
132
|
Filament.init(['${modelUrl}'], function() {
|
|
112
133
|
try {
|
|
@@ -192,7 +213,7 @@ Filament.init(['${modelUrl}'], function() {
|
|
|
192
213
|
console.error(e);
|
|
193
214
|
}
|
|
194
215
|
});
|
|
195
|
-
|
|
216
|
+
</script>`;
|
|
196
217
|
}
|
|
197
218
|
/** Convert hex color to Filament RGBA [0-1] range */
|
|
198
219
|
function hexToBgColor(hex) {
|
|
@@ -316,17 +337,21 @@ function generateProduct360(input) {
|
|
|
316
337
|
const hotspots = input.hotspots || [];
|
|
317
338
|
// Product-360 always auto-rotates (with a slower speed handled in the core script)
|
|
318
339
|
const autoRotate = true;
|
|
319
|
-
const hotspotHtml = hotspots.length > 0
|
|
340
|
+
const hotspotHtml = hotspots.length > 0
|
|
341
|
+
? `
|
|
320
342
|
<div class="hotspots-overlay" id="hotspots">
|
|
321
|
-
${hotspots
|
|
343
|
+
${hotspots
|
|
344
|
+
.map((h, i) => `
|
|
322
345
|
<div class="hotspot" id="hotspot-${i}" data-position="${escapeHtml(h.position)}" data-normal="${escapeHtml(h.normal)}">
|
|
323
346
|
<div class="hotspot-dot"></div>
|
|
324
347
|
<div class="hotspot-annotation">
|
|
325
348
|
<div class="hotspot-title">${escapeHtml(h.label)}</div>
|
|
326
349
|
${h.description ? `<div class="hotspot-desc">${escapeHtml(h.description)}</div>` : ""}
|
|
327
350
|
</div>
|
|
328
|
-
</div>`)
|
|
329
|
-
|
|
351
|
+
</div>`)
|
|
352
|
+
.join("\n")}
|
|
353
|
+
</div>`
|
|
354
|
+
: "";
|
|
330
355
|
const body = `
|
|
331
356
|
<style>
|
|
332
357
|
canvas{width:100%;height:100%;cursor:grab;display:block}
|
|
@@ -394,7 +419,7 @@ function generateGeometry(input) {
|
|
|
394
419
|
cy /= shapes.length;
|
|
395
420
|
cz /= shapes.length;
|
|
396
421
|
}
|
|
397
|
-
const shapesJson = JSON.stringify(shapes.map(s => ({
|
|
422
|
+
const shapesJson = JSON.stringify(shapes.map((s) => ({
|
|
398
423
|
type: s.type,
|
|
399
424
|
position: s.position || [0, 0, 0],
|
|
400
425
|
scale: s.scale || [1, 1, 1],
|
|
@@ -617,7 +642,7 @@ function render(){
|
|
|
617
642
|
}
|
|
618
643
|
requestAnimationFrame(render);
|
|
619
644
|
})();
|
|
620
|
-
|
|
645
|
+
</script>`;
|
|
621
646
|
return {
|
|
622
647
|
html: htmlShell(title, body),
|
|
623
648
|
title,
|