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
CoderGamester / mcp-unity Public
MCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)
153 stars
22 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
main
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
CoderGamester
added Newtonsoft dependency to the package configuration
Mar 28, 2025
403d1c0
· Mar 28, 2025
History
-------
28 Commits
| | |
| Editor | | Editor | added Newtonsoft dependency to the package configuration | Mar 28, 2025 |
| Server | | Server | Update readme with better visually understandable instructions | Mar 27, 2025 |
| .gitignore | | .gitignore | Finally fixed connection issues that were dependent on the service in… | Mar 23, 2025 |
| .windsurfrules | | .windsurfrules | added Newtonsoft dependency to the package configuration | Mar 28, 2025 |
| Editor.meta | | Editor.meta | docs: update README with new client configurations and build instruct… | Mar 13, 2025 |
| LICENSE.md | | LICENSE.md | separate license from Readme | Mar 18, 2025 |
| LICENSE.md.meta | | LICENSE.md.meta | separate license from Readme | Mar 18, 2025 |
| README.md | | README.md | added Newtonsoft dependency to the package configuration | Mar 28, 2025 |
| README.md.meta | | README.md.meta | docs: update README with new client configurations and build instruct… | Mar 13, 2025 |
| Server.meta | | Server.meta | docs: update README with new client configurations and build instruct… | Mar 13, 2025 |
| package.json | | package.json | added Newtonsoft dependency to the package configuration | Mar 28, 2025 |
| package.json.meta | | package.json.meta | docs: update README with new client configurations and build instruct… | Mar 13, 2025 |
| View all files | | |
,/(/. *(/,
*/(((((/. *((((((*.
.*((((((((((/. *((((((((((/.
./((((((((((((((/ *((((((((((((((/,
,/(((((((((((((/*. */(((((((((((((/*.
,%%#((/((((((* ,/(((((/(#&@@(
,%%##%%##((((((/*. ,/((((/(#&@@@@@@(
,%%######%%##((/(((/*. .*/(((//(%@@@@@@@@@@@(
,%%####%#(%%#%%##((/((((((((//#&@@@@@@&@@@@@@@@(
,%%####%( /#%#%%%##(//(#@@@@@@@%, #@@@@@@@(
,%%####%( *#%###%@@@@@@( #@@@@@@@(
,%%####%( #%#%@@@@, #@@@@@@@(
,%%##%%%( #%#%@@@@, #@@@@@@@(
,%%%#* #%#%@@@@, *%@@@(
., ,/##*. #%#%@@@@, ./&@#* *`
,/#%#####%%#/, #%#%@@@@, ,/&@@@@@@@@@&\.
`*#########%%%%###%@@@@@@@@@@@@@@@@@@&*´
`*%%###########%@@@@@@@@@@@@@@&*´
`*%%%######%@@@@@@@@@@&*´
`*#%%##%@@@@@&*´
`*%#%@&*´
███╗ ███╗ ██████╗██████╗ ██╗ ██╗███╗ ██╗██╗████████╗██╗ ██╗
████╗ ████║██╔════╝██╔══██╗ ██║ ██║████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝
██╔████╔██║██║ ██████╔╝ ██║ ██║██╔██╗ ██║██║ ██║ ╚████╔╝
██║╚██╔╝██║██║ ██╔═══╝ ██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝
██║ ╚═╝ ██║╚██████╗██║ ╚██████╔╝██║ ╚████║██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
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.
MCP Unity currently provides the following tools:
MCP Unity currently provides the following resources:
Unity 2022.3 or later - to install the server
Node.js 18 or later - to start the server
npm 9 or later - to debug the server
Installing this MCP Unity Server is a multi-step process:
https://github.com/CoderGamester/mcp-unity.git
To run MCP Unity server, you'll need to have Node.js 18 or later installed on your computer:
Windows
Visit the Node.js download page
Download the Windows Installer (.msi) for the LTS version (recommended)
Verify the installation by opening PowerShell and running:
shell
node --version
npm --version
macOS
Visit the Node.js download page
Download the macOS Installer (.pkg) for the LTS version (recommended)
Alternatively, if you have Homebrew installed, you can run:
shell
brew install node@18
Verify the installation by opening Terminal and running:
shell
node --version
npm --version
Option 1: Configure using Unity Editor
Replace
ABSOLUTE/PATH/TO
with the absolute path to your MCP Unity installation.
The right configuration can be accessed in the Unity Editor MCP Server window (Tools > MCP Unity > Server Window)
Option 2: Configure via Smithery
To install MCP Unity via Smithery
:
Currently not available
Option 3: Configure Manually
Open the MCP configuration file of your AI client (e.g. claude_desktop_config.json in Claude Desktop) and copy the following text:
Replace
ABSOLUTE/PATH/TO
with the absolute path to your MCP Unity installation.
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [\
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"\
],
"env": {
"UNITY_PORT": "8090"
}
}
}
}
By default, the WebSocket server runs on port 8080. You can change this port in two ways:
Option 1: Using the Unity Editor
Option 2: Using the terminal
Set the UNITY_PORT environment variable in the terminal
powershell
$env:UNITY_PORT = "8090"
batchfile
set UNITY_PORT=8090
Restart the Node.js server
Building the Node.js Server
The MCP Unity server is built using Node.js . It requires to compile the TypeScript code to JavaScript in the build
directory. To build the server, open a terminal and:
Navigate to the Server directory:
shell
cd ABSOLUTE/PATH/TO/mcp-unity/Server
Install dependencies:
shell
npm install
Build the server:
shell
npm run build
Run the server:
shell
node build/index.js
Debugging with MCP Inspector
Debug the server with @modelcontextprotocol/inspector
:
$env:UNITY_PORT=8090; npx @modelcontextprotocol/inspector node Server/build/index.js
set UNITY_PORT=8090 && npx @modelcontextprotocol/inspector node Server/build/index.js
Don't forget to shutdown the server with Ctrl + C
before closing the terminal or debugging it with the MCP Inspector
.
Enable Console Logs
Enable logging on your terminal or into a log.txt file:
powershell
$env:LOGGING = "true"
$env:LOGGING_FILE = "true"
batchfile
set LOGGING=true
set LOGGING_FILE=true
Connection Issues
Server Not Starting
Menu Items Not Executing
If you have any questions or need support, please open an issue
on this repository.
Alternative you can reach out on
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue with your request.
Commit your changes following the Conventional Commits
format.
This project is under MIT License
MCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)
typescript
unity
mcp
cursor
copilot
claude
windsurf
unity-package
mcp-server
No releases published
No packages published
You can’t perform that action at this time.