Unity MCP 服务器
连接 Claude 和 Unity 项目的 MCP 服务器,基于 TypeScript 开发。
快速入门
方法 1:使用 NPX(推荐)
运行以下命令直接启动工具:
npx unity-mcp@latest
在 Claude 配置文件中添加:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
内容如下:
{
"mcpServers": {
"unity": {
"command": "npx",
"args": ["unity-mcp@latest"]
}
}
}
方法 2:本地运行
克隆仓库并安装依赖: git clone https://github.com/your-username/unity-mcp.git cd unity-mcp bun install 配置 Claude 使用本地版本: { "mcpServers": { "unity": { "command": "bun", "args": ["run", "C:\Users\Artga\Code\unity-mcp\src\index.ts"] } } }
要求
- 已安装 Unity 和配置项目
- 已安装 Bun 运行时
调试
推荐使用 MCP Inspector 调试。 bun run inspector