MCP Server to control and interact with Unity3d Game Engine for game development
English | ๐จ๐ณ็ฎไฝไธญๆ | ๐ฏ๐ตๆฅๆฌ่ช |
---|
,/(/. *(/,
*/(((((/. *((((((*.
.*((((((((((/. *((((((((((/.
./((((((((((((((/ *((((((((((((((/,
,/(((((((((((((/*. */(((((((((((((/*.
,%%#((/((((((* ,/(((((/(#&@@(
,%%##%%##((((((/*. ,/((((/(#&@@@@@@(
,%%######%%##((/(((/*. .*/(((//(%@@@@@@@@@@@(
,%%####%#(%%#%%##((/((((((((//#&@@@@@@&@@@@@@@@(
,%%####%( /#%#%%%##(//(#@@@@@@@%, #@@@@@@@(
,%%####%( *#%###%@@@@@@( #@@@@@@@(
,%%####%( #%#%@@@@, #@@@@@@@(
,%%##%%%( #%#%@@@@, #@@@@@@@(
,%%%#* #%#%@@@@, *%@@@(
., ,/##*. #%#%@@@@, ./&@#* *`
,/#%#####%%#/, #%#%@@@@, ,/&@@@@@@@@@&\.
`*#########%%%%###%@@@@@@@@@@@@@@@@@@&*ยด
`*%%###########%@@@@@@@@@@@@@@&*ยด
`*%%%######%@@@@@@@@@@&*ยด
`*#%%##%@@@@@&*ยด
`*%#%@&*ยด
โโโโ โโโโ โโโโโโโโโโโโโโ โโโ โโโโโโโ โโโโโโโโโโโโโโโโโโ โโโ
โโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโ
โโโโโโโโโโโโโโ โโโโโโโโ โโโ โโโโโโโโโ โโโโโโ โโโ โโโโโโโ
โโโโโโโโโโโโโโ โโโโโโโ โโโ โโโโโโโโโโโโโโโโ โโโ โโโโโ
โโโ โโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโ โโโ โโโ
โโโ โโโ โโโโโโโโโโ โโโโโโโ โโโ โโโโโโโโ โโโ โโโ
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 provides automatic integration with VSCode-like IDEs (Visual Studio Code, Cursor, Windsurf) by adding the Unity Library/PackedCache
folder to your workspace. This feature:
execute_menu_item
: Executes Unity menu items (functions tagged with the MenuItem attribute)
Example prompt: "Execute the menu item 'GameObject/Create Empty' to create a new empty GameObject"
select_gameobject
: Selects game objects in the Unity hierarchy by path or instance ID
Example prompt: "Select the Main Camera object in my scene"
update_component
: Updates component fields on a GameObject or adds it to the GameObject if it does not contain the component
Example prompt: "Add a Rigidbody component to the Player object and set its mass to 5"
add_package
: Installs new packages in the Unity Package Manager
Example prompt: "Add the TextMeshPro package to my project"
run_tests
: Runs tests using the Unity Test Runner
Example prompt: "Run all the EditMode tests in my project"
notify_message
: Displays messages in the Unity Editor
Example prompt: "Send a notification to Unity that the task has been completed"
add_asset_to_scene
: Adds an asset from the AssetDatabase to the Unity scene
Example prompt: "Add the Player prefab from my project to the current scene"
unity://menu-items
: Retrieves a list of all available menu items in the Unity Editor to facilitate execute_menu_item
tool
Example prompt: "Show me all available menu items related to GameObject creation"
unity://hierarchy
: Retrieves a list of all game objects in the Unity hierarchy
Example prompt: "Show me the current scene hierarchy structure"
unity://gameobject/{id}
: Retrieves detailed information about a specific GameObject by instance ID or object path in the scene hierarchy, including all GameObject components with it's serialized properties and fields
Example prompt: "Get me detailed information about the Player GameObject"
unity://logs
: Retrieves a list of all logs from the Unity console
Example prompt: "Show me the recent error messages from the Unity console"
unity://packages
: Retrieves information about installed and available packages from the Unity Package Manager
Example prompt: "List all the packages currently installed in my Unity project"
unity://assets
: Retrieves information about assets in the Unity Asset Database
Example prompt: "Find all texture assets in my project"
unity://tests/{testMode}
: Retrieves information about tests in the Unity Test Runner
Example prompt: "List all available tests in my Unity project"
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:
node --version
brew install node@18
node --version
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 or just copy the text from the Unity Editor MCP Server window (Tools > MCP Unity > Server Window).
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js"
]
}
}
}
When the AI client connects to the WebSocket server, it will automatically show in the green box in the window
By default, the WebSocket server runs on port 8090. 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 . 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
Run the server:
node build/index.js
Debug the server with @modelcontextprotocol/inspector:
npx @modelcontextprotocol/inspector node Server/build/index.js
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.
$env:LOGGING = "true"
$env:LOGGING_FILE = "true"
set LOGGING=true
set LOGGING_FILE=true
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
Retrieving and analyzing issues from Sentry.io
Create crafted UI components inspired by the best 21st.dev design engineers.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMaticโs API.
Flag features, manage company data, and control feature access using Bucket
Enable AI Agents to fix build failures from CircleCI.
Query and analyze your Opik logs, traces, prompts and all other telemtry data from your LLMs in natural language.
Run code in secure sandboxes hosted by E2B
Tool platform by IBM to build, test and deploy tools for any data source
Run Python in a code sandbox.