AI Skill Hub 强烈推荐:mcp-unity MCP工具 是一款优质的MCP工具。已获得 1.7k 颗 GitHub Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
基于Model Context Protocol的开源插件,集成Claude等AI助手与Unity编辑器,实现代码生成、游戏开发辅助和实时协作。适合游戏开发者和Unity程序员提升开发效率。
mcp-unity MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于Model Context Protocol的开源插件,集成Claude等AI助手与Unity编辑器,实现代码生成、游戏开发辅助和实时协作。适合游戏开发者和Unity程序员提升开发效率。
mcp-unity MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/CoderGamester/mcp-unity
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp-unity-mcp--": {
"command": "npx",
"args": ["-y", "mcp-unity"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 mcp-unity MCP工具 执行以下任务... Claude: [自动调用 mcp-unity MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp-unity_mcp__": {
"command": "npx",
"args": ["-y", "mcp-unity"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
| [🇺🇸English](README.md) | [🇨🇳简体中文](README_zh-CN.md) | [🇯🇵日本語](README-ja.md) |
|---|
,/(/. *(/,
*/(((((/. *((((((*.
.*((((((((((/. *((((((((((/.
./((((((((((((((/ *((((((((((((((/,
,/(((((((((((((/*. */(((((((((((((/*.
,%%#((/((((((* ,/(((((/(#&@@(
,%%##%%##((((((/*. ,/((((/(#&@@@@@@(
,%%######%%##((/(((/*. .*/(((//(%@@@@@@@@@@@(
,%%####%#(%%#%%##((/((((((((//#&@@@@@@&@@@@@@@@(
,%%####%( /#%#%%%##(//(#@@@@@@@%, #@@@@@@@(
,%%####%( *#%###%@@@@@@( #@@@@@@@(
,%%####%( #%#%@@@@, #@@@@@@@(
,%%##%%%( #%#%@@@@, #@@@@@@@(
,%%%#* #%#%@@@@, *%@@@(
., ,/##*. #%#%@@@@, ./&@#* *`
,/#%#####%%#/, #%#%@@@@, ,/&@@@@@@@@@&\.
`*#########%%%%###%@@@@@@@@@@@@@@@@@@&*´
`*%%###########%@@@@@@@@@@@@@@&*´
`*%%%######%@@@@@@@@@@&*´
`*#%%##%@@@@@&*´
`*%#%@&*´
███╗ ███╗ ██████╗██████╗ ██╗ ██╗███╗ ██╗██╗████████╗██╗ ██╗
████╗ ████║██╔════╝██╔══██╗ ██║ ██║████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝
██╔████╔██║██║ ██████╔╝ ██║ ██║██╔██╗ ██║██║ ██║ ╚████╔╝
██║╚██╔╝██║██║ ██╔═══╝ ██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝
██║ ╚═╝ ██║╚██████╗██║ ╚██████╔╝██║ ╚████║██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
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 Cursor, Windsurf, Claude Code, Codex CLI, GitHub Copilot, Google Antigravity, and OpenCode to execute operations within the Unity Editor.
[!NOTE] Project Paths with Spaces MCP Unity supports project paths containing spaces. However, if you experience connection issues, try moving your project to a path without spaces as a troubleshooting step. Examples: - ✅ Recommended:C:\Users\YourUser\Documents\UnityProjects\MyAwesomeGame- ✅ Supported:C:\Users\Your User\Documents\Unity Projects\My Awesome Game
Installing this MCP Unity Server is a multi-step process:
To run MCP Unity server, you'll need to have Node.js 18 or later installed on your computer:

<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Windows</span></summary>
1. Visit the Node.js download page 2. Download the Windows Installer (.msi) for the LTS version (recommended) 3. Run the installer and follow the installation wizard 4. Verify the installation by opening PowerShell and running:
node --version
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">macOS</span></summary>
1. Visit the Node.js download page 2. Download the macOS Installer (.pkg) for the LTS version (recommended) 3. Run the installer and follow the installation wizard 4. Alternatively, if you have Homebrew installed, you can run:
brew install node@18
5. Verify the installation by opening Terminal and running: node --version
</details>
https://github.com/CoderGamester/mcp-unity.git<details open> <summary><span style="font-size: 1.1em; font-weight: bold;">Option 1: Configure using Unity Editor</span></summary>

Global vs. Project configuration: > - Configure \[Client\] — writes to your global user config file (e.g.~/.claude.json). Uses an absolute path. Applies to all projects on your machine. Best for personal, single-developer setups. > - Configure \[Client\] (Project) — writes to a.mcp.jsonfile (or equivalent) in the Unity project root. Uses a relative path, so it works across machines. Intended to be committed to git and shared with the team. Best for collaborative projects or when you want the config to travel with the project. > > If in doubt, prefer the (Project) variant — the relative path is more portable and won't break if you move your project folder.
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Option 2: Configure Manually</span></summary>
Open the MCP configuration file of your AI client and add the MCP Unity server configuration:
ReplaceABSOLUTE/PATH/TOwith 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). For configs that live inside the Unity project tree and get committed to git (e.g.<project>/.vscode/mcp.json,<project>/opencode.json,<project>/.cursor/mcp.json,<project>/.mcp.json,<project>/.codex/config.toml), prefer a project-relative path so the same file works across machines. Toggle "Use relative path" in the Server Window to switch the copy-paste snippet between absolute and project-relative forms. The Configure GitHub Copilot, Configure OpenCode, Configure Cursor (Project), Configure Claude Code (Project), and Configure Codex CLI (Project) buttons already emit relative paths automatically. Project-local buttons (Cursor / Claude Code / Codex CLI) write the MCP server entry into the Unity project directory instead of your global user config, so other (non-Unity) projects don't see MCP connection-failure warnings. For Codex CLI (Project) specifically, you must approve the project trust prompt the first time you runcodexfrom the project root, otherwise Codex ignores<project>/.codex/config.toml.
For JSON-based clients (Cursor, Windsurf, Claude Code, GitHub Copilot, etc.):
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
]
}
}
}
For workspace-scoped VS Code / GitHub Copilot (.vscode/mcp.json), use ${workspaceFolder} so the path is portable across machines:
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"${workspaceFolder}/Library/PackageCache/com.gamelovers.mcp-unity@<hash>/Server~/build/index.js"
]
}
}
}
For Codex CLI (~/.codex/config.toml):
[mcp_servers.mcp-unity]
command = "node"
args = ["ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"]
For Cursor — project-local (.cursor/mcp.json in the Unity project root, project-relative path):
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"Library/PackageCache/com.gamelovers.mcp-unity@<hash>/Server~/build/index.js"
]
}
}
}
For Claude Code — project-local (.mcp.json in the Unity project root, project-relative path — Claude Code's team-shared MCP config):
{
"mcpServers": {
"mcp-unity": {
"command": "node",
"args": [
"Library/PackageCache/com.gamelovers.mcp-unity@<hash>/Server~/build/index.js"
]
}
}
}
For Codex CLI — project-local (.codex/config.toml in the Unity project root, project-relative path):
[mcp_servers.mcp-unity]
command = "node"
args = ["Library/PackageCache/com.gamelovers.mcp-unity@<hash>/Server~/build/index.js"]
Codex layers this file over the global~/.codex/config.toml, but only when the project is marked trusted. The first time youcdinto the project and runcodex, approve the trust prompt — otherwise Codex ignores.codex/config.toml.
For OpenCode (opencode.json in the Unity project root):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-unity": {
"type": "local",
"enabled": true,
"command": ["node", "Library/PackageCache/com.gamelovers.mcp-unity@<hash>/Server~/build/index.js"],
"environment": {}
}
}
}
Note: the @<hash> segment in the UPM package cache path changes when the package is updated. If you update MCP Unity, re-run the Configure button (or update the path manually) so the snippet points at the new cache directory.
</details>
By default, the WebSocket server runs on port '8090'. You can change this port in two ways:
By default, the timeout between the MCP server and the WebSocket is 10 seconds. You can change depending on the OS you are using:
[!TIP] The timeout between your AI Coding IDE (e.g., Claude Desktop, Cursor IDE, Windsurf IDE) and the MCP Server depends on the IDE.
By default, the WebSocket server binds to 'localhost'. To allow MCP bridge connections from other machines:
UNITY_HOST=192.168.1.100 node server.jsMCP Unity provides automatic integration with VSCode-like IDEs (Visual Studio Code, Cursor, Windsurf, Google Antigravity) by adding the Unity Library/PackedCache folder to your workspace. This feature:
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">What is MCP Unity?</span></summary>
MCP Unity is a powerful bridge that connects your Unity Editor environment to AI assistants LLM tools using the Model Context Protocol (MCP).
In essence, MCP Unity: - Exposes Unity Editor functionalities (like creating objects, modifying components, running tests, etc.) as "tools" and "resources" that an AI can understand and use. - Runs a WebSocket server inside Unity and a Node.js server (acting as a WebSocket client to Unity) that implements the MCP. This allows AI assistants to send commands to Unity and receive information back. - Enables you to use natural language prompts with your AI assistant to perform complex tasks within your Unity project, significantly speeding up development workflows.
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Why use MCP Unity?</span></summary>
MCP Unity offers several compelling advantages for developers, artists, and project managers:
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">How does MCP Unity compare with the upcoming Unity 6.2 AI features?</span></summary>
Unity 6.2 is set to introduce new built-in AI tools, including the previous Unity Muse (for generative AI capabilities like texture and animation generation) and Unity Sentis (for running neural networks in Unity runtime). As Unity 6.2 is not yet fully released, this comparison is based on publicly available information and anticipated functionalities:
- Complementary, Not Mutually Exclusive: MCP Unity and Unity's native AI tools can be seen as complementary. You might use MCP Unity with your AI coding assistant to set up a scene or batch-modify assets, and then use Unity AI tools to generate a specific texture, or to create animations, or 2D sprites for one of those assets. MCP Unity provides a flexible, protocol-based way to interact with the Editor, which can be powerful for developers who want to integrate with a broader range of external AI services or build custom automation workflows.
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">What MCP hosts and IDEs currently support MCP Unity?</span></summary>
MCP Unity is designed to work with any AI assistant or development environment that can act as an MCP client. The ecosystem is growing, but current known integrations or compatible platforms include: - Cursor - Windsurf - Claude Desktop - Claude Code - Codex CLI - GitHub Copilot - Google Antigravity - OpenCode
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Can I extend MCP Unity with custom tools for my project?</span></summary>
Yes, absolutely! One of the significant benefits of the MCP Unity architecture is its extensibility. - In Unity (C#): You can create new C# classes that inherit from McpToolBase (or a similar base for resources) to expose custom Unity Editor functionality. These tools would then be registered in McpUnityServer.cs. For example, you could write a tool to automate a specific asset import pipeline unique to your project. - In Node.js Server (TypeScript): You would then define the corresponding TypeScript tool handler in the Server/src/tools/ directory, including its Zod schema for inputs/outputs, and register it in Server/src/index.ts. This Node.js part will forward the request to your new C# tool in Unity.
This allows you to tailor the AI's capabilities to the specific needs and workflows of your game or application.
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Is MCP Unity free to use?</span></summary>
Yes, MCP Unity is an open-source project distributed under the MIT License. You are free to use, modify, and distribute it according to the license terms.
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Why am I unable to connect to MCP Unity?</span></summary>
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Why won't the MCP Unity server start?</span></summary>
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Why do I get a connection failed error when running Play Mode tests?</span></summary>
The run_tests tool returns the following response:
Error:
Connection failed: Unknown error
This error occurs because the bridge connection is lost when the domain reloads upon switching to Play Mode. The workaround is to turn off Reload Domain in Edit > Project Settings > Editor > "Enter Play Mode Settings".
</details>
<details> <summary><span style="font-size: 1.1em; font-weight: bold;">Why do some clients fail with <code>KeyError: 'position'</code> during tool initialization?</span></summary>
Some MCP clients may fail while parsing tool schemas when they contain local JSON pointer references such as #/properties/position.
MCP Unity avoids this by registering transform tool inputs (set_transform, move_gameobject, rotate_gameobject, scale_gameobject) with fresh nested vector schemas per field, so the generated schema does not rely on local #/properties/... references.
If you still see this error: - update your MCP client to the latest version, - rebuild the Node server (cd Server~ && npm run build), - confirm your package version includes this compatibility fix.
</details>
When running the MCP (Node.js) server inside WSL2 while Unity runs on Windows 11, connecting to ws://localhost:8090/McpUnity may fail with ECONNREFUSED.
Cause: WSL2 and Windows have separate network namespaces — localhost inside WSL2 does not point to the Windows host. By default, Unity listens on localhost:8090.
高质量游戏开发工具,创意融合MCP与Unity生态,1.7k Stars认可度高,持续维护活跃,值得推荐。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,mcp-unity MCP工具 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | mcp-unity |
| 原始描述 | 开源MCP工具:Model Context Protocol (MCP) plugin to connect with Unity Editor — designed for 。⭐1.7k · C# |
| Topics | 游戏开发MCP协议IDE集成AI编程助手Unity |
| GitHub | https://github.com/CoderGamester/mcp-unity |
| License | MIT |
| 语言 | C# |
收录时间:2026-05-18 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端