sceneview-mcp 4.0.2 → 4.0.4
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 +1 -23
- package/dist/index.js +1 -1
- package/dist/tiers.js +1 -0
- package/dist/tools/definitions.js +140 -27
- package/dist/tools/handler.js +12 -98
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,9 +44,7 @@ After subscribing, you'll receive a `sv_live_…` API key. Set it via the `SCENE
|
|
|
44
44
|
|
|
45
45
|
## Quick start (free tier)
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Option A — stdio via `npx` (Claude Desktop, Claude Code, Cursor, Windsurf)
|
|
47
|
+
**One command -- no install required:**
|
|
50
48
|
|
|
51
49
|
```bash
|
|
52
50
|
npx sceneview-mcp
|
|
@@ -54,26 +52,6 @@ npx sceneview-mcp
|
|
|
54
52
|
|
|
55
53
|
On startup you'll see a `[sceneview-mcp] v4.0.1 — LITE (free tools only)` banner on stderr. Set `SCENEVIEW_API_KEY` to flip into `HOSTED` mode.
|
|
56
54
|
|
|
57
|
-
### Option B — hosted HTTP MCP URL (ChatGPT, Claude Desktop "Remote MCP", Cursor URL, anything HTTP)
|
|
58
|
-
|
|
59
|
-
No install, no `npx`, no config files — just point your client at:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
https://sceneview-mcp.mcp-tools-lab.workers.dev/mcp/public
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
- Anonymous, no API key required
|
|
66
|
-
- 26 free tools fully accessible
|
|
67
|
-
- 35 Pro tools return a `/pricing` upgrade prompt
|
|
68
|
-
- Rate limit: 60 requests / hour per IP
|
|
69
|
-
|
|
70
|
-
For **Pro tier with a Bearer token** (full quota, all 35 Pro tools):
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
https://sceneview-mcp.mcp-tools-lab.workers.dev/mcp
|
|
74
|
-
Authorization: Bearer sv_live_...
|
|
75
|
-
```
|
|
76
|
-
|
|
77
55
|
> **Anonymous telemetry** is enabled on the free tier (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-free-tier) for the full payload shape.
|
|
78
56
|
|
|
79
57
|
### Claude Desktop
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { API_DOCS, TOOL_DEFINITIONS, dispatchTool, } from "./tools/index.js";
|
|
|
27
27
|
// Claude Desktop surfaces this in the server's "Logs" panel. The banner
|
|
28
28
|
// tells the user which mode they're in (hosted vs free) and where to
|
|
29
29
|
// upgrade, without blocking the transport handshake.
|
|
30
|
-
const PACKAGE_VERSION = "4.0.
|
|
30
|
+
const PACKAGE_VERSION = "4.0.0";
|
|
31
31
|
function logStartupBanner() {
|
|
32
32
|
if (process.env.SCENEVIEW_MCP_QUIET === "1")
|
|
33
33
|
return;
|
package/dist/tiers.js
CHANGED
|
@@ -11,33 +11,6 @@ import { SAMPLE_IDS, SAMPLES } from "../samples.js";
|
|
|
11
11
|
import { PLATFORM_IDS } from "../platform-setup.js";
|
|
12
12
|
import { DEBUG_CATEGORIES } from "../debug-issue.js";
|
|
13
13
|
export const TOOL_DEFINITIONS = [
|
|
14
|
-
{
|
|
15
|
-
// Activation tool — designed to be called immediately after init by the
|
|
16
|
-
// host AI. Intentionally listed FIRST so it's the first tool the model
|
|
17
|
-
// notices when scanning the MCP server's tool list. Returns a short
|
|
18
|
-
// overview + 3 concrete prompt suggestions the user can run, plus the
|
|
19
|
-
// canonical install snippet for whichever platform they target.
|
|
20
|
-
//
|
|
21
|
-
// Empirical motivation: 30-day telemetry shows ~55% of MCP inits never
|
|
22
|
-
// produce a tool call. Most of those clients (cursor-vscode, codex,
|
|
23
|
-
// claude-desktop, claude.ai) install but never trigger anything because
|
|
24
|
-
// the existing tool descriptions are passive lookups ("Returns ..."), not
|
|
25
|
-
// actions. This tool gives the host AI a clear hook to surface SceneView
|
|
26
|
-
// capabilities right after install.
|
|
27
|
-
name: "get_started",
|
|
28
|
-
description: "Run this FIRST when SceneView MCP is freshly installed, or whenever the user asks 'what can SceneView do', 'how do I start with SceneView', 'show me an AR example', or any open-ended SceneView question. Returns a one-page overview with 3 concrete prompts the user can try immediately, the install snippet for their platform, and links to the playground. Always call this before any other SceneView tool when the conversation has no prior SceneView context.",
|
|
29
|
-
inputSchema: {
|
|
30
|
-
type: "object",
|
|
31
|
-
properties: {
|
|
32
|
-
platform: {
|
|
33
|
-
type: "string",
|
|
34
|
-
enum: ["android", "ios", "web", "any"],
|
|
35
|
-
description: 'Target platform — "android" (Jetpack Compose + Filament), "ios" (SwiftUI + RealityKit), "web" (Filament.js + WebXR), or "any" for an unopinionated overview. Defaults to "any" if unsure.',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
required: [],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
14
|
{
|
|
42
15
|
name: "get_sample",
|
|
43
16
|
description: "Returns a complete, compilable Kotlin sample for a given SceneView scenario. Use this to get a working starting point before customising. Call `list_samples` first if you are unsure which scenario fits.",
|
|
@@ -52,6 +25,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
52
25
|
},
|
|
53
26
|
required: ["scenario"],
|
|
54
27
|
},
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: true,
|
|
30
|
+
openWorldHint: false,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
},
|
|
55
33
|
},
|
|
56
34
|
{
|
|
57
35
|
name: "list_samples",
|
|
@@ -66,6 +44,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
66
44
|
},
|
|
67
45
|
required: [],
|
|
68
46
|
},
|
|
47
|
+
annotations: {
|
|
48
|
+
readOnlyHint: true,
|
|
49
|
+
openWorldHint: false,
|
|
50
|
+
destructiveHint: false,
|
|
51
|
+
},
|
|
69
52
|
},
|
|
70
53
|
{
|
|
71
54
|
name: "get_setup",
|
|
@@ -81,6 +64,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
81
64
|
},
|
|
82
65
|
required: ["type"],
|
|
83
66
|
},
|
|
67
|
+
annotations: {
|
|
68
|
+
readOnlyHint: true,
|
|
69
|
+
openWorldHint: false,
|
|
70
|
+
destructiveHint: false,
|
|
71
|
+
},
|
|
84
72
|
},
|
|
85
73
|
{
|
|
86
74
|
name: "validate_code",
|
|
@@ -95,6 +83,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
95
83
|
},
|
|
96
84
|
required: ["code"],
|
|
97
85
|
},
|
|
86
|
+
annotations: {
|
|
87
|
+
readOnlyHint: true,
|
|
88
|
+
openWorldHint: false,
|
|
89
|
+
destructiveHint: false,
|
|
90
|
+
},
|
|
98
91
|
},
|
|
99
92
|
{
|
|
100
93
|
name: "get_migration_guide",
|
|
@@ -104,6 +97,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
104
97
|
properties: {},
|
|
105
98
|
required: [],
|
|
106
99
|
},
|
|
100
|
+
annotations: {
|
|
101
|
+
readOnlyHint: true,
|
|
102
|
+
openWorldHint: false,
|
|
103
|
+
destructiveHint: false,
|
|
104
|
+
},
|
|
107
105
|
},
|
|
108
106
|
{
|
|
109
107
|
name: "get_node_reference",
|
|
@@ -118,6 +116,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
118
116
|
},
|
|
119
117
|
required: ["nodeType"],
|
|
120
118
|
},
|
|
119
|
+
annotations: {
|
|
120
|
+
readOnlyHint: true,
|
|
121
|
+
openWorldHint: false,
|
|
122
|
+
destructiveHint: false,
|
|
123
|
+
},
|
|
121
124
|
},
|
|
122
125
|
{
|
|
123
126
|
name: "get_platform_roadmap",
|
|
@@ -127,6 +130,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
127
130
|
properties: {},
|
|
128
131
|
required: [],
|
|
129
132
|
},
|
|
133
|
+
annotations: {
|
|
134
|
+
readOnlyHint: true,
|
|
135
|
+
openWorldHint: false,
|
|
136
|
+
destructiveHint: false,
|
|
137
|
+
},
|
|
130
138
|
},
|
|
131
139
|
{
|
|
132
140
|
name: "get_best_practices",
|
|
@@ -142,6 +150,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
142
150
|
},
|
|
143
151
|
required: [],
|
|
144
152
|
},
|
|
153
|
+
annotations: {
|
|
154
|
+
readOnlyHint: true,
|
|
155
|
+
openWorldHint: false,
|
|
156
|
+
destructiveHint: false,
|
|
157
|
+
},
|
|
145
158
|
},
|
|
146
159
|
{
|
|
147
160
|
name: "get_ar_setup",
|
|
@@ -151,6 +164,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
151
164
|
properties: {},
|
|
152
165
|
required: [],
|
|
153
166
|
},
|
|
167
|
+
annotations: {
|
|
168
|
+
readOnlyHint: true,
|
|
169
|
+
openWorldHint: false,
|
|
170
|
+
destructiveHint: false,
|
|
171
|
+
},
|
|
154
172
|
},
|
|
155
173
|
{
|
|
156
174
|
name: "get_troubleshooting",
|
|
@@ -160,6 +178,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
160
178
|
properties: {},
|
|
161
179
|
required: [],
|
|
162
180
|
},
|
|
181
|
+
annotations: {
|
|
182
|
+
readOnlyHint: true,
|
|
183
|
+
openWorldHint: false,
|
|
184
|
+
destructiveHint: false,
|
|
185
|
+
},
|
|
163
186
|
},
|
|
164
187
|
{
|
|
165
188
|
name: "get_ios_setup",
|
|
@@ -175,6 +198,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
175
198
|
},
|
|
176
199
|
required: ["type"],
|
|
177
200
|
},
|
|
201
|
+
annotations: {
|
|
202
|
+
readOnlyHint: true,
|
|
203
|
+
openWorldHint: false,
|
|
204
|
+
destructiveHint: false,
|
|
205
|
+
},
|
|
178
206
|
},
|
|
179
207
|
{
|
|
180
208
|
name: "get_web_setup",
|
|
@@ -183,6 +211,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
183
211
|
type: "object",
|
|
184
212
|
properties: {},
|
|
185
213
|
},
|
|
214
|
+
annotations: {
|
|
215
|
+
readOnlyHint: true,
|
|
216
|
+
openWorldHint: false,
|
|
217
|
+
destructiveHint: false,
|
|
218
|
+
},
|
|
186
219
|
},
|
|
187
220
|
{
|
|
188
221
|
name: "render_3d_preview",
|
|
@@ -213,6 +246,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
213
246
|
},
|
|
214
247
|
required: [],
|
|
215
248
|
},
|
|
249
|
+
annotations: {
|
|
250
|
+
readOnlyHint: true,
|
|
251
|
+
openWorldHint: false,
|
|
252
|
+
destructiveHint: false,
|
|
253
|
+
},
|
|
216
254
|
},
|
|
217
255
|
{
|
|
218
256
|
name: "create_3d_artifact",
|
|
@@ -311,6 +349,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
311
349
|
},
|
|
312
350
|
required: ["type"],
|
|
313
351
|
},
|
|
352
|
+
annotations: {
|
|
353
|
+
readOnlyHint: true,
|
|
354
|
+
openWorldHint: false,
|
|
355
|
+
destructiveHint: false,
|
|
356
|
+
},
|
|
314
357
|
},
|
|
315
358
|
{
|
|
316
359
|
name: "get_platform_setup",
|
|
@@ -331,6 +374,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
331
374
|
},
|
|
332
375
|
required: ["platform", "type"],
|
|
333
376
|
},
|
|
377
|
+
annotations: {
|
|
378
|
+
readOnlyHint: true,
|
|
379
|
+
openWorldHint: false,
|
|
380
|
+
destructiveHint: false,
|
|
381
|
+
},
|
|
334
382
|
},
|
|
335
383
|
{
|
|
336
384
|
name: "migrate_code",
|
|
@@ -345,6 +393,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
345
393
|
},
|
|
346
394
|
required: ["code"],
|
|
347
395
|
},
|
|
396
|
+
annotations: {
|
|
397
|
+
readOnlyHint: true,
|
|
398
|
+
openWorldHint: false,
|
|
399
|
+
destructiveHint: false,
|
|
400
|
+
},
|
|
348
401
|
},
|
|
349
402
|
{
|
|
350
403
|
name: "debug_issue",
|
|
@@ -364,6 +417,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
364
417
|
},
|
|
365
418
|
required: [],
|
|
366
419
|
},
|
|
420
|
+
annotations: {
|
|
421
|
+
readOnlyHint: true,
|
|
422
|
+
openWorldHint: false,
|
|
423
|
+
destructiveHint: false,
|
|
424
|
+
},
|
|
367
425
|
},
|
|
368
426
|
{
|
|
369
427
|
name: "generate_scene",
|
|
@@ -378,6 +436,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
378
436
|
},
|
|
379
437
|
required: ["description"],
|
|
380
438
|
},
|
|
439
|
+
annotations: {
|
|
440
|
+
readOnlyHint: true,
|
|
441
|
+
openWorldHint: false,
|
|
442
|
+
destructiveHint: false,
|
|
443
|
+
},
|
|
381
444
|
},
|
|
382
445
|
{
|
|
383
446
|
name: "list_platforms",
|
|
@@ -387,6 +450,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
387
450
|
properties: {},
|
|
388
451
|
required: [],
|
|
389
452
|
},
|
|
453
|
+
annotations: {
|
|
454
|
+
readOnlyHint: true,
|
|
455
|
+
openWorldHint: false,
|
|
456
|
+
destructiveHint: false,
|
|
457
|
+
},
|
|
390
458
|
},
|
|
391
459
|
{
|
|
392
460
|
name: "get_animation_guide",
|
|
@@ -396,6 +464,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
396
464
|
properties: {},
|
|
397
465
|
required: [],
|
|
398
466
|
},
|
|
467
|
+
annotations: {
|
|
468
|
+
readOnlyHint: true,
|
|
469
|
+
openWorldHint: false,
|
|
470
|
+
destructiveHint: false,
|
|
471
|
+
},
|
|
399
472
|
},
|
|
400
473
|
{
|
|
401
474
|
name: "get_gesture_guide",
|
|
@@ -405,6 +478,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
405
478
|
properties: {},
|
|
406
479
|
required: [],
|
|
407
480
|
},
|
|
481
|
+
annotations: {
|
|
482
|
+
readOnlyHint: true,
|
|
483
|
+
openWorldHint: false,
|
|
484
|
+
destructiveHint: false,
|
|
485
|
+
},
|
|
408
486
|
},
|
|
409
487
|
{
|
|
410
488
|
name: "get_performance_tips",
|
|
@@ -414,6 +492,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
414
492
|
properties: {},
|
|
415
493
|
required: [],
|
|
416
494
|
},
|
|
495
|
+
annotations: {
|
|
496
|
+
readOnlyHint: true,
|
|
497
|
+
openWorldHint: false,
|
|
498
|
+
destructiveHint: false,
|
|
499
|
+
},
|
|
417
500
|
},
|
|
418
501
|
{
|
|
419
502
|
name: "get_material_guide",
|
|
@@ -423,6 +506,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
423
506
|
properties: {},
|
|
424
507
|
required: [],
|
|
425
508
|
},
|
|
509
|
+
annotations: {
|
|
510
|
+
readOnlyHint: true,
|
|
511
|
+
openWorldHint: false,
|
|
512
|
+
destructiveHint: false,
|
|
513
|
+
},
|
|
426
514
|
},
|
|
427
515
|
{
|
|
428
516
|
name: "get_collision_guide",
|
|
@@ -432,6 +520,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
432
520
|
properties: {},
|
|
433
521
|
required: [],
|
|
434
522
|
},
|
|
523
|
+
annotations: {
|
|
524
|
+
readOnlyHint: true,
|
|
525
|
+
openWorldHint: false,
|
|
526
|
+
destructiveHint: false,
|
|
527
|
+
},
|
|
435
528
|
},
|
|
436
529
|
{
|
|
437
530
|
name: "get_model_optimization_guide",
|
|
@@ -441,6 +534,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
441
534
|
properties: {},
|
|
442
535
|
required: [],
|
|
443
536
|
},
|
|
537
|
+
annotations: {
|
|
538
|
+
readOnlyHint: true,
|
|
539
|
+
openWorldHint: false,
|
|
540
|
+
destructiveHint: false,
|
|
541
|
+
},
|
|
444
542
|
},
|
|
445
543
|
{
|
|
446
544
|
name: "get_web_rendering_guide",
|
|
@@ -450,6 +548,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
450
548
|
properties: {},
|
|
451
549
|
required: [],
|
|
452
550
|
},
|
|
551
|
+
annotations: {
|
|
552
|
+
readOnlyHint: true,
|
|
553
|
+
openWorldHint: false,
|
|
554
|
+
destructiveHint: false,
|
|
555
|
+
},
|
|
453
556
|
},
|
|
454
557
|
{
|
|
455
558
|
name: "search_models",
|
|
@@ -476,6 +579,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
476
579
|
},
|
|
477
580
|
required: ["query"],
|
|
478
581
|
},
|
|
582
|
+
annotations: {
|
|
583
|
+
readOnlyHint: true,
|
|
584
|
+
openWorldHint: true,
|
|
585
|
+
destructiveHint: false,
|
|
586
|
+
},
|
|
479
587
|
},
|
|
480
588
|
{
|
|
481
589
|
name: "analyze_project",
|
|
@@ -490,5 +598,10 @@ export const TOOL_DEFINITIONS = [
|
|
|
490
598
|
},
|
|
491
599
|
required: [],
|
|
492
600
|
},
|
|
601
|
+
annotations: {
|
|
602
|
+
readOnlyHint: true,
|
|
603
|
+
openWorldHint: true,
|
|
604
|
+
destructiveHint: false,
|
|
605
|
+
},
|
|
493
606
|
},
|
|
494
607
|
];
|
package/dist/tools/handler.js
CHANGED
|
@@ -37,67 +37,30 @@ import { analyzeProject, formatAnalysisReport } from "../analyze-project.js";
|
|
|
37
37
|
import { LLMS_TXT } from "../generated/llms-txt.js";
|
|
38
38
|
// ─── Legal disclaimer (identical to index.ts 4.0.0) ─────────────────────
|
|
39
39
|
const DISCLAIMER = "\n\n---\n*Generated code suggestion. Review before use in production. See [TERMS.md](https://github.com/sceneview/sceneview/blob/main/mcp/TERMS.md).*";
|
|
40
|
-
// ───
|
|
40
|
+
// ─── Sponsor CTA (shown every N tool calls, opt-out via env var) ────────────
|
|
41
41
|
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
// New strategy:
|
|
50
|
-
// - Fire EARLIER (call #3 — first nudge) so users actually see the pitch
|
|
51
|
-
// - Single CTA (no sponsor competition) pointing to /pricing
|
|
52
|
-
// - Tiered wording: tease → ask → final push, each more specific than the last
|
|
53
|
-
// - Same opt-out env var (`SCENEVIEW_SPONSOR_CTA=0`) for backwards compat,
|
|
54
|
-
// plus a new `SCENEVIEW_CTA=0` alias for clarity going forward
|
|
55
|
-
//
|
|
56
|
-
// The counter is module-scoped (per MCP process lifetime), not persisted.
|
|
57
|
-
const PRICING_URL = "https://sceneview-mcp.mcp-tools-lab.workers.dev/pricing";
|
|
58
|
-
const CTA_STAGES = [
|
|
59
|
-
{
|
|
60
|
-
at: 3,
|
|
61
|
-
message: `\n\n💎 *Tip: SceneView Pro unlocks \`generate_scene\` — describe an AR app in plain English, get working Kotlin/Swift in one shot. [Try it free for 7 days](${PRICING_URL}).*`,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
at: 10,
|
|
65
|
-
message: `\n\n🚀 *You've used 10 free SceneView tools. Ready to GENERATE a full AR app in one call? Pro unlocks 35+ tools (scene gen, multi-platform, vertical packages) for €19/mo — [start your free trial](${PRICING_URL}).*`,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
at: 25,
|
|
69
|
-
message: `\n\n⭐ *Heavy SceneView user — save €38 / year with the annual plan (€190/yr instead of €19×12). [Lock it in](${PRICING_URL}).*`,
|
|
70
|
-
},
|
|
71
|
-
];
|
|
72
|
-
/** After all explicit stages, recurring nudge cadence (call #25, #35, #45…). */
|
|
73
|
-
const POST_STAGE_INTERVAL = 10;
|
|
42
|
+
// Non-intrusive monetization: append a one-line sponsor call-to-action after
|
|
43
|
+
// every `SPONSOR_CTA_INTERVAL` tool calls. Disabled by setting
|
|
44
|
+
// `SCENEVIEW_SPONSOR_CTA=0`. The counter is module-scoped (per MCP process
|
|
45
|
+
// lifetime), not persisted.
|
|
46
|
+
const SPONSOR_CTA_INTERVAL = 10;
|
|
47
|
+
const SPONSOR_CTA = "\n\n💙 *Building SceneView is a one-dev labor of love. If it saved you time, consider [supporting on GitHub Sponsors](https://github.com/sponsors/sceneview).*";
|
|
74
48
|
let toolCallCount = 0;
|
|
75
49
|
/** Test-only: reset the module-scoped counter between test cases. */
|
|
76
50
|
export function __resetSponsorCounter() {
|
|
77
51
|
toolCallCount = 0;
|
|
78
52
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (process.env.SCENEVIEW_SPONSOR_CTA === "0" ||
|
|
83
|
-
process.env.SCENEVIEW_CTA === "0") {
|
|
84
|
-
return "";
|
|
85
|
-
}
|
|
53
|
+
function shouldShowSponsorCta() {
|
|
54
|
+
if (process.env.SCENEVIEW_SPONSOR_CTA === "0")
|
|
55
|
+
return false;
|
|
86
56
|
toolCallCount += 1;
|
|
87
|
-
|
|
88
|
-
if (stage)
|
|
89
|
-
return stage.message;
|
|
90
|
-
const last = CTA_STAGES[CTA_STAGES.length - 1];
|
|
91
|
-
if (toolCallCount > last.at && (toolCallCount - last.at) % POST_STAGE_INTERVAL === 0) {
|
|
92
|
-
return last.message;
|
|
93
|
-
}
|
|
94
|
-
return "";
|
|
57
|
+
return toolCallCount % SPONSOR_CTA_INTERVAL === 0;
|
|
95
58
|
}
|
|
96
59
|
function withDisclaimer(content) {
|
|
97
60
|
if (content.length === 0)
|
|
98
61
|
return content;
|
|
99
62
|
const last = content[content.length - 1];
|
|
100
|
-
const suffix = DISCLAIMER +
|
|
63
|
+
const suffix = DISCLAIMER + (shouldShowSponsorCta() ? SPONSOR_CTA : "");
|
|
101
64
|
return [
|
|
102
65
|
...content.slice(0, -1),
|
|
103
66
|
{ ...last, text: last.text + suffix },
|
|
@@ -128,55 +91,6 @@ const NODE_SECTIONS = parseNodeSections(API_DOCS);
|
|
|
128
91
|
*/
|
|
129
92
|
export async function dispatchTool(toolName, args, _ctx = {}) {
|
|
130
93
|
switch (toolName) {
|
|
131
|
-
// ── get_started ───────────────────────────────────────────────────────────
|
|
132
|
-
// Activation entry point — see definition in `definitions.ts` for context.
|
|
133
|
-
// Pure markdown response, no I/O, deliberately concise so the host AI can
|
|
134
|
-
// forward the bullets straight into chat without summarising.
|
|
135
|
-
case "get_started": {
|
|
136
|
-
const platformArg = args?.platform ?? "any";
|
|
137
|
-
const platform = platformArg === "android" || platformArg === "ios" || platformArg === "web"
|
|
138
|
-
? platformArg
|
|
139
|
-
: "any";
|
|
140
|
-
const installSnippets = {
|
|
141
|
-
android: "**Android (Jetpack Compose + Filament):**\n```kotlin\n// app/build.gradle.kts\nimplementation(\"io.github.sceneview:sceneview:4.0.1\") // 3D only\nimplementation(\"io.github.sceneview:arsceneview:4.0.1\") // AR\n```",
|
|
142
|
-
ios: "**iOS / macOS / visionOS (SwiftUI + RealityKit):**\n```swift\n// Package.swift\n.package(url: \"https://github.com/sceneview/SceneViewSwift\", from: \"4.0.1\")\n```",
|
|
143
|
-
web: "**Web (Filament.js + WebXR):**\n```bash\nnpm install sceneview-web@4.0.1\n```",
|
|
144
|
-
any: "**Pick your platform** (call `get_started` again with `platform`):\n- `android` — Jetpack Compose + Filament\n- `ios` — SwiftUI + RealityKit (iOS / macOS / visionOS)\n- `web` — Filament.js + WebXR",
|
|
145
|
-
};
|
|
146
|
-
const promptIdeas = [
|
|
147
|
-
"💬 *\"Show me a working AR sample I can run today.\"* → I'll call `get_sample` with an AR scenario.",
|
|
148
|
-
"💬 *\"Generate a 3D scene with a rotating model and ambient light.\"* → triggers `generate_scene` (Pro).",
|
|
149
|
-
"💬 *\"Validate this Kotlin SceneView snippet.\"* → triggers `validate_code`.",
|
|
150
|
-
];
|
|
151
|
-
const text = [
|
|
152
|
-
"# 🎬 SceneView MCP — quick start",
|
|
153
|
-
"",
|
|
154
|
-
"**SceneView** = native 3D & AR for **Android** (Compose + Filament), **iOS / macOS / visionOS** (SwiftUI + RealityKit) and **Web** (Filament.js + WebXR).",
|
|
155
|
-
"",
|
|
156
|
-
"## Try one of these prompts now",
|
|
157
|
-
...promptIdeas.map((p) => `- ${p}`),
|
|
158
|
-
"",
|
|
159
|
-
"## Install snippet",
|
|
160
|
-
installSnippets[platform],
|
|
161
|
-
"",
|
|
162
|
-
"## Useful next tools",
|
|
163
|
-
"- `list_samples` — see all 33 ready-to-paste examples",
|
|
164
|
-
"- `get_node_reference` — full API for a specific composable / node",
|
|
165
|
-
"- `validate_code` — catch threading / API mistakes before you ship",
|
|
166
|
-
"- `analyze_project` — inspect an existing project for SceneView readiness",
|
|
167
|
-
"",
|
|
168
|
-
"## Pro tools (€19/mo · [free trial](https://sceneview-mcp.mcp-tools-lab.workers.dev/pricing))",
|
|
169
|
-
"Unlocks `generate_scene`, `create_3d_artifact`, `render_3d_preview`, multi-platform setup, and the four vertical packages (Automotive · Gaming · Healthcare · Interior).",
|
|
170
|
-
"",
|
|
171
|
-
"## Resources",
|
|
172
|
-
"- 🌐 Playground: <https://sceneview.github.io>",
|
|
173
|
-
"- 📚 Full API: read the `sceneview://api` MCP resource",
|
|
174
|
-
"- 🐛 Issues: <https://github.com/sceneview/sceneview/issues>",
|
|
175
|
-
].join("\n");
|
|
176
|
-
return {
|
|
177
|
-
content: [{ type: "text", text }],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
94
|
// ── get_sample ────────────────────────────────────────────────────────────
|
|
181
95
|
case "get_sample": {
|
|
182
96
|
const scenario = args?.scenario;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sceneview-mcp",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"mcpName": "io.github.sceneview/mcp",
|
|
5
5
|
"description": "MCP server for SceneView — cross-platform 3D & AR SDK for Android and iOS. Give Claude the full SceneView SDK so it writes correct, compilable code.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@types/node": "^25.5.0",
|
|
65
65
|
"tsx": "^4.0.0",
|
|
66
66
|
"typescript": "^6.0.2",
|
|
67
|
-
"vitest": "^4.1.
|
|
67
|
+
"vitest": "^4.1.5"
|
|
68
68
|
},
|
|
69
69
|
"overrides": {
|
|
70
70
|
"picomatch": ">=4.0.4"
|