sbox-mcp-server 1.3.0 → 1.3.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 +59 -36
- package/dist/index.js +24 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
# sbox-mcp-server
|
|
2
2
|
|
|
3
|
-
MCP Server for the s&box game engine. Lets Claude Code build s&box games through conversation —
|
|
3
|
+
MCP Server for the s&box game engine. Lets Claude Code build s&box games through conversation — 99 working tools for scenes, scripts, GameObjects, components, assets, materials, audio, physics, UI, networking, publishing, world-gen, and type discovery.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Fastest install — the Claude Code plugin
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
If you use Claude Code, the easiest install is the companion plugin. It registers this MCP server automatically, ships a workflow skill, and includes the `sbox-game-dev` specialist agent.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
git clone https://github.com/lousputthole/sbox-claude.git
|
|
9
|
+
```
|
|
10
|
+
/plugin marketplace add LouSputthole/Sbox-Claude
|
|
11
|
+
/plugin install sbox-claude
|
|
14
12
|
```
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
1. Open your project in the s&box editor
|
|
18
|
-
2. Go to **Library Manager** and create a new library called **"claudebridge"**
|
|
19
|
-
3. Copy `sbox-bridge-addon/Editor/MyEditorMenu.cs` into the library's `Editor/` folder
|
|
20
|
-
4. Restart s&box
|
|
14
|
+
You still need to install the s&box-side **bridge addon** into your project's `Libraries/` folder (see step 1 below). The plugin handles the Claude side; the addon handles the s&box side.
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
## Manual install — three steps
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
### 1. Install the bridge addon in s&box
|
|
19
|
+
|
|
20
|
+
The bridge addon runs inside the s&box editor and receives commands from this MCP server. It MUST live inside a project's `Libraries/` folder — putting it in s&box's global `addons/` will silently fail to compile.
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
git clone https://github.com/LouSputthole/Sbox-Claude.git
|
|
24
|
+
cd Sbox-Claude
|
|
25
|
+
.\install.ps1 -RemoveStaleAddons # Windows, auto-detects your s&box project
|
|
26
|
+
./install.sh --remove-stale # Linux/Mac/WSL
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
See [INSTALL.md](https://github.com/LouSputthole/Sbox-Claude/blob/main/INSTALL.md) for the full guide and manual fallback.
|
|
30
|
+
|
|
31
|
+
### 2. Register the MCP server with Claude Code
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
claude mcp add sbox --
|
|
34
|
+
claude mcp add sbox -- npx sbox-mcp-server
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
In s&box, go to **View > Claude Bridge** to open the dock panel. The dock **must be visible** for commands to be processed.
|
|
37
|
+
This is the bare command — equivalent to what the plugin's `.mcp.json` does for you.
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
### 3. Open s&box
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
Open your project. The bridge starts automatically. Verify with:
|
|
43
42
|
|
|
44
43
|
```
|
|
45
|
-
|
|
44
|
+
Check the bridge status.
|
|
46
45
|
```
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
You should see `connected: true, handlerCount: 99`.
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
## How it works
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
```
|
|
52
|
+
Claude Code → (stdio) → sbox-mcp-server → (file IPC) → bridge addon → s&box editor
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Communication uses file-based IPC through `%TEMP%/sbox-bridge-ipc/`. The MCP server writes request JSON files, the bridge addon (running inside s&box) polls and processes on the main editor thread, then writes response files back. WebSocket is not used — s&box's sandboxed C# environment blocks `System.Net`.
|
|
56
|
+
|
|
57
|
+
## Tools (99 working)
|
|
53
58
|
|
|
54
59
|
| Category | Tools |
|
|
55
60
|
|----------|-------|
|
|
@@ -57,8 +62,8 @@ WebSocket is not used — s&box's sandboxed C# environment does not allow `Syste
|
|
|
57
62
|
| **Scripts** | create_script, edit_script, delete_script, trigger_hotload |
|
|
58
63
|
| **Scenes** | list_scenes, load_scene, save_scene, create_scene |
|
|
59
64
|
| **GameObjects** | create/delete/duplicate/rename, set_parent/enabled/transform |
|
|
60
|
-
| **Components** | get/set_property, get_all_properties, list_available, add_component |
|
|
61
|
-
| **Hierarchy** | get_scene_hierarchy, get/select/focus_object |
|
|
65
|
+
| **Components** | get/set_property, get_all_properties, list_available, add_component, set_prefab_ref |
|
|
66
|
+
| **Hierarchy** | get_scene_hierarchy (with `maxDepth` + `rootId`), get/select/focus_object |
|
|
62
67
|
| **Assets** | search_assets, list_asset_library, install_asset, get_asset_info |
|
|
63
68
|
| **Materials** | assign_model, create/assign_material, set_material_property |
|
|
64
69
|
| **Audio** | list_sounds, create_sound_event, assign_sound, play_sound_preview |
|
|
@@ -69,20 +74,38 @@ WebSocket is not used — s&box's sandboxed C# environment does not allow `Syste
|
|
|
69
74
|
| **Physics** | add_physics, add_collider, add_joint, raycast |
|
|
70
75
|
| **UI** | create_razor_ui, add_screen_panel, add_world_panel |
|
|
71
76
|
| **Templates** | create_player/npc_controller, create_game_manager, create_trigger_zone |
|
|
72
|
-
| **Networking** | network_helper, configure/status, spawn, ownership, sync, RPCs, templates |
|
|
73
|
-
| **Publishing** | project_config, validate, thumbnail, package_details
|
|
77
|
+
| **Networking** | network_helper, configure/status, spawn, ownership, sync, RPCs, lobby/event templates |
|
|
78
|
+
| **Publishing** | project_config, validate, thumbnail, package_details |
|
|
79
|
+
| **World gen** | invoke_button, list_component_buttons, raycast_terrain, build_terrain_mesh |
|
|
80
|
+
| **Map edit** | add_terrain_hill/clearing/trail, clear_terrain_features, sculpt_terrain |
|
|
81
|
+
| **Caves / Forest** | add_cave_waypoint, clear_cave_path, add_forest_poi/trail, set_forest_seed, clear_forest_pois, paint_forest_density |
|
|
82
|
+
| **Placement** | place_along_path |
|
|
83
|
+
| **Discovery** | describe_type, search_types, get_method_signature, find_in_project |
|
|
74
84
|
| **Status** | get_bridge_status |
|
|
75
85
|
|
|
76
|
-
|
|
86
|
+
## Working with Claude effectively
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
Two disciplines prevent the iteration-loop trap:
|
|
89
|
+
|
|
90
|
+
1. **After visual changes, call `take_screenshot` and read the PNG.** Claude is a multimodal model — it can see the result. Guessing about visual outcomes from code alone produces long iteration loops.
|
|
91
|
+
2. **Before writing code that touches an unfamiliar s&box type, call `describe_type` or `search_types`.** Reflection is the source of truth; training data goes stale across SDK versions.
|
|
92
|
+
|
|
93
|
+
The companion plugin's `sbox-build-feature` skill encodes this workflow plus the common gotchas. If you're not using the plugin, the same rules apply manually.
|
|
79
94
|
|
|
80
95
|
## Requirements
|
|
81
96
|
|
|
82
97
|
- **Node.js 18+**
|
|
83
|
-
- **s&box** with the
|
|
98
|
+
- **s&box** with the bridge addon installed in your project's `Libraries/` folder
|
|
84
99
|
- **Claude Code**
|
|
85
100
|
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
- [Main README](https://github.com/LouSputthole/Sbox-Claude/blob/main/README.md) — full project overview
|
|
104
|
+
- [INSTALL.md](https://github.com/LouSputthole/Sbox-Claude/blob/main/INSTALL.md) — install + manual fallback
|
|
105
|
+
- [TROUBLESHOOTING.md](https://github.com/LouSputthole/Sbox-Claude/blob/main/TROUBLESHOOTING.md) — 10 most common failures
|
|
106
|
+
- [CHANGELOG.md](https://github.com/LouSputthole/Sbox-Claude/blob/main/CHANGELOG.md) — release history
|
|
107
|
+
- [Plugin README](https://github.com/LouSputthole/Sbox-Claude/blob/main/plugins/sbox-claude/README.md) — Claude Code plugin docs
|
|
108
|
+
|
|
86
109
|
## License
|
|
87
110
|
|
|
88
111
|
**GPL-3.0** — see [LICENSE](../LICENSE) for details.
|
package/dist/index.js
CHANGED
|
@@ -100,6 +100,30 @@ TOOLS (99 working — was 109; 10 unimplementable tools removed in v1.3.0)
|
|
|
100
100
|
const server = new McpServer({
|
|
101
101
|
name: "sbox-mcp",
|
|
102
102
|
version: getVersion(),
|
|
103
|
+
}, {
|
|
104
|
+
// The `instructions` field surfaces every Claude Code session that uses this
|
|
105
|
+
// server (the way other MCP servers like Supabase / TurboTax do). Use it to
|
|
106
|
+
// tell Claude how to work effectively with the bridge — the disciplines that
|
|
107
|
+
// are easy to skip without a reminder.
|
|
108
|
+
instructions: `You are working with the s&box Claude Bridge — a file-based IPC bridge into the s&box game engine editor.
|
|
109
|
+
|
|
110
|
+
To get good results:
|
|
111
|
+
|
|
112
|
+
1. Always call \`mcp__sbox__get_bridge_status\` first to confirm the bridge addon is connected and s&box is running. If ping responds but other tools time out, the editor side isn't processing requests.
|
|
113
|
+
|
|
114
|
+
2. For visual changes (models, positions, animations, UI panels, lighting), call \`mcp__sbox__take_screenshot\` after the change and READ THE PNG yourself. You're a multimodal model — you can see the result. Guessing about visual outcomes from code alone produces long iteration loops. The screenshot tool saves to <sbox-install>/screenshots/sbox.<timestamp>.png — list the newest file and read it.
|
|
115
|
+
|
|
116
|
+
3. Before writing code that touches an unfamiliar s&box type, call \`mcp__sbox__describe_type\` or \`mcp__sbox__search_types\`. s&box's API changes between SDK versions — reflection is the source of truth, not training data.
|
|
117
|
+
|
|
118
|
+
4. \`get_scene_hierarchy\` honors \`maxDepth\` (default 10) and accepts optional \`rootId\` to traverse from a specific GameObject. Use these to avoid dumping the entire scene into a tool result.
|
|
119
|
+
|
|
120
|
+
5. Scene-mutating tools (create_gameobject, set_property, etc.) refuse during play mode and return a clear error. Stop play before making scene edits.
|
|
121
|
+
|
|
122
|
+
If you're running inside Claude Code, install the companion plugin for the full workflow:
|
|
123
|
+
/plugin marketplace add LouSputthole/Sbox-Claude
|
|
124
|
+
/plugin install sbox-claude
|
|
125
|
+
|
|
126
|
+
The plugin ships an \`sbox-build-feature\` skill that codifies the workflow above plus a list of common s&box gotchas (MathF not available in sandbox, Cloud assets ephemeral, head bone case-sensitive, CitizenAnimationHelper.IkRightHand works at runtime, etc.). Read its SKILL.md before starting non-trivial features.`,
|
|
103
127
|
});
|
|
104
128
|
// Bridge client connects to s&box editor via WebSocket
|
|
105
129
|
const bridge = new BridgeClient(process.env.SBOX_BRIDGE_HOST ?? "127.0.0.1", parseInt(process.env.SBOX_BRIDGE_PORT ?? "29015", 10));
|