You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The C# Unity Editor package in the Editor/ folder
3
-
- The Node.js server in the Server/ folder.
1
+
## 1. Project Structure
4
2
5
-
Use WebSockets to communicate between the Editor and the Node.js server.
6
-
For more documentation for the WebSocket library being used in Unity see https://github.com/sta/websocket-sharp/tree/master/websocket-sharp/Server
3
+
- The project consists of two main parts:
4
+
- Editor/: A C# Unity Editor package that exposes Unity Editor functionality via a WebSocket bridge.
5
+
- Server/: A Node.js server implementing the Model Context Protocol (MCP), using the official TypeScript SDK.
7
6
8
-
Minimum supported versions:
9
-
- Unity 2022.3
10
-
- Node.js 18.0.0
7
+
## 2. Communication & Protocol
11
8
12
-
The MCP Node.js server implements the typescript SDK from https://github.com/modelcontextprotocol/typescript-sdk
9
+
- Communication between the Unity Editor and the Node.js MCP server is handled via WebSockets.
10
+
- The Unity side uses the `websocket-sharp` library: https://github.com/sta/websocket-sharp/tree/master/websocket-sharp/Server
11
+
- The Node.js server uses the `@modelcontextprotocol/sdk` for protocol implementation and exposes tools/resources to LLMs and AI clients.
12
+
13
+
## 3. Minimum Supported Versions
14
+
15
+
- Unity: 2022.3 or newer
16
+
- Node.js: 18.0.0 or newer
17
+
18
+
## 4. Key Components
19
+
20
+
### Unity Editor Package (Editor/)
21
+
22
+
- **McpUnityServer**: Singleton entry point for the Unity-side server. Registers tools/resources, manages WebSocket connections, and handles requests from Node.js.
- **resources/**: Implements MCP resource endpoints (e.g., get hierarchy, get logs).
35
+
- **utils/**: Logging and helper utilities.
36
+
- **package.json**: Declares dependencies, including `@modelcontextprotocol/sdk`, `ws`, `express`, etc.
37
+
38
+
## 5. Integration & Usage
39
+
40
+
- The Unity Editor package is designed to be used as a package (via UPM or direct import).
41
+
- The Node.js server can be started independently and connects to Unity via WebSocket (port configurable, default 8090).
42
+
- The system is designed for use with LLM-based IDEs (e.g., Windsurf, Cursor, Claude Desktop) to enable AI-powered Unity Editor automation and queries.
43
+
44
+
## 6. Configuration
45
+
46
+
- Configuration utilities are provided for generating and injecting MCP config into various IDEs (Cursor, Claude Desktop, Windsurf).
47
+
- Unity-side settings are persisted in `ProjectSettings/McpUnitySettings.json`.
48
+
49
+
## 7. Extensibility
50
+
51
+
- Tools and resources can be extended by adding new C# classes (Unity) or TypeScript modules (Node.js).
52
+
- Dependency injection is used on the Unity side for improved modularity and testability.
0 commit comments