sceneview-mcp 3.0.0 → 3.0.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 +64 -107
- package/dist/index.js +1 -1
- package/dist/samples.js +55 -0
- package/package.json +28 -3
package/README.md
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
# sceneview-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/sceneview-mcp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
MCP server for [SceneView](https://github.com/SceneView/sceneview-android) — 3D and AR as Jetpack Compose composables for Android.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## What it provides
|
|
10
|
-
|
|
11
|
-
**Resource — `sceneview://api`**
|
|
12
|
-
The complete SceneView 3.0.0 API reference (llms.txt): composable signatures, node types, AR scope, resource loading, threading rules, common patterns.
|
|
13
|
-
|
|
14
|
-
**Tool — `get_sample`**
|
|
15
|
-
|
|
16
|
-
| Scenario | What you get |
|
|
17
|
-
|---|---|
|
|
18
|
-
| `model-viewer` | Full-screen 3D scene, HDR environment, orbit camera |
|
|
19
|
-
| `ar-tap-to-place` | AR tap-to-place with pinch-to-scale and drag-to-rotate |
|
|
20
|
-
| `ar-placement-cursor` | AR reticle that snaps to surfaces, tap to confirm |
|
|
21
|
-
| `ar-augmented-image` | Detect a reference image, overlay a 3D model |
|
|
22
|
-
| `ar-face-filter` | Front-camera face mesh with a custom material |
|
|
23
|
-
|
|
24
|
-
**Tool — `get_setup`**
|
|
25
|
-
Gradle dependency + AndroidManifest for `"3d"` or `"ar"` projects.
|
|
8
|
+
Add this to Claude and it **always knows how to use SceneView**. No copy-pasting docs. No hallucinated APIs. Correct, compilable Kotlin — first try.
|
|
26
9
|
|
|
27
10
|
---
|
|
28
11
|
|
|
29
|
-
##
|
|
12
|
+
## Quick start
|
|
30
13
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Add `.claude/mcp.json` at your Android project root:
|
|
14
|
+
Add to your Claude config and you're done:
|
|
34
15
|
|
|
35
16
|
```json
|
|
36
17
|
{
|
|
@@ -43,112 +24,80 @@ Add `.claude/mcp.json` at your Android project root:
|
|
|
43
24
|
}
|
|
44
25
|
```
|
|
45
26
|
|
|
46
|
-
|
|
27
|
+
<details>
|
|
28
|
+
<summary>Where does this go?</summary>
|
|
47
29
|
|
|
48
|
-
|
|
30
|
+
| Client | Config file |
|
|
31
|
+
|---|---|
|
|
32
|
+
| **Claude Code** (project) | `.claude/mcp.json` at project root |
|
|
33
|
+
| **Claude Code** (global) | `~/.claude/mcp.json` |
|
|
34
|
+
| **Claude Desktop** | `claude_desktop_config.json` |
|
|
49
35
|
|
|
50
|
-
|
|
36
|
+
After saving, run `/mcp` in Claude Code or restart Claude Desktop to pick it up.
|
|
37
|
+
</details>
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
"mcpServers": {
|
|
55
|
-
"sceneview": {
|
|
56
|
-
"command": "npx",
|
|
57
|
-
"args": ["-y", "sceneview-mcp"]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
39
|
+
---
|
|
62
40
|
|
|
63
|
-
|
|
41
|
+
## What Claude gets
|
|
64
42
|
|
|
65
|
-
|
|
43
|
+
### Resource — `sceneview://api`
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
45
|
+
The complete SceneView 3.0.0 API reference (`llms.txt`): composable signatures, node types, AR scope, resource loading, threading rules, and common patterns.
|
|
46
|
+
|
|
47
|
+
### Tool — `get_sample(scenario)`
|
|
48
|
+
|
|
49
|
+
Returns a complete, compilable Kotlin sample.
|
|
50
|
+
|
|
51
|
+
| Scenario | What you get |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `model-viewer` | Full-screen 3D scene, HDR environment, orbit camera |
|
|
54
|
+
| `ar-tap-to-place` | AR tap-to-place with pinch-to-scale and drag-to-rotate |
|
|
55
|
+
| `ar-placement-cursor` | AR reticle that snaps to surfaces, tap to confirm |
|
|
56
|
+
| `ar-augmented-image` | Detect a reference image, overlay a 3D model |
|
|
57
|
+
| `ar-face-filter` | Front-camera face mesh with a custom material |
|
|
58
|
+
|
|
59
|
+
### Tool — `get_setup(type)`
|
|
60
|
+
|
|
61
|
+
Returns Gradle dependencies + AndroidManifest for `"3d"` or `"ar"` projects.
|
|
77
62
|
|
|
78
63
|
---
|
|
79
64
|
|
|
80
65
|
## How it works
|
|
81
66
|
|
|
82
67
|
```
|
|
83
|
-
|
|
68
|
+
You: "Add AR placement to my app"
|
|
84
69
|
│
|
|
85
|
-
|
|
86
|
-
Claude reads sceneview://api ← full llms.txt, always current
|
|
70
|
+
Claude: reads sceneview://api ← full API ref, always current
|
|
87
71
|
│
|
|
88
|
-
|
|
89
|
-
Claude calls get_sample("ar-tap-to-place") ← working Kotlin boilerplate
|
|
72
|
+
Claude: calls get_sample("ar-tap-to-place") ← working Kotlin
|
|
90
73
|
│
|
|
91
|
-
|
|
92
|
-
Correct, compilable SceneView 3.0.0 code — first try, zero hallucination
|
|
74
|
+
Result: Correct, compilable SceneView 3.0.0 code
|
|
93
75
|
```
|
|
94
76
|
|
|
95
77
|
---
|
|
96
78
|
|
|
97
|
-
##
|
|
79
|
+
## Try it — sample prompts
|
|
98
80
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Create an Android Compose screen called ModelViewerScreen that loads
|
|
102
|
-
assets/models/my_model.glb in a full-screen 3D scene with orbit camera and HDR
|
|
103
|
-
environment from assets/environments/sky_2k.hdr.
|
|
104
|
-
Use SceneView io.github.sceneview:sceneview:3.0.0.
|
|
105
|
-
```
|
|
81
|
+
**3D model viewer**
|
|
82
|
+
> Create a Compose screen that loads `models/helmet.glb` in a full-screen 3D scene with orbit camera and HDR environment. Use SceneView 3.0.0.
|
|
106
83
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
Create an Android Compose AR screen called TapToPlaceScreen. Show a plane
|
|
110
|
-
detection grid. Tapping places assets/models/chair.glb on the surface with
|
|
111
|
-
pinch-to-scale and drag-to-rotate. Multiple taps = multiple objects.
|
|
112
|
-
Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
113
|
-
```
|
|
84
|
+
**AR tap-to-place**
|
|
85
|
+
> Create an AR Compose screen. Tapping a detected surface places `models/chair.glb` with pinch-to-scale and drag-to-rotate. Multiple taps = multiple objects.
|
|
114
86
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Create an AR screen called ARCursorScreen with a reticle that snaps to surfaces
|
|
118
|
-
at screen center. Tap to place assets/models/object.glb and hide the reticle.
|
|
119
|
-
Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
120
|
-
```
|
|
87
|
+
**AR placement cursor**
|
|
88
|
+
> Create an AR screen with a reticle that snaps to surfaces at screen center. Tap to place `models/object.glb` and hide the reticle.
|
|
121
89
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Create an AR screen called AugmentedImageScreen that detects R.drawable.target_image
|
|
125
|
-
(15 cm wide) and places assets/models/overlay.glb above it scaled to image width.
|
|
126
|
-
Model disappears when tracking is lost.
|
|
127
|
-
Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
128
|
-
```
|
|
90
|
+
**AR augmented image**
|
|
91
|
+
> Create an AR screen that detects `R.drawable.target_image` (15 cm) and places `models/overlay.glb` above it, scaled to match.
|
|
129
92
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
Create an AR screen called FaceFilterScreen using the front camera that detects
|
|
133
|
-
faces and applies assets/materials/face_mask.filamat to the face mesh.
|
|
134
|
-
Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
135
|
-
```
|
|
93
|
+
**AR face filter**
|
|
94
|
+
> Create an AR screen using the front camera that detects faces and applies `materials/face_mask.filamat` to the mesh.
|
|
136
95
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Create a 3D product configurator screen with Red/Blue/Green color buttons.
|
|
140
|
-
Apply the selected color as a solid material on assets/models/product.glb.
|
|
141
|
-
Add orbit camera and pinch-to-zoom.
|
|
142
|
-
Use SceneView io.github.sceneview:sceneview:3.0.0.
|
|
143
|
-
```
|
|
96
|
+
**Product configurator**
|
|
97
|
+
> Create a 3D product configurator with Red/Blue/Green buttons. Apply the color as a material on `models/product.glb`. Add orbit camera and pinch-to-zoom.
|
|
144
98
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Create an AR screen where a bottom sheet lets users choose between chair, table,
|
|
148
|
-
and lamp GLBs in assets/models/. Tapping places the selected model. Each object
|
|
149
|
-
is independently pinch-to-scale and drag-to-rotate. A "Clear all" button removes
|
|
150
|
-
everything. Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
151
|
-
```
|
|
99
|
+
**AR multi-object scene**
|
|
100
|
+
> Create an AR screen where a bottom sheet lets users pick between chair, table, and lamp GLBs. Tap to place. Each object gets pinch-to-scale and drag-to-rotate.
|
|
152
101
|
|
|
153
102
|
---
|
|
154
103
|
|
|
@@ -157,9 +106,9 @@ everything. Use SceneView io.github.sceneview:arsceneview:3.0.0.
|
|
|
157
106
|
```bash
|
|
158
107
|
cd mcp
|
|
159
108
|
npm install
|
|
160
|
-
npm run prepare # copies
|
|
109
|
+
npm run prepare # copies llms.txt + compiles TypeScript
|
|
161
110
|
npm start # run over stdio
|
|
162
|
-
npx @modelcontextprotocol/inspector node dist/index.js
|
|
111
|
+
npx @modelcontextprotocol/inspector node dist/index.js # test in MCP inspector
|
|
163
112
|
```
|
|
164
113
|
|
|
165
114
|
## Publishing
|
|
@@ -169,3 +118,11 @@ cd mcp
|
|
|
169
118
|
npm run prepare
|
|
170
119
|
npm publish --access public
|
|
171
120
|
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Links
|
|
125
|
+
|
|
126
|
+
- **SDK**: [github.com/SceneView/sceneview-android](https://github.com/SceneView/sceneview-android)
|
|
127
|
+
- **npm**: [npmjs.com/package/sceneview-mcp](https://www.npmjs.com/package/sceneview-mcp)
|
|
128
|
+
- **MCP spec**: [modelcontextprotocol.io](https://modelcontextprotocol.io)
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ try {
|
|
|
14
14
|
catch {
|
|
15
15
|
API_DOCS = "SceneView API docs not found. Run `npm run prepare` to bundle llms.txt.";
|
|
16
16
|
}
|
|
17
|
-
const server = new Server({ name: "@sceneview/mcp", version: "3.0.
|
|
17
|
+
const server = new Server({ name: "@sceneview/mcp", version: "3.0.1" }, { capabilities: { resources: {}, tools: {} } });
|
|
18
18
|
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
19
19
|
resources: [
|
|
20
20
|
{
|
package/dist/samples.js
CHANGED
|
@@ -30,6 +30,61 @@ fun ModelViewerScreen() {
|
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
}`,
|
|
34
|
+
},
|
|
35
|
+
"geometry-scene": {
|
|
36
|
+
id: "geometry-scene",
|
|
37
|
+
title: "3D Geometry Scene",
|
|
38
|
+
description: "Procedural 3D scene using primitive geometry nodes (cube, sphere, plane) — no GLB required",
|
|
39
|
+
dependency: "io.github.sceneview:sceneview:3.0.0",
|
|
40
|
+
prompt: "Create an Android Compose screen called `GeometrySceneScreen` that renders a full-screen 3D scene with a red rotating cube, a metallic blue sphere, and a green floor plane. No model files — use SceneView built-in geometry nodes. Orbit camera. Use SceneView `io.github.sceneview:sceneview:3.0.0`.",
|
|
41
|
+
code: `@Composable
|
|
42
|
+
fun GeometrySceneScreen() {
|
|
43
|
+
val engine = rememberEngine()
|
|
44
|
+
val materialLoader = rememberMaterialLoader(engine)
|
|
45
|
+
val t = rememberInfiniteTransition(label = "spin")
|
|
46
|
+
val angle by t.animateFloat(
|
|
47
|
+
initialValue = 0f, targetValue = 360f,
|
|
48
|
+
animationSpec = infiniteRepeatable(tween(4_000, easing = LinearEasing)),
|
|
49
|
+
label = "angle"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
Scene(
|
|
53
|
+
modifier = Modifier.fillMaxSize(),
|
|
54
|
+
engine = engine,
|
|
55
|
+
materialLoader = materialLoader,
|
|
56
|
+
mainLightNode = rememberMainLightNode(engine) { intensity(80_000f) },
|
|
57
|
+
cameraManipulator = rememberCameraManipulator()
|
|
58
|
+
) {
|
|
59
|
+
// Rotating red cube
|
|
60
|
+
CubeNode(
|
|
61
|
+
engine,
|
|
62
|
+
size = Size(0.5f, 0.5f, 0.5f),
|
|
63
|
+
materialInstance = materialLoader.createColorInstance(
|
|
64
|
+
Color.Red, metallic = 0f, roughness = 0.5f
|
|
65
|
+
),
|
|
66
|
+
position = Position(x = -0.6f),
|
|
67
|
+
rotation = Rotation(y = angle)
|
|
68
|
+
)
|
|
69
|
+
// Metallic blue sphere
|
|
70
|
+
SphereNode(
|
|
71
|
+
engine,
|
|
72
|
+
radius = 0.3f,
|
|
73
|
+
materialInstance = materialLoader.createColorInstance(
|
|
74
|
+
Color.Blue, metallic = 0.8f, roughness = 0.2f
|
|
75
|
+
),
|
|
76
|
+
position = Position(x = 0.6f)
|
|
77
|
+
)
|
|
78
|
+
// Floor plane
|
|
79
|
+
PlaneNode(
|
|
80
|
+
engine,
|
|
81
|
+
size = Size(2f, 0f, 2f),
|
|
82
|
+
materialInstance = materialLoader.createColorInstance(
|
|
83
|
+
Color(0xFF4CAF50), metallic = 0f, roughness = 0.9f
|
|
84
|
+
),
|
|
85
|
+
position = Position(y = -0.35f)
|
|
86
|
+
)
|
|
87
|
+
}
|
|
33
88
|
}`,
|
|
34
89
|
},
|
|
35
90
|
"ar-tap-to-place": {
|
package/package.json
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sceneview-mcp",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "MCP server for SceneView — 3D and AR with Jetpack Compose for Android",
|
|
5
|
-
"keywords": [
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "MCP server for SceneView — 3D and AR with Jetpack Compose for Android. Give Claude the full SceneView SDK so it writes correct, compilable Kotlin.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"sceneview",
|
|
9
|
+
"android",
|
|
10
|
+
"ar",
|
|
11
|
+
"arcore",
|
|
12
|
+
"3d",
|
|
13
|
+
"filament",
|
|
14
|
+
"jetpack-compose",
|
|
15
|
+
"claude",
|
|
16
|
+
"ai"
|
|
17
|
+
],
|
|
6
18
|
"license": "MIT",
|
|
19
|
+
"author": "SceneView (https://github.com/SceneView)",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/SceneView/sceneview-android.git",
|
|
23
|
+
"directory": "mcp"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/SceneView/sceneview-android/tree/main/mcp#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/SceneView/sceneview-android/issues"
|
|
28
|
+
},
|
|
7
29
|
"type": "module",
|
|
8
30
|
"bin": {
|
|
9
31
|
"sceneview-mcp": "dist/index.js"
|
|
@@ -12,6 +34,9 @@
|
|
|
12
34
|
"dist",
|
|
13
35
|
"llms.txt"
|
|
14
36
|
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
},
|
|
15
40
|
"scripts": {
|
|
16
41
|
"build": "tsc",
|
|
17
42
|
"prepare": "cp ../llms.txt ./llms.txt && tsc",
|