{"id":26528575,"url":"https://github.com/CoderGamester/mcp-unity","last_synced_at":"2025-03-21T16:02:37.334Z","repository":{"id":282323219,"uuid":"948148972","full_name":"CoderGamester/mcp-unity","owner":"CoderGamester","description":"MCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)","archived":false,"fork":false,"pushed_at":"2025-03-21T00:39:31.000Z","size":160,"stargazers_count":77,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-21T01:28:49.253Z","etag":null,"topics":["claude","copilot","cursor","mcp","mcp-server","typescript","unity","unity-package","windsurf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderGamester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-13T20:41:25.000Z","updated_at":"2025-03-21T00:57:08.000Z","dependencies_parsed_at":"2025-03-14T00:42:01.702Z","dependency_job_id":null,"html_url":"https://github.com/CoderGamester/mcp-unity","commit_stats":null,"previous_names":["codergamester/mcp-unity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2Fmcp-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2Fmcp-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2Fmcp-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2Fmcp-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderGamester","download_url":"https://codeload.github.com/CoderGamester/mcp-unity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825629,"owners_count":20516591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","copilot","cursor","mcp","mcp-server","typescript","unity","unity-package","windsurf"],"created_at":"2025-03-21T16:01:35.520Z","updated_at":"2025-03-21T16:02:37.327Z","avatar_url":"https://github.com/CoderGamester.png","language":"C#","readme":"# MCP Unity [![](https://img.shields.io/badge/LinkedIn-0077B5?style=flat\u0026logo=linkedin\u0026logoColor=white 'LinkedIn')](https://www.linkedin.com/in/miguel-tomas/)\n\n[![](https://badge.mcpx.dev?type=server 'MCP Server')](https://modelcontextprotocol.io/introduction)\n[![smithery badge](https://smithery.ai/badge/@CoderGamester/mcp-unity)](https://smithery.ai/server/@CoderGamester/mcp-unity)\n[![](https://img.shields.io/badge/Unity-000000?style=flat\u0026logo=unity\u0026logoColor=white 'Unity')](https://unity.com/releases/editor/archive)\n[![](https://img.shields.io/badge/Node.js-339933?style=flat\u0026logo=nodedotjs\u0026logoColor=white 'Node.js')](https://nodejs.org/en/download/)\n[![](https://img.shields.io/badge/TypeScript-3178C6?style=flat\u0026logo=typescript\u0026logoColor=white 'TypeScript')](https://www.typescriptlang.org/)\n[![](https://img.shields.io/badge/WebSocket-4353FF?style=flat\u0026logo=socket.io\u0026logoColor=white 'WebSocket')](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)\n\n[![](https://img.shields.io/github/last-commit/CoderGamester/mcp-unity 'Last Commit')](https://github.com/CoderGamester/mcp-unity/commits/main)\n[![](https://img.shields.io/github/stars/CoderGamester/mcp-unity 'Stars')](https://github.com/CoderGamester/mcp-unity/stargazers)\n[![](https://img.shields.io/github/forks/CoderGamester/mcp-unity 'Forks')](https://github.com/CoderGamester/mcp-unity/network/members)\n[![](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT)\n\n```                                                                        \n                              ,/(/.   *(/,                                  \n                          */(((((/.   *((((((*.                             \n                     .*((((((((((/.   *((((((((((/.                         \n                 ./((((((((((((((/    *((((((((((((((/,                     \n             ,/(((((((((((((/*.           */(((((((((((((/*.                \n            ,%%#((/((((((*                    ,/(((((/(#\u0026@@(                \n            ,%%##%%##((((((/*.             ,/((((/(#\u0026@@@@@@(                \n            ,%%######%%##((/(((/*.    .*/(((//(%@@@@@@@@@@@(                \n            ,%%####%#(%%#%%##((/((((((((//#\u0026@@@@@@\u0026@@@@@@@@(                \n            ,%%####%(    /#%#%%%##(//(#@@@@@@@%,   #@@@@@@@(                \n            ,%%####%(        *#%###%@@@@@@(        #@@@@@@@(                \n            ,%%####%(           #%#%@@@@,          #@@@@@@@(                \n            ,%%##%%%(           #%#%@@@@,          #@@@@@@@(                \n            ,%%%#*              #%#%@@@@,             *%@@@(                \n            .,      ,/##*.      #%#%@@@@,     ./\u0026@#*      *`                \n                ,/#%#####%%#/,  #%#%@@@@, ,/\u0026@@@@@@@@@\u0026\\.                    \n                 `*#########%%%%###%@@@@@@@@@@@@@@@@@@\u0026*´                   \n                    `*%%###########%@@@@@@@@@@@@@@\u0026*´                        \n                        `*%%%######%@@@@@@@@@@\u0026*´                            \n                            `*#%%##%@@@@@\u0026*´                                 \n                               `*%#%@\u0026*´                                     \n                                                       \n     ███╗   ███╗ ██████╗██████╗         ██╗   ██╗███╗   ██╗██╗████████╗██╗   ██╗\n     ████╗ ████║██╔════╝██╔══██╗        ██║   ██║████╗  ██║██║╚══██╔══╝╚██╗ ██╔╝\n     ██╔████╔██║██║     ██████╔╝        ██║   ██║██╔██╗ ██║██║   ██║    ╚████╔╝ \n     ██║╚██╔╝██║██║     ██╔═══╝         ██║   ██║██║╚██╗██║██║   ██║     ╚██╔╝  \n     ██║ ╚═╝ ██║╚██████╗██║             ╚██████╔╝██║ ╚████║██║   ██║      ██║   \n     ╚═╝     ╚═╝ ╚═════╝╚═╝              ╚═════╝ ╚═╝  ╚═══╝╚═╝   ╚═╝      ╚═╝   \n```\n\nMCP 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.\n\n## Features\nMCP Unity currently provides the following tools:\n\n- **execute_menu_item**: Executes Unity menu items (functions tagged with the MenuItem attribute)\n- **select_object**: Selects game objects in the Unity hierarchy\n- **package_manager**: Installs, removes, and updates packages in the Unity Package Manager\n- **run_tests**: Runs tests using the Unity Test Runner\n- **notify_message**: Displays messages in the Unity Editor\n\nMCP Unity currently provides the following resources:\n\n- **get_menu_items**: Retrieves a list of all available menu items in the Unity Editor to facilitate **execute_menu_item** tool\n- **get_hierarchy**: Retrieves a list of all game objects in the Unity hierarchy\n- **get_console_logs**: Retrieves a list of all logs from the Unity console\n- **get_packages**: Retrieves information about installed and available packages from the Unity Package Manager\n- **get_assets**: Retrieves information about assets in the Unity Asset Database\n- **get_tests**: Retrieves information about tests in the Unity Test Runner\n\n## Requirements\n- Unity 2022.3 or later\n- Node.js 18 or later (for running the server)\n- npm 9 or later (for building the server)\n\n## Installation\n\n### Installing the Unity MCP Server package via Unity Package Manager\n1. Open the Unity Package Manager (Window \u003e Package Manager)\n2. Click the \"+\" button in the top-left corner\n3. Select \"Add package from git URL...\"\n4. Enter: `https://github.com/CoderGamester/mcp-unity.git`\n5. Click \"Add\"\n\n![package manager](https://github.com/user-attachments/assets/a72bfca4-ae52-48e7-a876-e99c701b0497)\n\n\n### Installing Node.js \n\u003e To run MCP Unity server, you'll need to have Node.js 18 or later installed on your computer:\n\n#### Windows\n1. Visit the [Node.js download page](https://nodejs.org/en/download/)\n2. Download the Windows Installer (.msi) for the LTS version (recommended)\n3. Run the installer and follow the installation wizard\n4. Verify the installation by opening PowerShell and running:\n   ```bash\n   node --version\n   npm --version\n   ```\n\n#### macOS\n1. Visit the [Node.js download page](https://nodejs.org/en/download/)\n2. Download the macOS Installer (.pkg) for the LTS version (recommended)\n3. Run the installer and follow the installation wizard\n4. Alternatively, if you have Homebrew installed, you can run:\n   ```bash\n   brew install node@18\n   ```\n5. Verify the installation by opening Terminal and running:\n   ```bash\n   node --version\n   npm --version\n   ```\n\n### Installing via Smithery\n\nTo install MCP Unity via [Smithery](https://smithery.ai/server/@CoderGamester/mcp-unity):\n\n```\nCurrently not available\n```\n\n## Configure MCP Server\n\n\u003e Replace `ABSOLUTE/PATH/TO` with the absolute path to your MCP Unity installation.\n\nThe right configuration can be accessed in the Unity Editor MCP Server window (Tools \u003e MCP Unity \u003e Server Window)\n\n![MCP configuration](https://github.com/user-attachments/assets/ea9bb912-94a7-4409-81c1-3af39158dac0)\n\n\n### Configure your AI client\n\nTo configure Cursor IDE:\n- Add the following configuration to your Cursor MCP Configure settings:\n\n```\nName: MCP Unity\nType: commmand\nCommand: env UNITY_PORT=8090 node ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js\n```\n\nTo configure Claude Desktop:\n- Open the MCP configuration file (claude_desktop_config.json) in Claude Desktop Developer in (File \u003e Settings \u003e Developer \u003e Edit Config)\n\nTo configure Windsurf IDE:\n- Open the MCP configuration file (mcp_config.json) in Windsurf IDE in (Windsurf Settings \u003e Advanced Settings \u003e General \u003e Add Sever)\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-unity\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"ABSOLUTE/PATH/TO/mcp-unity/Server/build/index.js\"\n      ],\n      \"env\": {\n        \"UNITY_PORT\": \"8090\"\n      }\n    }\n  }\n}\n```\n\n## Running the Server\nYou need to run the MCP Unity server for this to work, in the following ways:\n\n### Start Node.js Server\n\n1. Navigate to this `mcp-unity` package directory in your device with the terminal.\n   ```bash\n   cd ABSOLUTE/PATH/TO/mcp-unity\n   ```\n2. Run the server using Node.js:\n   ```bash\n   node Server/build/index.js\n   ```\n\n### Start Unity Editor MCP Server\n1. Open the Unity Editor\n2. Navigate to Tools \u003e MCP Unity \u003e Server Window\n3. Click \"Start Server\" to start the WebSocket server\n   \n![connect](https://github.com/user-attachments/assets/2e266a8b-8ba3-4902-b585-b220b11ab9a2)\n\n## Configure the WebSocket Port\nBy default, the WebSocket server runs on port 8080. You can change this port in two ways:\n\n### Option 1: Using the Unity Editor\n1. Open the Unity Editor\n2. Navigate to Tools \u003e MCP Unity \u003e Server Window\n3. Change the \"WebSocket Port\" value to your desired port number\n4. Unity will setup the system environment variable UNITY_PORT to the new port number\n5. Restart the Node.js server\n6. Click again on \"Start Server\" to reconnect the Unity Editor web socket to the Node.js MCP Server\n\n### Option 2: Change the system environment variable UNITY_PORT in the terminal\n1. Set the UNITY_PORT environment variable in the terminal\n   - Powershell\n   ```powershell\n   $env:UNITY_PORT = \"8090\"\n   ```\n   - Command Prompt/Terminal\n   ```cmd\n   set UNITY_PORT=8090\n   ```\n2. Restart the Node.js server\n3. Click again on \"Start Server\" to reconnect the Unity Editor web socket to the Node.js MCP Server\n\n## Building and Debugging the Server\nThe MCP Unity server is built using Node.js and TypeScript. It requires to compile the TypeScript code to JavaScript in the `build` directory.\nTo build the server, open a terminal and:\n\n1. Navigate to the Server directory:\n   ```bash\n   cd ABSOLUTE/PATH/TO/mcp-unity/Server\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Build the server:\n   ```bash\n   npm run build\n   ```\n\n### Debugging\n   \n1. Debug the server with [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector):\n   ```bash\n   npx @modelcontextprotocol/inspector node build/index.js\n   ```\n\n2. Enable logging on your terminal or into a log.txt file:\n   - Powershell\n   ```powershell\n   $env:LOGGING = \"true\"\n   $env:LOGGING_FILE = \"true\"\n   ```\n   - Command Prompt/Terminal\n   ```cmd\n   set LOGGING=true\n   set LOGGING_FILE=true\n   ```\n\nDon't forget to shutdown the server with `Ctrl + C` before closing the terminal or debugging it with the [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector).\n\n## Troubleshooting\n\n### Connection Issues\n- Ensure the WebSocket server is running (check the Server Window in Unity)\n- Check if there are any firewall restrictions blocking the connection\n- Make sure the port number is correct (default is 8080)\n- Change the port number in the Unity Editor MCP Server window. (Tools \u003e MCP Unity \u003e Server Window)\n\n### Server Not Starting\n- Check the Unity Console for error messages\n- Ensure Node.js is properly installed and accessible in your PATH\n- Verify that all dependencies are installed in the Server directory\n\n### Menu Items Not Executing\n- Ensure the menu item path is correct (case-sensitive)\n- Check if the menu item requires confirmation\n- Verify that the menu item is available in the current context\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request or open an Issue with your request.\n\n**Commit your changes** following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.\n\n## License\n\nThis project is under MIT license\n","funding_links":[],"categories":["Gaming","Development Tools MCP Servers","サーバー実装","📚 Projects (1974 total)","Community Servers","MCP 服务器精选列表","Gaming and Game Development","🎮 \u003ca name=\"gaming\"\u003e\u003c/a\u003eGaming","Legend","📦 Other","MCP Clients","Containerised MCP Servers","Table of Contents","🗂️ Extensions by Category","MCP Servers \u0026 Protocol","Uncategorized"],"sub_categories":["Trading \u0026 Exchanges","🎮 \u003ca name=\"gaming\"\u003e\u003c/a\u003e ゲーミング","MCP Servers","🏃 体育与游戏","🎮 \u003ca name=\"gaming\"\u003e\u003c/a\u003eGaming","IDE Extensions \u0026 Code Assistants","AI \u0026 Machine Learning","Gaming","🎨 Media Creation","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoderGamester%2Fmcp-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCoderGamester%2Fmcp-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoderGamester%2Fmcp-unity/lists"}