mcpforunityserver 9.3.0b20260129104751__py3-none-any.whl

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.
Files changed (103) hide show
  1. cli/__init__.py +3 -0
  2. cli/commands/__init__.py +3 -0
  3. cli/commands/animation.py +84 -0
  4. cli/commands/asset.py +280 -0
  5. cli/commands/audio.py +125 -0
  6. cli/commands/batch.py +171 -0
  7. cli/commands/code.py +182 -0
  8. cli/commands/component.py +190 -0
  9. cli/commands/editor.py +447 -0
  10. cli/commands/gameobject.py +487 -0
  11. cli/commands/instance.py +93 -0
  12. cli/commands/lighting.py +123 -0
  13. cli/commands/material.py +239 -0
  14. cli/commands/prefab.py +248 -0
  15. cli/commands/scene.py +231 -0
  16. cli/commands/script.py +222 -0
  17. cli/commands/shader.py +226 -0
  18. cli/commands/texture.py +540 -0
  19. cli/commands/tool.py +58 -0
  20. cli/commands/ui.py +258 -0
  21. cli/commands/vfx.py +421 -0
  22. cli/main.py +281 -0
  23. cli/utils/__init__.py +31 -0
  24. cli/utils/config.py +58 -0
  25. cli/utils/confirmation.py +37 -0
  26. cli/utils/connection.py +258 -0
  27. cli/utils/constants.py +23 -0
  28. cli/utils/output.py +195 -0
  29. cli/utils/parsers.py +112 -0
  30. cli/utils/suggestions.py +34 -0
  31. core/__init__.py +0 -0
  32. core/config.py +52 -0
  33. core/logging_decorator.py +37 -0
  34. core/telemetry.py +551 -0
  35. core/telemetry_decorator.py +164 -0
  36. main.py +713 -0
  37. mcpforunityserver-9.3.0b20260129104751.dist-info/METADATA +216 -0
  38. mcpforunityserver-9.3.0b20260129104751.dist-info/RECORD +103 -0
  39. mcpforunityserver-9.3.0b20260129104751.dist-info/WHEEL +5 -0
  40. mcpforunityserver-9.3.0b20260129104751.dist-info/entry_points.txt +3 -0
  41. mcpforunityserver-9.3.0b20260129104751.dist-info/licenses/LICENSE +21 -0
  42. mcpforunityserver-9.3.0b20260129104751.dist-info/top_level.txt +7 -0
  43. models/__init__.py +4 -0
  44. models/models.py +56 -0
  45. models/unity_response.py +47 -0
  46. services/__init__.py +0 -0
  47. services/custom_tool_service.py +499 -0
  48. services/registry/__init__.py +22 -0
  49. services/registry/resource_registry.py +53 -0
  50. services/registry/tool_registry.py +51 -0
  51. services/resources/__init__.py +86 -0
  52. services/resources/active_tool.py +47 -0
  53. services/resources/custom_tools.py +57 -0
  54. services/resources/editor_state.py +304 -0
  55. services/resources/gameobject.py +243 -0
  56. services/resources/layers.py +29 -0
  57. services/resources/menu_items.py +34 -0
  58. services/resources/prefab.py +191 -0
  59. services/resources/prefab_stage.py +39 -0
  60. services/resources/project_info.py +39 -0
  61. services/resources/selection.py +55 -0
  62. services/resources/tags.py +30 -0
  63. services/resources/tests.py +87 -0
  64. services/resources/unity_instances.py +122 -0
  65. services/resources/windows.py +47 -0
  66. services/state/external_changes_scanner.py +245 -0
  67. services/tools/__init__.py +83 -0
  68. services/tools/batch_execute.py +93 -0
  69. services/tools/debug_request_context.py +86 -0
  70. services/tools/execute_custom_tool.py +43 -0
  71. services/tools/execute_menu_item.py +32 -0
  72. services/tools/find_gameobjects.py +110 -0
  73. services/tools/find_in_file.py +181 -0
  74. services/tools/manage_asset.py +119 -0
  75. services/tools/manage_components.py +131 -0
  76. services/tools/manage_editor.py +64 -0
  77. services/tools/manage_gameobject.py +260 -0
  78. services/tools/manage_material.py +111 -0
  79. services/tools/manage_prefabs.py +174 -0
  80. services/tools/manage_scene.py +111 -0
  81. services/tools/manage_script.py +645 -0
  82. services/tools/manage_scriptable_object.py +87 -0
  83. services/tools/manage_shader.py +71 -0
  84. services/tools/manage_texture.py +581 -0
  85. services/tools/manage_vfx.py +120 -0
  86. services/tools/preflight.py +110 -0
  87. services/tools/read_console.py +151 -0
  88. services/tools/refresh_unity.py +153 -0
  89. services/tools/run_tests.py +317 -0
  90. services/tools/script_apply_edits.py +1006 -0
  91. services/tools/set_active_instance.py +117 -0
  92. services/tools/utils.py +348 -0
  93. transport/__init__.py +0 -0
  94. transport/legacy/port_discovery.py +329 -0
  95. transport/legacy/stdio_port_registry.py +65 -0
  96. transport/legacy/unity_connection.py +888 -0
  97. transport/models.py +63 -0
  98. transport/plugin_hub.py +585 -0
  99. transport/plugin_registry.py +126 -0
  100. transport/unity_instance_middleware.py +232 -0
  101. transport/unity_transport.py +63 -0
  102. utils/focus_nudge.py +589 -0
  103. utils/module_discovery.py +55 -0
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcpforunityserver
3
+ Version: 9.3.0b20260129104751
4
+ Summary: MCP for Unity Server: A Unity package for Unity Editor integration via the Model Context Protocol (MCP).
5
+ Author-email: Marcus Sanatan <msanatan@gmail.com>, David Sarno <david.sarno@gmail.com>, Wu Shutong <martinwfire@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/CoplayDev/unity-mcp.git
8
+ Project-URL: Issues, https://github.com/CoplayDev/unity-mcp/issues
9
+ Keywords: mcp,unity,ai,model context protocol,gamedev,unity3d,automation,llm,agent
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: Implementation :: CPython
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Games/Entertainment
24
+ Classifier: Topic :: Software Development :: Code Generators
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: httpx>=0.27.2
29
+ Requires-Dist: fastmcp==2.14.1
30
+ Requires-Dist: mcp>=1.16.0
31
+ Requires-Dist: pydantic>=2.12.5
32
+ Requires-Dist: tomli>=2.3.0
33
+ Requires-Dist: fastapi>=0.104.0
34
+ Requires-Dist: uvicorn>=0.35.0
35
+ Requires-Dist: click>=8.1.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
38
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
40
+ Dynamic: license-file
41
+
42
+ # MCP for Unity Server
43
+
44
+ [![MCP](https://badge.mcpx.dev?status=on 'MCP Enabled')](https://modelcontextprotocol.io/introduction)
45
+ [![python](https://img.shields.io/badge/Python-3.10+-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
46
+ [![License](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT)
47
+ [![Discord](https://img.shields.io/badge/discord-join-red.svg?logo=discord&logoColor=white)](https://discord.gg/y4p8KfzrN4)
48
+
49
+ Model Context Protocol server for Unity Editor integration. Control Unity through natural language using AI assistants like Claude, Cursor, and more.
50
+
51
+ **Maintained by [Coplay](https://www.coplay.dev/?ref=unity-mcp)** - This project is not affiliated with Unity Technologies.
52
+
53
+ 💬 **Join our community:** [Discord Server](https://discord.gg/y4p8KfzrN4)
54
+
55
+ **Required:** Install the [Unity MCP Plugin](https://github.com/CoplayDev/unity-mcp?tab=readme-ov-file#-step-1-install-the-unity-package) to connect Unity Editor with this MCP server. You also need `uvx` (requires [uv](https://docs.astral.sh/uv/)) to run the server.
56
+
57
+ ---
58
+
59
+ ## Installation
60
+
61
+ ### Option 1: PyPI
62
+
63
+ Install and run directly from PyPI using `uvx`.
64
+
65
+ **Run Server (HTTP):**
66
+
67
+ ```bash
68
+ uvx --from mcpforunityserver mcp-for-unity --transport http --http-url http://localhost:8080
69
+ ```
70
+
71
+ **MCP Client Configuration (HTTP):**
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "UnityMCP": {
77
+ "url": "http://localhost:8080/mcp"
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ **MCP Client Configuration (stdio):**
84
+
85
+ ```json
86
+ {
87
+ "mcpServers": {
88
+ "UnityMCP": {
89
+ "command": "uvx",
90
+ "args": [
91
+ "--from",
92
+ "mcpforunityserver",
93
+ "mcp-for-unity",
94
+ "--transport",
95
+ "stdio"
96
+ ]
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ### Option 2: From GitHub Source
103
+
104
+ Use this to run the latest released version from the repository. Change the version to `main` to run the latest unreleased changes from the repository.
105
+
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "UnityMCP": {
110
+ "command": "uvx",
111
+ "args": [
112
+ "--from",
113
+ "git+https://github.com/CoplayDev/unity-mcp@v9.2.0#subdirectory=Server",
114
+ "mcp-for-unity",
115
+ "--transport",
116
+ "stdio"
117
+ ]
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Option 3: Docker
124
+
125
+ **Use Pre-built Image:**
126
+
127
+ ```bash
128
+ docker run -p 8080:8080 msanatan/mcp-for-unity-server:latest --transport http --http-url http://0.0.0.0:8080
129
+ ```
130
+
131
+ **Build Locally:**
132
+
133
+ ```bash
134
+ docker build -t unity-mcp-server .
135
+ docker run -p 8080:8080 unity-mcp-server --transport http --http-url http://0.0.0.0:8080
136
+ ```
137
+
138
+ Configure your MCP client with `"url": "http://localhost:8080/mcp"`.
139
+
140
+ ### Option 4: Local Development
141
+
142
+ For contributing or modifying the server code:
143
+
144
+ ```bash
145
+ # Clone the repository
146
+ git clone https://github.com/CoplayDev/unity-mcp.git
147
+ cd unity-mcp/Server
148
+
149
+ # Run with uv
150
+ uv run src/main.py --transport stdio
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Configuration
156
+
157
+ The server connects to Unity Editor automatically when both are running. No additional configuration needed.
158
+
159
+ **Environment Variables:**
160
+
161
+ - `DISABLE_TELEMETRY=true` - Opt out of anonymous usage analytics
162
+ - `LOG_LEVEL=DEBUG` - Enable detailed logging (default: INFO)
163
+
164
+ ---
165
+
166
+ ## MCP Resources
167
+
168
+ The server provides read-only MCP resources for querying Unity Editor state. Resources provide up-to-date information about your Unity project without modifying it.
169
+
170
+ **Accessing Resources:**
171
+
172
+ Resources are accessed by their URI (not their name). Always use `ListMcpResources` to get the correct URI format.
173
+
174
+ **Example URIs:**
175
+ - `mcpforunity://editor/state` - Editor readiness snapshot
176
+ - `mcpforunity://project/tags` - All project tags
177
+ - `mcpforunity://scene/gameobject/{instance_id}` - GameObject details by ID
178
+ - `mcpforunity://prefab/{encoded_path}` - Prefab info by asset path
179
+
180
+ **Important:** Resource names use underscores (e.g., `editor_state`) but URIs use slashes/hyphens (e.g., `mcpforunity://editor/state`). Always use the URI from `ListMcpResources()` when reading resources.
181
+
182
+ **All resource descriptions now include their URI** for easy reference. List available resources to see the complete catalog with URIs.
183
+
184
+ ---
185
+
186
+ ## Example Prompts
187
+
188
+ Once connected, try these commands in your AI assistant:
189
+
190
+ - "Create a 3D player controller with WASD movement"
191
+ - "Add a rotating cube to the scene with a red material"
192
+ - "Create a simple platformer level with obstacles"
193
+ - "Generate a shader that creates a holographic effect"
194
+ - "List all GameObjects in the current scene"
195
+
196
+ ---
197
+
198
+ ## Documentation
199
+
200
+ For complete documentation, troubleshooting, and advanced usage:
201
+
202
+ 📖 **[Full Documentation](https://github.com/CoplayDev/unity-mcp#readme)**
203
+
204
+ ---
205
+
206
+ ## Requirements
207
+
208
+ - **Python:** 3.10 or newer
209
+ - **Unity Editor:** 2021.3 LTS or newer
210
+ - **uv:** Python package manager ([Installation Guide](https://docs.astral.sh/uv/getting-started/installation/))
211
+
212
+ ---
213
+
214
+ ## License
215
+
216
+ MIT License - See [LICENSE](https://github.com/CoplayDev/unity-mcp/blob/main/LICENSE)
@@ -0,0 +1,103 @@
1
+ main.py,sha256=EoHA0upWjtQzuoOgN5BfNmGL6bIVnFQjRW5PHO5EmjY,29265
2
+ cli/__init__.py,sha256=f2HjXqR9d8Uhibru211t9HPpdrb_1vdDC2v_NwF_eqA,63
3
+ cli/main.py,sha256=V_VFa8tA-CDHNv9J5NzNSLxRuEGjRVZWDe4xn6rYdog,8457
4
+ cli/commands/__init__.py,sha256=xQHf6o0afDV2HsU9gwSxjcrzS41cMCSGZyWYWxblPIk,69
5
+ cli/commands/animation.py,sha256=a7ZqTkP7CRou9wL7MB8b3TSB7v0PFG_1LcjdxW5_zQ0,2388
6
+ cli/commands/asset.py,sha256=Cm18PFLGLisTLRhycTbxaGT8XU3WnJWcPOwsWiB5E2s,7164
7
+ cli/commands/audio.py,sha256=gTW4F6uutgQezAwDqL6_-i8vM588V-AVwxAaJ4LzGN8,3088
8
+ cli/commands/batch.py,sha256=eo2DD62FzRPDk0mQ5WhFVAXS0qXf8_znT_5kdN0BoG4,5388
9
+ cli/commands/code.py,sha256=N6MaBjH7QkYjjCP4wEhAoAQSwvboh2ub3rrI6qYv8AM,5226
10
+ cli/commands/component.py,sha256=OqjuNOyA2n5UOy-0-vMeiIRCQHOq_OnhVqW4ZzMgqrE,5736
11
+ cli/commands/editor.py,sha256=F_KOfQiE-uuwGHXZQ9o9BF5nURG1nKcWuiL-9hjAFHc,12704
12
+ cli/commands/gameobject.py,sha256=D4h8xuMHjOoc_mdyZToNSzYCGrJKjeOpwrMWCXR0OCU,12881
13
+ cli/commands/instance.py,sha256=5qYJtptOFGCzfhXEMIPoEYcJtpkKlfM76dq36i_ZK5s,2780
14
+ cli/commands/lighting.py,sha256=4OpbzPvR8pesTTUVYmKV554SwbTyCVBRwDwTGlnmh2w,3558
15
+ cli/commands/material.py,sha256=_9atAdD0Wo_mEpZ2FP9Opl54ZBi2ak96euydHD_xGa4,6999
16
+ cli/commands/prefab.py,sha256=ef8mFF5pcBDH8X3zWANuD4Hq23sT3gK1mAXsHSbP1iM,7480
17
+ cli/commands/scene.py,sha256=HRDOcOUMpS6RhqL3FNF4JphjseCZFhTuDrJ0l-MOSRc,5652
18
+ cli/commands/script.py,sha256=70i3I6IuKWq5f49QvHIpTzC9fafYmJrWfynJl4ZAAMU,5966
19
+ cli/commands/shader.py,sha256=w_n8g6GJcFmqqZMulPdJGbvWWOirbfzHr6_vUx_2nVE,5985
20
+ cli/commands/texture.py,sha256=lLiPNMfcWNNcfHbyeNA1ZN16tKv1ljHkzhmr7SM5e50,18595
21
+ cli/commands/tool.py,sha256=A-jC9qFAs-LkWY0rav-vrye0yytgfKxQ7y2FraIAzZ4,1605
22
+ cli/commands/ui.py,sha256=u9rpeF_eT7qxdlYmaA2G4ARSe3a16Y4yt-3if7CKmxY,7225
23
+ cli/commands/vfx.py,sha256=gdx5a_N7Ulu960xjaJIV0E_1Ii422C211KaipoRO6nQ,14453
24
+ cli/utils/__init__.py,sha256=Gbm9hYC7UqwloFwdirXgo6z1iBktR9Y96o3bQcrYudc,613
25
+ cli/utils/config.py,sha256=_k3XAFmXG22sv8tYIb5JmO46kNl3T1sGqFptySAayfc,1550
26
+ cli/utils/confirmation.py,sha256=7NGu0I5ogowpdWRTUndn3g5nmWmJM9mV3e0wWMLJwA8,1234
27
+ cli/utils/connection.py,sha256=RBSOK7WotKgokj-wewsqnKT5rwS0_DhsqXqZrFZWUXo,8534
28
+ cli/utils/constants.py,sha256=xCyRMY1L3cc-sbCyl-TGyqkY5hMCOl5tU6L4ZVbN9w4,1046
29
+ cli/utils/output.py,sha256=96daU55ta_hl7UeOhNh5Iy7OJ4psbdR9Nfx1-q2k3xA,6370
30
+ cli/utils/parsers.py,sha256=mnpH2bhZn3L3Lyl8e7Sh7Zr2UW9Xzu3aUuCaLxpV2pk,3430
31
+ cli/utils/suggestions.py,sha256=n6KG3Mrvub28X9rPFYFLRTtZ6HePp3PhhAeojG2WOJw,929
32
+ core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ core/config.py,sha256=kE7yg_89QQck3zScWNjvrq7CnfYt6uLS0VdxK7AJ70o,1453
34
+ core/logging_decorator.py,sha256=D9CD7rFvQz-MBG-G4inizQj0Ivr6dfc9RBmTrw7q8mI,1383
35
+ core/telemetry.py,sha256=zIjmQKUNW0S822SSlkXyjjCIuX0ZpSTaZP4pAU0rCjw,20426
36
+ core/telemetry_decorator.py,sha256=ycSTrzVNCDQHSd-xmIWOpVfKFURPxpiZe_XkOQAGDAo,6705
37
+ mcpforunityserver-9.3.0b20260129104751.dist-info/licenses/LICENSE,sha256=bv5lDJZQEqxBgjjc1rkRbkEwpSIHF-8N-1Od0VnEJFw,1066
38
+ models/__init__.py,sha256=JlscZkGWE9TRmSoBi99v_LSl8OAFNGmr8463PYkXin4,179
39
+ models/models.py,sha256=heXuvdBtdats1SGwW8wKFFHM0qR4hA6A7qETn5s9BZ0,1827
40
+ models/unity_response.py,sha256=oJ1PTsnNc5VBC-9OgM59C0C-R9N-GdmEdmz_yph4GSU,1454
41
+ services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
+ services/custom_tool_service.py,sha256=WJxljL-hdJE5GMlAhVimHVhQwwnWHCd0StgWhWEFgaI,18592
43
+ services/registry/__init__.py,sha256=QCwcYThvGF0kBt3WR6DBskdyxkegJC7NymEChgJA-YM,470
44
+ services/registry/resource_registry.py,sha256=T_Kznqgvt5kKgV7mU85nb0LlFuB4rg-Tm4Cjhxt-IcI,1467
45
+ services/registry/tool_registry.py,sha256=9tMwOP07JE92QFYUS4KvoysO0qC9pkBD5B79kjRsSPw,1304
46
+ services/resources/__init__.py,sha256=G8uSEYJtiyX3yg0QsfoeGdDXOdbU89l5m0B5Anay1Fc,3054
47
+ services/resources/active_tool.py,sha256=6m65iPCD1Iqmp4xqpDKvPErfOJg7Gl3XU5vMyAVcdj8,1521
48
+ services/resources/custom_tools.py,sha256=uujlJEuqv5svCvSZLILgiY6hiiWZqWHVzTBJpTTL3as,1751
49
+ services/resources/editor_state.py,sha256=LZLmljdHQC7nQcA-YYtoRnpy1xDiiAzo4_iU69TgsH8,10858
50
+ services/resources/gameobject.py,sha256=cviektt_GHmwgria5pkvNrzvD5-6hzBi64Ogm0YGIv8,9356
51
+ services/resources/layers.py,sha256=e3bDhfJ0ZjtUagHhraI35GrzrDnzXrRHnDeobmnbniw,1123
52
+ services/resources/menu_items.py,sha256=01LIVHA96bswYGXyLZzGFw3suDqftsBanhy_lkUB2H0,1054
53
+ services/resources/prefab.py,sha256=4TLEBsrlnQdi5FOKWZZ9eesiUCG5Ryxh7FZvd02FcTc,7434
54
+ services/resources/prefab_stage.py,sha256=YALZrfZh4zpV_tEfQI7sUR6ETLnz8qeTN--gwYxk_y8,1430
55
+ services/resources/project_info.py,sha256=NaHb9v5n-2vi3woMxioMXbgpy1tBcmh2bh0RZOTxtC4,1364
56
+ services/resources/selection.py,sha256=HxmpN0RAb6Op0r4kqqRsizahP5L3Hj8V1baRa3uaKpU,1884
57
+ services/resources/tags.py,sha256=f50DzILLNQsUJ44ooomwIGasrcntbKJgT7boqrU4b5s,1090
58
+ services/resources/tests.py,sha256=KOm1vFcDPAXi21rDRQ1hQmifs1T9Xnd0zUp-BcBrBxo,3458
59
+ services/resources/unity_instances.py,sha256=8vLA5oR2VpeLRjuxHk-_J3eopLhuNpGEoJyCvyUAOXg,4386
60
+ services/resources/windows.py,sha256=inD7zMB3R4Tip_92pCDtKGD7clzsGKOGkdmv4rKmygA,1470
61
+ services/state/external_changes_scanner.py,sha256=ZiXu8ZcK5B-hv7CaJLmnEIa9JxzgOBpdmrsRDY2eK5I,9052
62
+ services/tools/__init__.py,sha256=J-woLzm3aLF0uPC1-VroqG7QV9xLXHDmVYee2ZXuCgk,2746
63
+ services/tools/batch_execute.py,sha256=hjh67kgWvQDHyGd2N-Tfezv9WAj5x_pWTt_Vybmmq7s,3501
64
+ services/tools/debug_request_context.py,sha256=Duq5xiuSmRO5GdvWAlZhCfOfmrwvK7gGkRC4wYnXmXk,2907
65
+ services/tools/execute_custom_tool.py,sha256=hiZbm2A9t84f92jitzvkE2G4CMOIUiDVm7u5B8K-RbU,1527
66
+ services/tools/execute_menu_item.py,sha256=k4J89LlXmEGyo9z3NK8Q0vREIzr11ucF_9tN_JeQq9M,1248
67
+ services/tools/find_gameobjects.py,sha256=Qyls8HxBgXjA5OtdJfXuIX0qNGMleQSt3NOvQwjP25E,3963
68
+ services/tools/find_in_file.py,sha256=SxhMeo8lRrt0OiGApGZSFUnq671bxVfK8qgAsHxLua8,6493
69
+ services/tools/manage_asset.py,sha256=St_iWQWg9icztnRthU78t6JNhJN0AlC6ELiZhn-SNZU,5990
70
+ services/tools/manage_components.py,sha256=2_nKPk9iPAf5VyYiXuRxSkN8U76VNQbMtE68UTPngrw,5061
71
+ services/tools/manage_editor.py,sha256=ShvlSBQRfoNQ0DvqBWak_Hi3MB7tv2WkMKEhrKQipk0,3279
72
+ services/tools/manage_gameobject.py,sha256=SP-y3_7Ckw12JO6bLJy01Jrx303JXF-7RMROaQuA1kU,14154
73
+ services/tools/manage_material.py,sha256=LSn9Kp-cSMZ5caU6Ux0M_OSMghCtZgOKkmvwf0xLTFE,4311
74
+ services/tools/manage_prefabs.py,sha256=VKm6D9wR3B3wkyXUVBD__CqUpyzgFu1dUDYsVX6tbKE,7661
75
+ services/tools/manage_scene.py,sha256=-ARtRuj7ZNk_14lmMSORnQs0qTAYKBTPtUfk0sNDo6A,5370
76
+ services/tools/manage_script.py,sha256=tT8JmhTtAYgW8CQla71cfn6IjiUw-tiPjBWVd4ipuCE,28551
77
+ services/tools/manage_scriptable_object.py,sha256=tezG_mbGzPLNpL3F7l5JJLyyjJN3rJi1thGMU8cpOC4,3659
78
+ services/tools/manage_shader.py,sha256=bucRKzQww7opy6DK5nf6isVaEECWWqJ-DVkFulp8CV8,3185
79
+ services/tools/manage_texture.py,sha256=uUicuxKl_uSnP2jBrMbYAhAEWnh7RETusgJfnBI1P8c,22538
80
+ services/tools/manage_vfx.py,sha256=7KFbRohF8EzaD0m7vVIEwjUz-QwC7NEXS5cVcU6Die0,4710
81
+ services/tools/preflight.py,sha256=0nvo0BmZMdIGop1Ha_vypkjn2VLiRvskF0uxh_SlZgE,4162
82
+ services/tools/read_console.py,sha256=ps23debJcQkj3Ap-MqTYVhopYnKGspJs9QHLJHZAAkE,6826
83
+ services/tools/refresh_unity.py,sha256=KrRA8bmLkDLFO1XBv2NmagQAp1dmyaXdUAap567Hcv4,7100
84
+ services/tools/run_tests.py,sha256=Wd7hNZqy-OOZ9ZedonxUJ5bVlhta_aOEmD-2uxmrmyM,11743
85
+ services/tools/script_apply_edits.py,sha256=0f-SaP5NUYGuivl4CWHjR8F-CXUpt3-5qkHpf_edn1U,47677
86
+ services/tools/set_active_instance.py,sha256=pdmC1SxFijyzzjeEyC2N1bXk-GNMu_iXsbCieIpa-R4,4242
87
+ services/tools/utils.py,sha256=ETCiNnWdMZEtnJcDD-CtPsCJ7TBp5x5sPsYuhufkxac,13962
88
+ transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ transport/models.py,sha256=2tnK0Wc-IzvlOS0a04VB3WtuSlAAHeLVFfOnNFHGnhw,1311
90
+ transport/plugin_hub.py,sha256=Kykqnydk_KkCSICaJGE8XQulr7sZeNcIgPOHjtdbjHM,23783
91
+ transport/plugin_registry.py,sha256=L6xl7Ok9rtSW9xwSSKTFjWS7Duu1g4c-qfgfnn6y-sQ,4528
92
+ transport/unity_instance_middleware.py,sha256=DD8gs-peMRmRJz9CYwaHEh4m75LTYPDjVuKuw9sArBw,10438
93
+ transport/unity_transport.py,sha256=RKMH0NYPqTU3rpjXUPUkzZsdWhJqyVaHmkLswab4bGg,2135
94
+ transport/legacy/port_discovery.py,sha256=JDSCqXLodfTT7fOsE0DFC1jJ3QsU6hVaYQb7x7FgdxY,12728
95
+ transport/legacy/stdio_port_registry.py,sha256=j4iARuP6wetppNDG8qKeuvo1bJKcSlgEhZvSyl_uf0A,2313
96
+ transport/legacy/unity_connection.py,sha256=FE9ZQfYMhHvIxBycr_DjI3BKvuEdORXuABnCE5Q2tjQ,36733
97
+ utils/focus_nudge.py,sha256=0MCOms-SxUW7sN2hT3syy1epMdli2zc-6UHBICAfBSM,21330
98
+ utils/module_discovery.py,sha256=My48ofB1BUqxiBoAZAGbEaLQYdsrDhMm8MayBP_bUSQ,2005
99
+ mcpforunityserver-9.3.0b20260129104751.dist-info/METADATA,sha256=EpQqY2ZImvDyHMV7D16RFaKgDsSBd8DDvlgKWbCfoKs,6750
100
+ mcpforunityserver-9.3.0b20260129104751.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
101
+ mcpforunityserver-9.3.0b20260129104751.dist-info/entry_points.txt,sha256=pPm70RXQvkt3uBhPOtViDa47ZTA03RaQ6rwXvyi8oiI,70
102
+ mcpforunityserver-9.3.0b20260129104751.dist-info/top_level.txt,sha256=3-A65WsmBO6UZYH8O5mINdyhhZ63SDssr8LncRd1PSQ,46
103
+ mcpforunityserver-9.3.0b20260129104751.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ mcp-for-unity = main:main
3
+ unity-mcp = cli.main:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 CoplayDev
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.
@@ -0,0 +1,7 @@
1
+ cli
2
+ core
3
+ main
4
+ models
5
+ services
6
+ transport
7
+ utils
models/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .models import MCPResponse, UnityInstanceInfo
2
+ from .unity_response import normalize_unity_response
3
+
4
+ __all__ = ['MCPResponse', 'UnityInstanceInfo', 'normalize_unity_response']
models/models.py ADDED
@@ -0,0 +1,56 @@
1
+ from typing import Any
2
+ from datetime import datetime
3
+ from pydantic import BaseModel, Field
4
+
5
+
6
+ class MCPResponse(BaseModel):
7
+ success: bool
8
+ message: str | None = None
9
+ error: str | None = None
10
+ data: Any | None = None
11
+ # Optional hint for clients about how to handle the response.
12
+ # Supported values:
13
+ # - "retry": Unity is temporarily reloading; call should be retried politely.
14
+ hint: str | None = None
15
+
16
+
17
+ class ToolParameterModel(BaseModel):
18
+ name: str
19
+ description: str | None = None
20
+ type: str = Field(default="string")
21
+ required: bool = Field(default=True)
22
+ default_value: str | None = None
23
+
24
+
25
+ class ToolDefinitionModel(BaseModel):
26
+ name: str
27
+ description: str | None = None
28
+ structured_output: bool | None = True
29
+ requires_polling: bool | None = False
30
+ poll_action: str | None = "status"
31
+ parameters: list[ToolParameterModel] = Field(default_factory=list)
32
+
33
+
34
+ class UnityInstanceInfo(BaseModel):
35
+ """Information about a Unity Editor instance"""
36
+ id: str # "ProjectName@hash" or fallback to hash
37
+ name: str # Project name extracted from path
38
+ path: str # Full project path (Assets folder)
39
+ hash: str # 8-char hash of project path
40
+ port: int # TCP port
41
+ status: str # "running", "reloading", "offline"
42
+ last_heartbeat: datetime | None = None
43
+ unity_version: str | None = None
44
+
45
+ def to_dict(self) -> dict[str, Any]:
46
+ """Convert to dictionary for JSON serialization"""
47
+ return {
48
+ "id": self.id,
49
+ "name": self.name,
50
+ "path": self.path,
51
+ "hash": self.hash,
52
+ "port": self.port,
53
+ "status": self.status,
54
+ "last_heartbeat": self.last_heartbeat.isoformat() if self.last_heartbeat else None,
55
+ "unity_version": self.unity_version
56
+ }
@@ -0,0 +1,47 @@
1
+ """Utilities for normalizing Unity transport responses."""
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+
7
+ def normalize_unity_response(response: Any) -> Any:
8
+ """Normalize Unity's {status,result} payloads into MCPResponse shape."""
9
+ if not isinstance(response, dict):
10
+ return response
11
+
12
+ status = response.get("status")
13
+ result = response.get("result") if isinstance(
14
+ response.get("result"), dict) else response.get("result")
15
+
16
+ # Already MCPResponse-shaped
17
+ if "success" in response:
18
+ return response
19
+ if isinstance(result, dict) and "success" in result:
20
+ return result
21
+
22
+ if status is None:
23
+ return response
24
+
25
+ payload = result if isinstance(result, dict) else {}
26
+ success = status == "success"
27
+ message = payload.get("message") or response.get("message")
28
+ error = payload.get("error") or response.get("error")
29
+
30
+ data = payload.get("data")
31
+ if data is None and isinstance(payload, dict) and payload:
32
+ data = {k: v for k, v in payload.items() if k not in {
33
+ "message", "error", "status", "code"}}
34
+ if not data:
35
+ data = None
36
+
37
+ normalized: dict[str, Any] = {
38
+ "success": success,
39
+ "message": message,
40
+ "error": error if not success else None,
41
+ "data": data,
42
+ }
43
+
44
+ if not success and not normalized["error"]:
45
+ normalized["error"] = message or "Unity command failed"
46
+
47
+ return normalized
services/__init__.py ADDED
File without changes