sceneview-mcp 3.1.1 → 3.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Thomas Gorisse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,17 +1,74 @@
1
- # sceneview-mcp
1
+ # sceneview-mcp — SceneView MCP Server
2
2
 
3
- [![npm](https://img.shields.io/npm/v/sceneview-mcp?color=cb3837&label=npm)](https://www.npmjs.com/package/sceneview-mcp)
4
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
3
+ [![npm version](https://img.shields.io/npm/v/sceneview-mcp?color=6c35aa)](https://www.npmjs.com/package/sceneview-mcp)
4
+ [![npm downloads](https://img.shields.io/npm/dm/sceneview-mcp?color=blue)](https://www.npmjs.com/package/sceneview-mcp)
5
+ [![MCP](https://img.shields.io/badge/MCP-v1.12-blue)](https://modelcontextprotocol.io/)
6
+ [![License](https://img.shields.io/badge/License-Apache%202.0-green)](https://www.apache.org/licenses/LICENSE-2.0)
7
+ [![Node](https://img.shields.io/badge/Node-%3E%3D18-brightgreen)](https://nodejs.org/)
5
8
 
6
- MCP server for [SceneView](https://github.com/SceneView/sceneview-android) — 3D and AR as Jetpack Compose composables for Android.
9
+ The official [Model Context Protocol](https://modelcontextprotocol.io/) server for **SceneView** giving AI assistants deep knowledge of the SceneView 3D/AR SDK so they generate correct, compilable Kotlin code.
7
10
 
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.
11
+ ---
12
+
13
+ ## What It Does
14
+
15
+ When connected to an AI assistant (Claude, Cursor, Windsurf, etc.), this MCP server provides **10 tools** and **2 resources** that give the assistant expert-level knowledge of the SceneView SDK:
16
+
17
+ ### Tools
18
+
19
+ | Tool | Description |
20
+ |------|-------------|
21
+ | `get_node_reference` | Complete API reference for any SceneView node type (26+ types) |
22
+ | `list_node_types` | List all available node composables |
23
+ | `validate_code` | Check SceneView code for 15+ common mistakes before presenting it |
24
+ | `get_sample` | Get complete, compilable sample code for any of 14 scenarios |
25
+ | `list_samples` | Browse all sample applications, optionally filtered by tag |
26
+ | `get_setup` | Gradle + manifest setup for 3D or AR projects |
27
+ | `get_migration_guide` | Full SceneView 2.x to 3.0 migration instructions |
28
+ | `get_platform_roadmap` | Multi-platform roadmap (Android, iOS, KMP, Web) |
29
+ | `get_best_practices` | Performance, architecture, memory, and threading best practices |
30
+ | `get_ar_setup` | Detailed AR setup: manifest, permissions, session config, patterns |
31
+
32
+ ### Resources
33
+
34
+ | Resource | Description |
35
+ |----------|-------------|
36
+ | `sceneview://api` | Complete SceneView 3.3.0 API reference (llms.txt) |
37
+ | `sceneview://known-issues` | Live open issues from GitHub (cached 10 min) |
9
38
 
10
39
  ---
11
40
 
12
- ## Quick start
41
+ ## Installation
42
+
43
+ ### Claude Desktop
44
+
45
+ Add to your Claude Desktop configuration file:
46
+
47
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
48
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "sceneview": {
54
+ "command": "npx",
55
+ "args": ["-y", "sceneview-mcp"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ Restart Claude Desktop after saving the file.
62
+
63
+ ### Claude Code
64
+
65
+ Run from your terminal:
66
+
67
+ ```bash
68
+ claude mcp add sceneview -- npx -y sceneview-mcp
69
+ ```
13
70
 
14
- Add to your Claude config and you're done:
71
+ Or add to your `.claude/settings.json`:
15
72
 
16
73
  ```json
17
74
  {
@@ -24,80 +81,169 @@ Add to your Claude config and you're done:
24
81
  }
25
82
  ```
26
83
 
27
- <details>
28
- <summary>Where does this go?</summary>
84
+ ### Cursor
29
85
 
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` |
86
+ Open **Settings > MCP** and add a new server:
35
87
 
36
- After saving, run `/mcp` in Claude Code or restart Claude Desktop to pick it up.
37
- </details>
88
+ **Name:** `sceneview`
89
+ **Type:** `command`
90
+ **Command:** `npx -y sceneview-mcp`
91
+
92
+ Or add to your `.cursor/mcp.json`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "sceneview": {
98
+ "command": "npx",
99
+ "args": ["-y", "sceneview-mcp"]
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ ### Windsurf
106
+
107
+ Open **Settings > MCP** and add:
108
+
109
+ ```json
110
+ {
111
+ "mcpServers": {
112
+ "sceneview": {
113
+ "command": "npx",
114
+ "args": ["-y", "sceneview-mcp"]
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### Other MCP Clients
121
+
122
+ The server communicates via **stdio** using the MCP protocol. Start it directly:
123
+
124
+ ```bash
125
+ npx sceneview-mcp
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Verify Installation
131
+
132
+ Once connected, ask your AI assistant:
133
+
134
+ > "List all SceneView node types"
135
+
136
+ It should return the full list of 26+ composable nodes. If it does, the MCP server is working.
38
137
 
39
138
  ---
40
139
 
41
- ## What Claude gets
140
+ ## Tool Examples
141
+
142
+ ### Get a sample project
143
+
144
+ > "Show me an AR tap-to-place sample with SceneView"
145
+
146
+ The assistant will call `get_sample("ar-model-viewer")` and return a complete, compilable Kotlin composable with all imports and dependencies.
147
+
148
+ ### Validate generated code
149
+
150
+ > "Create a 3D model viewer and validate the code"
151
+
152
+ The assistant will generate the code, then call `validate_code` to check it against 15+ rules (threading, null safety, API correctness, lifecycle) before presenting it.
153
+
154
+ ### Look up a node's API
155
+
156
+ > "What parameters does LightNode accept?"
157
+
158
+ The assistant will call `get_node_reference("LightNode")` and return the exact function signature, parameter types, defaults, and a usage example.
159
+
160
+ ### Get setup instructions
161
+
162
+ > "How do I set up ARCore with SceneView in my project?"
163
+
164
+ The assistant will call `get_ar_setup` and return the complete Gradle dependency, AndroidManifest.xml changes, session configuration options, and working AR starter templates.
42
165
 
43
- ### Resource `sceneview://api`
166
+ ### Get best practices
44
167
 
45
- The complete SceneView 3.0.0 API reference (`llms.txt`): composable signatures, node types, AR scope, resource loading, threading rules, and common patterns.
168
+ > "What are the performance best practices for SceneView?"
46
169
 
47
- ### Tool `get_sample(scenario)`
170
+ The assistant will call `get_best_practices("performance")` and return guidance on model optimization, runtime performance, environment/lighting setup, and common anti-patterns.
48
171
 
49
- Returns a complete, compilable Kotlin sample.
172
+ ### Check the roadmap
50
173
 
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 |
174
+ > "Does SceneView support iOS?"
58
175
 
59
- ### Tool `get_setup(type)`
176
+ The assistant will call `get_platform_roadmap` and return the current multi-platform status and future plans.
60
177
 
61
- Returns Gradle dependencies + AndroidManifest for `"3d"` or `"ar"` projects.
178
+ ### Migrate from v2 to v3
179
+
180
+ > "I'm upgrading from SceneView 2.x. What changed?"
181
+
182
+ The assistant will call `get_migration_guide` and return every breaking change with before/after code examples.
62
183
 
63
184
  ---
64
185
 
65
- ## How it works
186
+ ## Why Use This?
66
187
 
67
- ```
68
- You: "Add AR placement to my app"
69
-
70
- Claude: reads sceneview://api ← full API ref, always current
71
-
72
- Claude: calls get_sample("ar-tap-to-place") ← working Kotlin
73
-
74
- Result: Correct, compilable SceneView 3.0.0 code
75
- ```
188
+ **Without** this MCP server, AI assistants may:
189
+ - Recommend deprecated Sceneform instead of SceneView
190
+ - Generate imperative View-based code instead of Compose
191
+ - Use wrong API signatures or outdated versions
192
+ - Miss ARCore integration patterns
193
+ - Forget null-checks on `rememberModelInstance`
194
+
195
+ **With** this MCP server, AI assistants:
196
+ - Always use the latest SceneView 3.3.0 API
197
+ - Generate correct Compose-native 3D/AR code
198
+ - Know about all 26+ node types and their exact parameters
199
+ - Validate code against 15+ rules before presenting it
200
+ - Provide working sample code for any scenario
76
201
 
77
202
  ---
78
203
 
79
- ## Try it — sample prompts
204
+ ## Troubleshooting
205
+
206
+ ### "MCP server not found" or connection errors
80
207
 
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.
208
+ 1. Ensure Node.js 18+ is installed: `node --version`
209
+ 2. Test the server manually: `npx sceneview-mcp` it should start without errors and wait for input
210
+ 3. Restart your AI client after changing the MCP configuration
83
211
 
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.
212
+ ### "npx command not found"
86
213
 
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.
214
+ Install Node.js from [nodejs.org](https://nodejs.org/) (LTS recommended). npm and npx are included.
89
215
 
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.
216
+ ### Server starts but tools are not available
92
217
 
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.
218
+ - In Claude Desktop, check the MCP icon in the input bar. It should show "sceneview" as connected.
219
+ - In Cursor, check **Settings > MCP** and verify the server shows a green status.
220
+ - Try restarting the MCP server by restarting your AI client.
95
221
 
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.
222
+ ### Stale data from `sceneview://known-issues`
98
223
 
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.
224
+ GitHub issues are cached for 10 minutes. Wait for the cache to expire or restart the server.
225
+
226
+ ### Validation false positives
227
+
228
+ The `validate_code` tool uses pattern matching and may flag valid code in some edge cases. If a validation warning seems incorrect, review the rule explanation in the output — it includes the rule ID and a detailed explanation.
229
+
230
+ ### Firewall or proxy issues
231
+
232
+ The only network call is to the GitHub API (for `sceneview://known-issues`). All other tools work fully offline. If you are behind a corporate proxy, set the `HTTPS_PROXY` environment variable:
233
+
234
+ ```json
235
+ {
236
+ "mcpServers": {
237
+ "sceneview": {
238
+ "command": "npx",
239
+ "args": ["-y", "sceneview-mcp"],
240
+ "env": {
241
+ "HTTPS_PROXY": "http://proxy.example.com:8080"
242
+ }
243
+ }
244
+ }
245
+ }
246
+ ```
101
247
 
102
248
  ---
103
249
 
@@ -106,23 +252,19 @@ Result: Correct, compilable SceneView 3.0.0 code
106
252
  ```bash
107
253
  cd mcp
108
254
  npm install
109
- npm run prepare # copies llms.txt + compiles TypeScript
110
- npm start # run over stdio
111
- npx @modelcontextprotocol/inspector node dist/index.js # test in MCP inspector
255
+ npm run prepare # Copy llms.txt + build TypeScript
256
+ npm test # Run unit tests
257
+ npm run dev # Start with tsx (hot reload)
112
258
  ```
113
259
 
114
260
  ## Publishing
115
261
 
262
+ Published to npm on each SceneView release:
263
+
116
264
  ```bash
117
- cd mcp
118
- npm run prepare
119
265
  npm publish --access public
120
266
  ```
121
267
 
122
- ---
123
-
124
- ## Links
268
+ ## License
125
269
 
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)
270
+ Apache 2.0 — same as SceneView.