sceneview-mcp 4.0.15 → 4.1.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 +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 +1048 -28
- package/dist/generated/version.js +15 -2
- 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 +150 -57
- 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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sceneview-mcp",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"mcpName": "io.github.sceneview/mcp",
|
|
5
|
-
"description": "MCP server for SceneView — cross-platform 3D & AR SDK for Android and iOS.
|
|
5
|
+
"description": "MCP server for SceneView — cross-platform 3D & AR SDK for Android and iOS. Gives your AI coding assistant the full SceneView SDK so it writes correct, compilable code.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"model-context-protocol",
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
"jetpack-compose",
|
|
19
19
|
"swiftui",
|
|
20
20
|
"kotlin-multiplatform",
|
|
21
|
-
"
|
|
22
|
-
"ai"
|
|
21
|
+
"ai",
|
|
22
|
+
"ai-coding-assistant",
|
|
23
|
+
"llm"
|
|
23
24
|
],
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"author": "SceneView (https://github.com/sceneview)",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"dist/**/*.js",
|
|
45
46
|
"!dist/**/*.test.js",
|
|
46
47
|
"!dist/**/__fixtures__/**",
|
|
48
|
+
"!dist/worker.js",
|
|
47
49
|
"!dist/auth.js",
|
|
48
50
|
"!dist/billing.js",
|
|
49
51
|
"!dist/convert-platform.js",
|
|
@@ -65,18 +67,20 @@
|
|
|
65
67
|
"start": "node dist/index.js",
|
|
66
68
|
"dev": "tsx src/index.ts",
|
|
67
69
|
"test": "node scripts/generate-llms-txt.js && node scripts/generate-version.js && node scripts/generate-symbols.js && vitest run",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
+
"lint": "cd .. && mcp/node_modules/.bin/biome check mcp/src mcp/scripts",
|
|
71
|
+
"lint:fix": "cd .. && mcp/node_modules/.bin/biome check --write mcp/src mcp/scripts",
|
|
72
|
+
"deploy": "npm run build && wrangler deploy"
|
|
70
73
|
},
|
|
71
74
|
"dependencies": {
|
|
72
75
|
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
73
76
|
},
|
|
74
77
|
"devDependencies": {
|
|
75
|
-
"@biomejs/biome": "^2.
|
|
76
|
-
"@types/node": "^26.
|
|
78
|
+
"@biomejs/biome": "^2.5.14",
|
|
79
|
+
"@types/node": "^26.6.2",
|
|
77
80
|
"tsx": "^4.0.0",
|
|
78
81
|
"typescript": "^7.0.2",
|
|
79
|
-
"vitest": "^
|
|
82
|
+
"vitest": "^5.0.1",
|
|
83
|
+
"wrangler": "^4.136.2"
|
|
80
84
|
},
|
|
81
85
|
"overrides": {
|
|
82
86
|
"picomatch": ">=4.0.4",
|
|
@@ -85,11 +89,11 @@
|
|
|
85
89
|
},
|
|
86
90
|
"funding": [
|
|
87
91
|
{
|
|
88
|
-
"type": "
|
|
89
|
-
"url": "https://
|
|
92
|
+
"type": "opencollective",
|
|
93
|
+
"url": "https://opencollective.com/sceneview"
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
|
-
"type": "
|
|
96
|
+
"type": "github",
|
|
93
97
|
"url": "https://github.com/sponsors/sceneview"
|
|
94
98
|
}
|
|
95
99
|
]
|
package/dist/proxy.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proxy helper for the v4 "lite" npm package.
|
|
3
|
-
*
|
|
4
|
-
* In v4 the stdio package keeps serving free-tier tools locally (no
|
|
5
|
-
* network round-trip), but Pro-tier tools are forwarded as JSON-RPC
|
|
6
|
-
* `tools/call` requests to the hosted gateway. This keeps the install
|
|
7
|
-
* footprint small for free users while letting paying customers hit a
|
|
8
|
-
* metered, auth'd backend.
|
|
9
|
-
*
|
|
10
|
-
* The gateway lives at
|
|
11
|
-
* https://sceneview-mcp.mcp-tools-lab.workers.dev/mcp
|
|
12
|
-
* (Cloudflare Workers, post-Stripe-first pivot). Override with
|
|
13
|
-
* `SCENEVIEW_MCP_URL` if you run a self-hosted fork or the staging
|
|
14
|
-
* worker.
|
|
15
|
-
*
|
|
16
|
-
* This module is intentionally dependency-free: it relies on the
|
|
17
|
-
* global `fetch` that Node 18+ exposes and on nothing else from the
|
|
18
|
-
* package.
|
|
19
|
-
*/
|
|
20
|
-
/** Default URL of the hosted gateway (post-Stripe-first, Apr 2026). */
|
|
21
|
-
export const DEFAULT_GATEWAY_URL = "https://sceneview-mcp.mcp-tools-lab.workers.dev/mcp";
|
|
22
|
-
/** Public pricing/signup page shown in stubs when no API key is set. */
|
|
23
|
-
export const DEFAULT_PRICING_URL = "https://sceneview-mcp.mcp-tools-lab.workers.dev/pricing";
|
|
24
|
-
// Minimal JSON-RPC 2.0 request id, auto-incremented per process.
|
|
25
|
-
let nextRpcId = 1;
|
|
26
|
-
/**
|
|
27
|
-
* Forwards a Pro-tier tool call to the hosted gateway and returns its
|
|
28
|
-
* `ToolResult`. Network, HTTP, and JSON-RPC errors are converted into
|
|
29
|
-
* a user-visible error block so the MCP client surfaces them in Claude.
|
|
30
|
-
*
|
|
31
|
-
* When no API key is configured at all, returns a helpful stub that
|
|
32
|
-
* points at the pricing page instead of trying to call the gateway.
|
|
33
|
-
* The stub is the user's first touch point with the Pro upsell — it
|
|
34
|
-
* shows up verbatim in the Claude UI.
|
|
35
|
-
*/
|
|
36
|
-
export async function dispatchProxyToolCall(toolName, args, options = {}) {
|
|
37
|
-
const apiKey = options.apiKey ?? process.env.SCENEVIEW_API_KEY;
|
|
38
|
-
if (!apiKey) {
|
|
39
|
-
return {
|
|
40
|
-
content: [
|
|
41
|
-
{
|
|
42
|
-
type: "text",
|
|
43
|
-
text: `## 🔒 Pro feature\n\n` +
|
|
44
|
-
`\`${toolName}\` is a SceneView MCP Pro tool. ` +
|
|
45
|
-
`Set \`SCENEVIEW_API_KEY\` to an API key from ` +
|
|
46
|
-
`${DEFAULT_PRICING_URL} to unlock it.\n\n` +
|
|
47
|
-
`Pro unlocks 27 specialized tools: 3D preview / artifact / scene ` +
|
|
48
|
-
`generation, plus the Automotive / Gaming / Healthcare / Interior ` +
|
|
49
|
-
`packages. All setup, migration, and reference guides are free.`,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
isError: true,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const gatewayUrl = options.gatewayUrl ??
|
|
56
|
-
process.env.SCENEVIEW_MCP_URL ??
|
|
57
|
-
DEFAULT_GATEWAY_URL;
|
|
58
|
-
const fetchImpl = options.fetchImpl ?? fetch;
|
|
59
|
-
const requestBody = {
|
|
60
|
-
jsonrpc: "2.0",
|
|
61
|
-
id: nextRpcId++,
|
|
62
|
-
method: "tools/call",
|
|
63
|
-
params: { name: toolName, arguments: args ?? {} },
|
|
64
|
-
};
|
|
65
|
-
let response;
|
|
66
|
-
try {
|
|
67
|
-
response = await fetchImpl(gatewayUrl, {
|
|
68
|
-
method: "POST",
|
|
69
|
-
headers: {
|
|
70
|
-
authorization: `Bearer ${apiKey}`,
|
|
71
|
-
"content-type": "application/json",
|
|
72
|
-
accept: "application/json",
|
|
73
|
-
},
|
|
74
|
-
body: JSON.stringify(requestBody),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
79
|
-
return {
|
|
80
|
-
content: [
|
|
81
|
-
{
|
|
82
|
-
type: "text",
|
|
83
|
-
text: `Failed to reach SceneView MCP gateway (${gatewayUrl}): ${detail}.\n\n` +
|
|
84
|
-
`The gateway may be temporarily down. Try again in a few seconds, ` +
|
|
85
|
-
`or check status at ${DEFAULT_PRICING_URL}.`,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
isError: true,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const text = await response.text().catch(() => "");
|
|
92
|
-
if (response.status === 401 || response.status === 403) {
|
|
93
|
-
return {
|
|
94
|
-
content: [
|
|
95
|
-
{
|
|
96
|
-
type: "text",
|
|
97
|
-
text: `## 🔑 Invalid or expired API key\n\n` +
|
|
98
|
-
`The gateway rejected your \`SCENEVIEW_API_KEY\` (HTTP ${response.status}).\n\n` +
|
|
99
|
-
`- If you just subscribed, make sure you copied the full key from ` +
|
|
100
|
-
`the Stripe success page.\n` +
|
|
101
|
-
`- If your subscription was cancelled, reactivate it at ${DEFAULT_PRICING_URL}.\n\n` +
|
|
102
|
-
(text ? `Gateway response: ${text}` : ""),
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
isError: true,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
if (response.status === 429) {
|
|
109
|
-
return {
|
|
110
|
-
content: [
|
|
111
|
-
{
|
|
112
|
-
type: "text",
|
|
113
|
-
text: `## ⏳ Rate limited\n\n` +
|
|
114
|
-
`You've hit the rate limit for \`${toolName}\` (HTTP 429). ` +
|
|
115
|
-
`Wait a few seconds and retry, or upgrade your tier at ` +
|
|
116
|
-
`${DEFAULT_PRICING_URL}.\n\n` +
|
|
117
|
-
(text ? `Gateway response: ${text}` : ""),
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
isError: true,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
if (!response.ok) {
|
|
124
|
-
return {
|
|
125
|
-
content: [
|
|
126
|
-
{
|
|
127
|
-
type: "text",
|
|
128
|
-
text: `Gateway HTTP ${response.status} while calling ${toolName}. ` +
|
|
129
|
-
(text || "No response body."),
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
isError: true,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
let parsed;
|
|
136
|
-
try {
|
|
137
|
-
parsed = JSON.parse(text);
|
|
138
|
-
}
|
|
139
|
-
catch {
|
|
140
|
-
return {
|
|
141
|
-
content: [
|
|
142
|
-
{
|
|
143
|
-
type: "text",
|
|
144
|
-
text: `Gateway returned non-JSON response: ${text}`,
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
isError: true,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
if (parsed.error) {
|
|
151
|
-
return {
|
|
152
|
-
content: [
|
|
153
|
-
{
|
|
154
|
-
type: "text",
|
|
155
|
-
text: parsed.error.message ??
|
|
156
|
-
`Gateway error while calling ${toolName}.`,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
isError: true,
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
const result = parsed.result;
|
|
163
|
-
return {
|
|
164
|
-
content: result?.content ?? [{ type: "text", text: "" }],
|
|
165
|
-
isError: result?.isError ?? false,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Returns true when proxy mode is active: an API key is configured
|
|
170
|
-
* (either via `SCENEVIEW_API_KEY` env var or an explicit override).
|
|
171
|
-
*/
|
|
172
|
-
export function isProxyConfigured(apiKey) {
|
|
173
|
-
if (apiKey && apiKey.length > 0)
|
|
174
|
-
return true;
|
|
175
|
-
return !!process.env.SCENEVIEW_API_KEY;
|
|
176
|
-
}
|
package/dist/tiers.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// ─── Tool tier system ─────────────────────────────────────────────────────────
|
|
2
|
-
//
|
|
3
|
-
// Defines free vs pro tool access for SceneView MCP.
|
|
4
|
-
// ─── Free tools ──────────────────────────────────────────────────────────────
|
|
5
|
-
//
|
|
6
|
-
// 4.0.5: setup guides + cross-platform docs moved from Pro to Free. Rationale:
|
|
7
|
-
// these are the entry-point tools any developer hits when integrating
|
|
8
|
-
// SceneView. Gating them behind a paywall was killing adoption (see
|
|
9
|
-
// `.claude/plans/strategic-pivot-april-2026.md`). Pro is now reserved for
|
|
10
|
-
// the 4 vertical packages (Automotive / Gaming / Healthcare / Interior) and
|
|
11
|
-
// the 3 generation tools (preview, artifact, scene generation).
|
|
12
|
-
const FREE_TOOLS = [
|
|
13
|
-
// Gateway-only widget tool. It is defined in
|
|
14
|
-
// `mcp-gateway/src/mcp/widget-tools.ts`, NOT in this package's
|
|
15
|
-
// TOOL_DEFINITIONS — the stdio server never lists or serves it. The entry
|
|
16
|
-
// here is load-bearing anyway: the gateway's tier gate
|
|
17
|
-
// (`mcp-gateway/src/mcp/access.ts`) resolves tiers through this map and
|
|
18
|
-
// unknown tools default to "pro", so removing this line would silently
|
|
19
|
-
// paywall the anonymous ChatGPT 3D-viewer widget.
|
|
20
|
-
"view_3d_model",
|
|
21
|
-
"list_samples",
|
|
22
|
-
"get_sample",
|
|
23
|
-
"get_setup",
|
|
24
|
-
"get_node_reference",
|
|
25
|
-
"list_platforms",
|
|
26
|
-
"validate_code",
|
|
27
|
-
"get_troubleshooting",
|
|
28
|
-
"debug_issue",
|
|
29
|
-
"get_best_practices",
|
|
30
|
-
"get_animation_guide",
|
|
31
|
-
"get_gesture_guide",
|
|
32
|
-
"get_performance_tips",
|
|
33
|
-
"get_material_guide",
|
|
34
|
-
"get_collision_guide",
|
|
35
|
-
"get_platform_roadmap",
|
|
36
|
-
"search_models",
|
|
37
|
-
"generate_3d_model",
|
|
38
|
-
"analyze_project",
|
|
39
|
-
"search_android_docs",
|
|
40
|
-
"fetch_android_doc",
|
|
41
|
-
// Setup guides (moved from Pro in 4.0.5)
|
|
42
|
-
"get_ios_setup",
|
|
43
|
-
"get_web_setup",
|
|
44
|
-
"get_ar_setup",
|
|
45
|
-
"get_platform_setup",
|
|
46
|
-
// Migration tools (moved from Pro in 4.0.5)
|
|
47
|
-
"migrate_code",
|
|
48
|
-
"get_migration_guide",
|
|
49
|
-
// Static docs guides (moved from Pro in 4.0.5)
|
|
50
|
-
"get_model_optimization_guide",
|
|
51
|
-
"get_web_rendering_guide",
|
|
52
|
-
];
|
|
53
|
-
// ─── Pro tools ────────────────────────────────────────────────────────────────
|
|
54
|
-
const PRO_TOOLS = [
|
|
55
|
-
// Generation tools (heavier, may involve external infra)
|
|
56
|
-
"render_3d_preview",
|
|
57
|
-
"create_3d_artifact",
|
|
58
|
-
"generate_scene",
|
|
59
|
-
// Automotive package
|
|
60
|
-
"get_car_configurator",
|
|
61
|
-
"get_dashboard_3d",
|
|
62
|
-
"get_parts_catalog",
|
|
63
|
-
"get_hud_overlay",
|
|
64
|
-
"get_ar_showroom",
|
|
65
|
-
"list_car_models",
|
|
66
|
-
"get_ev_charging_station_viewer",
|
|
67
|
-
"get_car_paint_shader",
|
|
68
|
-
"validate_automotive_code",
|
|
69
|
-
// Gaming package
|
|
70
|
-
"get_physics_game",
|
|
71
|
-
"get_particle_effects",
|
|
72
|
-
"get_level_editor",
|
|
73
|
-
"get_inventory_3d",
|
|
74
|
-
"get_character_viewer",
|
|
75
|
-
"list_game_models",
|
|
76
|
-
"validate_game_code",
|
|
77
|
-
// Healthcare package
|
|
78
|
-
"get_surgical_planning",
|
|
79
|
-
"get_dental_viewer",
|
|
80
|
-
"get_medical_imaging",
|
|
81
|
-
"get_anatomy_viewer",
|
|
82
|
-
"get_molecule_viewer",
|
|
83
|
-
"list_medical_models",
|
|
84
|
-
"validate_medical_code",
|
|
85
|
-
// Interior package
|
|
86
|
-
"get_room_planner",
|
|
87
|
-
"get_lighting_design",
|
|
88
|
-
"get_room_tour",
|
|
89
|
-
"get_material_switcher",
|
|
90
|
-
"get_furniture_placement",
|
|
91
|
-
"list_furniture_models",
|
|
92
|
-
"validate_interior_code",
|
|
93
|
-
// Rerun package (Pro per its README — "All 5 rerun tools are Pro tier").
|
|
94
|
-
// Until #2697 these five (and the six package additions above) rode the
|
|
95
|
-
// unknown-tool default-to-pro fallback; behaviour is unchanged, the map
|
|
96
|
-
// is just explicit now so a forgotten mapping is distinguishable from a
|
|
97
|
-
// deliberate Pro tool.
|
|
98
|
-
"setup_rerun_project",
|
|
99
|
-
"generate_ar_logger",
|
|
100
|
-
"generate_python_sidecar",
|
|
101
|
-
"embed_web_viewer",
|
|
102
|
-
"explain_concept",
|
|
103
|
-
];
|
|
104
|
-
// ─── Tier map ─────────────────────────────────────────────────────────────────
|
|
105
|
-
export const TOOL_TIERS = Object.fromEntries([
|
|
106
|
-
...FREE_TOOLS.map((name) => [name, "free"]),
|
|
107
|
-
...PRO_TOOLS.map((name) => [name, "pro"]),
|
|
108
|
-
]);
|
|
109
|
-
// ─── Helper functions ─────────────────────────────────────────────────────────
|
|
110
|
-
/** Returns true if the tool requires a Pro subscription. Unknown tools default to pro. */
|
|
111
|
-
export function isProTool(toolName) {
|
|
112
|
-
return getToolTier(toolName) === "pro";
|
|
113
|
-
}
|
|
114
|
-
/** Returns the tier for a tool. Defaults to "pro" for unknown tools. */
|
|
115
|
-
export function getToolTier(toolName) {
|
|
116
|
-
return TOOL_TIERS[toolName] ?? "pro";
|
|
117
|
-
}
|
|
118
|
-
/** Returns all pro tool names. */
|
|
119
|
-
export function getProToolNames() {
|
|
120
|
-
return [...PRO_TOOLS];
|
|
121
|
-
}
|
|
122
|
-
/** Returns all free tool names. */
|
|
123
|
-
export function getFreeToolNames() {
|
|
124
|
-
return [...FREE_TOOLS];
|
|
125
|
-
}
|
|
126
|
-
// ─── Upgrade message ──────────────────────────────────────────────────────────
|
|
127
|
-
export const PRO_UPGRADE_MESSAGE = `## \u{1F512} Pro Feature
|
|
128
|
-
|
|
129
|
-
This tool is part of a specialized package (Automotive / Gaming / Healthcare / Interior / Rerun) or a heavier generation tool. SceneView MCP Pro unlocks them.
|
|
130
|
-
|
|
131
|
-
**Upgrade for \u20AC19/month** to unlock:
|
|
132
|
-
- 5 vertical packages (Automotive, Gaming, Healthcare, Interior, Rerun — 35 specialized tools)
|
|
133
|
-
- 3D preview, artifact, and scene-generation helpers
|
|
134
|
-
|
|
135
|
-
All setup, migration, and reference guides remain free.
|
|
136
|
-
|
|
137
|
-
\u2192 Subscribe at https://sceneview-mcp.mcp-tools-lab.workers.dev/pricing
|
|
138
|
-
\u2192 Then set your API key: \`SCENEVIEW_API_KEY=your_key\``;
|