Unity-MCP
by IvanMurzak·★ 2,767·综合分 57
Unity-MCP 通过 MCP 协议让 AI 代理直接在 Unity 编辑器和运行环境中工作。
概述
Unity-MCP 是一个全面的 MCP 服务器,将 Unity 游戏开发与 AI 功能连接起来。它提供大量工具,让 AI 代理可以操作 Unity 项目、创建游戏对象、修改资产,甚至在编译后的游戏运行时环境中工作。该服务器支持多个 AI 提供商,包括 Claude、OpenAI 和 Microsoft,无供应商锁定,并提供 CLI 用于快速设置。它能够在游戏内实现 AI 互动,为动态 NPC 行为和实时调试提供了可能性。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
如果你正在使用 Unity 开发,并希望将 AI 直接集成到开发工作流或游戏运行时中,Unity MCP 是理想选择。
什么时候不要选它
如果你不使用 Unity 或需要与其他游戏引擎集成 AI,则不应选择 Unity MCP。
此 server 暴露的工具
从 README 抽取出 12 个工具assets-copyCopy the asset at path and stores it at newPath
gameobject-createCreate a new GameObject in opened Prefab or in a Scene
scene-openOpen scene from the project asset file
script-update-or-createUpdates or creates script file with the provided C# code
reflection-method-callCall any C# method with input parameters and return results
editor-application-set-stateControl the Unity Editor application state (start/stop/pause playmode)
assets-findSearch the asset database using the search filter string
gameobject-modifyModify GameObjects and/or attached component's fields and properties
package-addInstall a package from the Unity Package Manager registry
tests-runExecute Unity tests (EditMode/PlayMode) with filtering and detailed results
screenshot-game-viewCaptures a screenshot from the Unity Editor Game View
reflection-method-findFind method in the project using C# Reflection (even private methods)
可对比工具
安装
安装
Unity 包
- [下载 Unity 包](https://github.com/IvanMurzak/Unity-MCP/releases/latest/download/AI-Game-Dev-Installer.unitypackage)
- 导入到您的 Unity 项目中
OpenUPM
openupm add com.ivanmurzak.unity.mcpCLI
# 安装 CLI
npm install -g unity-mcp-cli
# 在 Unity 项目中安装插件
unity-mcp-cli install-plugin ./MyUnityProject
# 设置 AI 技能
unity-mcp-cli setup-skills claude-code ./MyUnityProjectClaude Desktop 配置
添加到 claude_desktop_config.json:
{
"mcpServers": {
"unity-mcp": {
"command": "npx",
"args": ["unity-mcp-server"],
"env": {}
}
}
}FAQ
- Unity-MCP 是否能在运行时游戏中工作?
- 是的,与其他许多工具不同,Unity-MCP 能够在编译后的游戏内部工作,支持实时 AI 调试和玩家-AI 互动。
- 支持哪些 AI 提供商?
- Unity-MCP 支持 Anthropic (Claude)、OpenAI、Microsoft 等多家 AI 提供商的 AI 代理,无供应商锁定。
- 能否创建自定义工具?
- 是的,该服务器具有可扩展性 - 您可以通过将 C# 方法作为 MCP 工具来暴露,在项目代码中创建自定义工具。
Hacker News 讨论
开发者社区最近的相关讨论。
- 帖子 by IvanMurzak · 2025-04-19
Unity-MCP 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。