Skip to content

Commit f6bafd9

Browse files
committed
Update readme with better visually understandable instructions
1 parent 6ef3d64 commit f6bafd9

File tree

2,279 files changed

+16382
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,279 files changed

+16382
-63
lines changed

README.md

Lines changed: 148 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
# MCP Unity [![](https://img.shields.io/badge/LinkedIn-0077B5?style=flat&logo=linkedin&logoColor=white 'LinkedIn')](https://www.linkedin.com/in/miguel-tomas/)
2-
3-
<a href="https://glama.ai/mcp/servers/@CoderGamester/mcp-unity">
4-
<img width="380" height="200" src="https://glama.ai/mcp/servers/@CoderGamester/mcp-unity/badge" alt="Unity MCP server" />
5-
</a>
1+
# MCP Unity
62

73
[![](https://badge.mcpx.dev?type=server 'MCP Server')](https://modelcontextprotocol.io/introduction)
84
[![smithery badge](https://smithery.ai/badge/@CoderGamester/mcp-unity)](https://smithery.ai/server/@CoderGamester/mcp-unity)
95
[![](https://img.shields.io/badge/Unity-000000?style=flat&logo=unity&logoColor=white 'Unity')](https://unity.com/releases/editor/archive)
106
[![](https://img.shields.io/badge/Node.js-339933?style=flat&logo=nodedotjs&logoColor=white 'Node.js')](https://nodejs.org/en/download/)
11-
[![](https://img.shields.io/badge/TypeScript-3178C6?style=flat&logo=typescript&logoColor=white 'TypeScript')](https://www.typescriptlang.org/)
12-
[![](https://img.shields.io/badge/WebSocket-4353FF?style=flat&logo=socket.io&logoColor=white 'WebSocket')](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
137

14-
[![](https://img.shields.io/github/last-commit/CoderGamester/mcp-unity 'Last Commit')](https://github.com/CoderGamester/mcp-unity/commits/main)
158
[![](https://img.shields.io/github/stars/CoderGamester/mcp-unity 'Stars')](https://github.com/CoderGamester/mcp-unity/stargazers)
169
[![](https://img.shields.io/github/forks/CoderGamester/mcp-unity 'Forks')](https://github.com/CoderGamester/mcp-unity/network/members)
10+
[![](https://img.shields.io/github/last-commit/CoderGamester/mcp-unity 'Last Commit')](https://github.com/CoderGamester/mcp-unity/commits/main)
1711
[![](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT)
1812

13+
<a href="https://glama.ai/mcp/servers/@CoderGamester/mcp-unity">
14+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@CoderGamester/mcp-unity/badge" alt="Unity MCP server" />
15+
</a>
16+
1917
```
2018
,/(/. *(/,
2119
*/(((((/. *((((((*.
@@ -45,6 +43,7 @@
4543
██║╚██╔╝██║██║ ██╔═══╝ ██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝
4644
██║ ╚═╝ ██║╚██████╗██║ ╚██████╔╝██║ ╚████║██║ ██║ ██║
4745
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
46+
```
4847

4948
MCP Unity is an implementation of the Model Context Protocol for Unity Editor, allowing AI assistants to interact with your Unity projects. This package provides a bridge between Unity and a Node.js server that implements the MCP protocol, enabling AI agents like Claude, Windsurf, and Cursor to execute operations within the Unity Editor.
5049

@@ -67,13 +66,15 @@ MCP Unity currently provides the following resources:
6766
- **get_tests**: Retrieves information about tests in the Unity Test Runner
6867

6968
## Requirements
70-
- Unity 2022.3 or later
71-
- Node.js 18 or later (for running the server)
72-
- npm 9 or later (for building the server)
69+
- Unity 2022.3 or later - to [install the server](#install-server)
70+
- Node.js 18 or later - to [start the server](#start-server)
71+
- npm 9 or later - to [debug the server](#debug-server)
72+
73+
## <a name="install-server"></a>Installation
7374

74-
## Installation
75+
Installing this MCP Unity Server is a multi-step process:
7576

76-
### Installing the Unity MCP Server package via Unity Package Manager
77+
### Step 1: Install Unity MCP Server package via Unity Package Manager
7778
1. Open the Unity Package Manager (Window > Package Manager)
7879
2. Click the "+" button in the top-left corner
7980
3. Select "Add package from git URL..."
@@ -83,10 +84,12 @@ MCP Unity currently provides the following resources:
8384
![package manager](https://github.com/user-attachments/assets/a72bfca4-ae52-48e7-a876-e99c701b0497)
8485

8586

86-
### Installing Node.js
87+
### Step 2: Install Node.js
8788
> To run MCP Unity server, you'll need to have Node.js 18 or later installed on your computer:
8889
89-
#### Windows
90+
<details>
91+
<summary><span style="font-size: 1.1em; font-weight: bold;">Windows</span></summary>
92+
9093
1. Visit the [Node.js download page](https://nodejs.org/en/download/)
9194
2. Download the Windows Installer (.msi) for the LTS version (recommended)
9295
3. Run the installer and follow the installation wizard
@@ -95,8 +98,11 @@ MCP Unity currently provides the following resources:
9598
node --version
9699
npm --version
97100
```
101+
</details>
102+
103+
<details>
104+
<summary><span style="font-size: 1.1em; font-weight: bold;">macOS</span></summary>
98105

99-
#### macOS
100106
1. Visit the [Node.js download page](https://nodejs.org/en/download/)
101107
2. Download the macOS Installer (.pkg) for the LTS version (recommended)
102108
3. Run the installer and follow the installation wizard
@@ -109,90 +115,133 @@ MCP Unity currently provides the following resources:
109115
node --version
110116
npm --version
111117
```
118+
</details>
119+
120+
### Step 3: Configure AI LLM Client
121+
122+
<details open>
123+
<summary><span style="font-size: 1.1em; font-weight: bold;">Option 1: Configure using Unity Editor</span></summary>
124+
125+
> Replace `ABSOLUTE/PATH/TO` with the absolute path to your MCP Unity installation.
126+
127+
The right configuration can be accessed in the Unity Editor MCP Server window (Tools > MCP Unity > Server Window)
128+
129+
![MCP configuration](https://github.com/user-attachments/assets/ea9bb912-94a7-4409-81c1-3af39158dac0)
112130

113-
### Installing via Smithery
131+
</details>
132+
133+
<details>
134+
<summary><span style="font-size: 1.1em; font-weight: bold;">Option 2: Configure via Smithery</span></summary>
114135

115136
To install MCP Unity via [Smithery](https://smithery.ai/server/@CoderGamester/mcp-unity):
116137

117138
```
118139
Currently not available
119140
```
141+
</details>
120142

121-
## Configure MCP Server
143+
<details open>
144+
<summary><span style="font-size: 1.1em; font-weight: bold;">Option 3: Configure Manually</span></summary>
122145

123-
> Replace `ABSOLUTE/PATH/TO` with the absolute path to your MCP Unity installation.
146+
<div style="padding-left: 20px;">
124147

125-
The right configuration can be accessed in the Unity Editor MCP Server window (Tools > MCP Unity > Server Window)
148+
<details>
149+
<summary><span style="font-size: 1em">Option 3.1: Configure Claude Desktop</span></summary>
126150

127-
![MCP configuration](https://github.com/user-attachments/assets/ea9bb912-94a7-4409-81c1-3af39158dac0)
151+
<div style="padding-left: 10px;">
128152

153+
Open the MCP configuration file (claude_desktop_config.json) in Claude Desktop Developer in (File > Settings > Developer > Edit Config)
129154

130-
### Configure your AI client
155+
```json
156+
{
157+
"mcpServers": {
158+
"mcp-unity": {
159+
"command": "node",
160+
"args": [
161+
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"
162+
],
163+
"env": {
164+
"UNITY_PORT": "8090"
165+
}
166+
}
167+
}
168+
}
169+
```
170+
</div>
131171

132-
To configure Cursor IDE:
133-
- Add the following configuration to your Cursor MCP Configure settings:
172+
</details>
134173

135-
```
136-
Name: MCP Unity
137-
Type: commmand
138-
Command: env UNITY_PORT=8090 node ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js
139-
```
174+
<details>
175+
<summary><span style="font-size: 1em">Option 3.2: Configure Windsurf IDE</span></summary>
140176

141-
To configure Claude Desktop:
142-
- Open the MCP configuration file (claude_desktop_config.json) in Claude Desktop Developer in (File > Settings > Developer > Edit Config)
177+
<div style="padding-left: 10px;">
143178

144-
To configure Windsurf IDE:
145-
- Open the MCP configuration file (mcp_config.json) in Windsurf IDE in (Windsurf Settings > Advanced Settings > General > Add Sever)
179+
Open the MCP configuration file (mcp_config.json) in Windsurf IDE in (Windsurf Settings > Advanced Settings > General > Add Server)
146180

147181
```json
148182
{
149-
"mcpServers": {
150-
"mcp-unity": {
183+
"mcpServers": {
184+
"mcp-unity": {
151185
"command": "node",
152186
"args": [
153-
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"
187+
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"
154188
],
155189
"env": {
156-
"UNITY_PORT": "8090"
190+
"UNITY_PORT": "8090"
157191
}
158-
}
159-
}
192+
}
193+
}
160194
}
161195
```
196+
</div>
162197

163-
## Running the Server
164-
You need to run the MCP Unity server for this to work, in the following ways:
198+
</details>
165199

166-
### Start Node.js Server
200+
<details>
201+
<summary><span style="font-size: 1em">Option 3.3: Configure Cursor IDE</span></summary>
167202

168-
1. Navigate to this `mcp-unity` package directory in your device with the terminal.
169-
```bash
170-
cd ABSOLUTE/PATH/TO/mcp-unity
171-
```
172-
2. Run the server using Node.js:
173-
```bash
174-
node Server/build/index.js
175-
```
203+
<div style="padding-left: 10px;">
204+
205+
Add the following configuration to your Cursor MCP Configure settings:
206+
207+
```
208+
Name: MCP Unity
209+
Type: commmand
210+
Command: env UNITY_PORT=8090 node ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js
211+
```
212+
</div>
176213

177-
### Start Unity Editor MCP Server
214+
</details>
215+
</div>
216+
217+
</details>
218+
219+
## <a name="start-server"></a>Start Unity Editor MCP Server
178220
1. Open the Unity Editor
179221
2. Navigate to Tools > MCP Unity > Server Window
180222
3. Click "Start Server" to start the WebSocket server
223+
4. Open Claude Desktop or your AI Coding IDE (e.g. Cursor IDE, Windsurf IDE, etc.) and start executing Unity tools
181224

182225
![connect](https://github.com/user-attachments/assets/2e266a8b-8ba3-4902-b585-b220b11ab9a2)
183226

184227
## Configure the WebSocket Port
185228
By default, the WebSocket server runs on port 8080. You can change this port in two ways:
186229

187-
### Option 1: Using the Unity Editor
230+
<details>
231+
<summary><span style="font-size: 1.1em; font-weight: bold;">Option 1: Using the Unity Editor</span></summary>
232+
188233
1. Open the Unity Editor
189234
2. Navigate to Tools > MCP Unity > Server Window
190235
3. Change the "WebSocket Port" value to your desired port number
191236
4. Unity will setup the system environment variable UNITY_PORT to the new port number
192237
5. Restart the Node.js server
193238
6. Click again on "Start Server" to reconnect the Unity Editor web socket to the Node.js MCP Server
194239

195-
### Option 2: Change the system environment variable UNITY_PORT in the terminal
240+
</details>
241+
242+
<details>
243+
<summary><span style="font-size: 1.1em; font-weight: bold;">Option 2: Using the terminal</span></summary>
244+
196245
1. Set the UNITY_PORT environment variable in the terminal
197246
- Powershell
198247
```powershell
@@ -205,8 +254,14 @@ By default, the WebSocket server runs on port 8080. You can change this port in
205254
2. Restart the Node.js server
206255
3. Click again on "Start Server" to reconnect the Unity Editor web socket to the Node.js MCP Server
207256

208-
## Building and Debugging the Server
209-
The MCP Unity server is built using Node.js and TypeScript. It requires to compile the TypeScript code to JavaScript in the `build` directory.
257+
</details>
258+
259+
## <a name="debug-server"></a>Debugging the Server
260+
261+
<details>
262+
<summary><span style="font-size: 1.1em; font-weight: bold;">Building the Node.js Server</span></summary>
263+
264+
The MCP Unity server is built using Node.js . It requires to compile the TypeScript code to JavaScript in the `build` directory.
210265
To build the server, open a terminal and:
211266

212267
1. Navigate to the Server directory:
@@ -224,9 +279,17 @@ To build the server, open a terminal and:
224279
npm run build
225280
```
226281

227-
### Debugging
282+
4. Run the server:
283+
```bash
284+
node build/index.js
285+
```
286+
287+
</details>
228288

229-
1. Debug the server with [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector):
289+
<details>
290+
<summary><span style="font-size: 1.1em; font-weight: bold;">Debugging with MCP Inspector</span></summary>
291+
292+
Debug the server with [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector):
230293
- Powershell
231294
```powershell
232295
$env:UNITY_PORT=8090; npx @modelcontextprotocol/inspector node Server/build/index.js
@@ -236,7 +299,14 @@ To build the server, open a terminal and:
236299
set UNITY_PORT=8090 && npx @modelcontextprotocol/inspector node Server/build/index.js
237300
```
238301

239-
2. Enable logging on your terminal or into a log.txt file:
302+
Don't forget to shutdown the server with `Ctrl + C` before closing the terminal or debugging it with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).
303+
304+
</details>
305+
306+
<details>
307+
<summary><span style="font-size: 1.1em; font-weight: bold;">Enable Console Logs</span></summary>
308+
309+
1. Enable logging on your terminal or into a log.txt file:
240310
- Powershell
241311
```powershell
242312
$env:LOGGING = "true"
@@ -248,25 +318,40 @@ To build the server, open a terminal and:
248318
set LOGGING_FILE=true
249319
```
250320

251-
Don't forget to shutdown the server with `Ctrl + C` before closing the terminal or debugging it with the [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector).
321+
</details>
252322

253323
## Troubleshooting
254324

255-
### Connection Issues
325+
<details>
326+
<summary><span style="font-size: 1.1em; font-weight: bold;">Connection Issues</span></summary>
327+
256328
- Ensure the WebSocket server is running (check the Server Window in Unity)
257329
- Check if there are any firewall restrictions blocking the connection
258330
- Make sure the port number is correct (default is 8080)
259331
- Change the port number in the Unity Editor MCP Server window. (Tools > MCP Unity > Server Window)
332+
</details>
333+
334+
<details>
335+
<summary><span style="font-size: 1.1em; font-weight: bold;">Server Not Starting</span></summary>
260336

261-
### Server Not Starting
262337
- Check the Unity Console for error messages
263338
- Ensure Node.js is properly installed and accessible in your PATH
264339
- Verify that all dependencies are installed in the Server directory
340+
</details>
341+
342+
<details>
343+
<summary><span style="font-size: 1.1em; font-weight: bold;">Menu Items Not Executing</span></summary>
265344

266-
### Menu Items Not Executing
267345
- Ensure the menu item path is correct (case-sensitive)
268346
- Check if the menu item requires confirmation
269347
- Verify that the menu item is available in the current context
348+
</details>
349+
350+
## Support & Feedback
351+
352+
If you have any questions or need support, please open an [issue](https://github.com/CoderGamester/mcp-unity/issues) on this repository.
353+
354+
Alternative you can reach out on [![](https://img.shields.io/badge/LinkedIn-0077B5?style=flat&logo=linkedin&logoColor=white 'LinkedIn')](https://www.linkedin.com/in/miguel-tomas/)
270355

271356
## Contributing
272357

@@ -276,4 +361,4 @@ Contributions are welcome! Please feel free to submit a Pull Request or open an
276361

277362
## License
278363

279-
This project is under MIT license
364+
This project is under [MIT License](License.md)

Server/build/index.d.ts.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Server/build/index.js.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Server/build/resources.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Server/build/resources/getAssetsResource.d.ts.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)