MCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)
,/(/. *(/,
*/(((((/. *((((((*.
.*((((((((((/. *((((((((((/.
./((((((((((((((/ *((((((((((((((/,
,/(((((((((((((/*. */(((((((((((((/*.
,%%#((/((((((* ,/(((((/(#&@@(
,%%##%%##((((((/*. ,/((((/(#&@@@@@@(
,%%######%%##((/(((/*. .*/(((//(%@@@@@@@@@@@(
,%%####%#(%%#%%##((/((((((((//#&@@@@@@&@@@@@@@@(
,%%####%( /#%#%%%##(//(#@@@@@@@%, #@@@@@@@(
,%%####%( *#%###%@@@@@@( #@@@@@@@(
,%%####%( #%#%@@@@, #@@@@@@@(
,%%##%%%( #%#%@@@@, #@@@@@@@(
,%%%#* #%#%@@@@, *%@@@(
., ,/##*. #%#%@@@@, ./&@#* *`
,/#%#####%%#/, #%#%@@@@, ,/&@@@@@@@@@&\.
`*#########%%%%###%@@@@@@@@@@@@@@@@@@&*´
`*%%###########%@@@@@@@@@@@@@@&*´
`*%%%######%@@@@@@@@@@&*´
`*#%%##%@@@@@&*´
`*%#%@&*´
███╗ ███╗ ██████╗██████╗ ██╗ ██╗███╗ ██╗██╗████████╗██╗ ██╗
████╗ ████║██╔════╝██╔══██╗ ██║ ██║████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝
██╔████╔██║██║ ██████╔╝ ██║ ██║██╔██╗ ██║██║ ██║ ╚████╔╝
██║╚██╔╝██║██║ ██╔═══╝ ██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝
██║ ╚═╝ ██║╚██████╗██║ ╚██████╔╝██║ ╚████║██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
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:
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:
node --version
npm --version
brew install node@18
node --version
npm --version
To install MCP Unity via Smithery:
Currently not available
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)
To configure Cursor IDE:
Name: MCP Unity
Type: commmand
Command: env UNITY_PORT=8090 node ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js
To configure Claude Desktop:
To configure Windsurf IDE:
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"
],
"env": {
"UNITY_PORT": "8090"
}
}
}
}
You need to run the MCP Unity server for this to work, in the following ways:
mcp-unity
package directory in your device with the terminal.
cd ABSOLUTE/PATH/TO/mcp-unity
node Server/build/index.js
By default, the WebSocket server runs on port 8080. You can change this port in two ways:
$env:UNITY_PORT = "8090"
set UNITY_PORT=8090
The MCP Unity server is built using Node.js and TypeScript. 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:
cd ABSOLUTE/PATH/TO/mcp-unity/Server
Install dependencies:
npm install
Build the server:
npm run build
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
Enable logging on your terminal or into a log.txt file:
$env:LOGGING = "true"
$env:LOGGING_FILE = "true"
set LOGGING=true
set LOGGING_FILE=true
Don't forget to shutdown the server with Ctrl + C
before closing the terminal or debugging it with the @modelcontextprotocol/inspector.
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