Integrations
Supports containerized deployment of the MCP server, allowing the Unity tools to be run in an isolated environment with proper project mounting.
Offers integration through the repository hosting, with the server code available at a GitHub repository (unity-smithery-mcp).
Built on Node.js as a runtime environment, requiring Node.js 16+ to operate.
Unity MCP 服务器
用于 Unity 游戏开发的模型上下文协议 (MCP) 服务器,使 AI 助手能够通过一组专门的工具与 Unity 项目进行交互。
概述
Unity MCP 服务器在 AI 助手(例如 Cursor AI 或 Claude)和 Unity 项目之间架起了一座桥梁。它提供以下工具:
- 在 Unity 项目中读取和搜索文件
- 解析 Unity 场景和预制件
- 分析 C# 代码并检测错误
- 以批处理模式运行自动化测试
- 从模板生成脚本
- 验证着色器
- 还有更多...
该服务器设计为以批处理模式与 Unity 一起运行,允许执行需要 Unity 引擎的操作而无需编辑器 GUI。
安装
先决条件
- Node.js 16+
- Unity 2022.3 LTS 或更新版本(推荐)
设置
- 克隆此存储库:Copy
- 安装依赖项:Copy
- 构建项目:Copy
配置
服务器使用config
包进行配置。编辑config/default.json
来调整设置:
用法
启动服务器
要在 Smithery 模式下运行:
与人工智能助手一起使用
此服务器主要用于通过 MCP 规范中定义的工具与 AI 助手协同工作。如需集成 Cursor 或 Smithery.ai,请按照其文档连接到此 MCP 服务器。
可用工具
工具名称 | 描述 |
---|---|
open_file | 读取 Unity 项目中文件的内容 |
search_files | 在项目文件中搜索文本模式 |
list_assets | 列出特定类型或文件夹中的项目资产 |
get_project_info | 获取有关 Unity 项目的高级信息 |
parse_scene | 解析 Unity 场景文件以提取游戏对象层次结构 |
parse_prefab | 解析 Unity 预制文件以提取组件 |
find_in_scenes | 查找包含特定 GameObject 或组件的场景 |
analyze_cs_code | 编译 C# 代码以查找编译器错误 |
find_references | 查找对 C# 类或方法的引用 |
generate_script | 从模板创建一个新的 C# 脚本文件 |
validate_shader | 编译着色器并报告错误 |
inspect_yaml | 检查 YAML 资产文件 |
run_tests | 以批处理模式运行 Unity 的自动化测试 |
simulate_playmode | 实验 - 短时间以播放模式运行场景 |
Docker 支持
包含用于容器化部署的 Dockerfile。构建 Docker 镜像:
运行容器:
Smithery.ai 集成
可以使用提供的smithery.yaml
配置将此服务器部署在 Smithery.ai 上。
执照
麻省理工学院
贡献
欢迎贡献!请打开一个问题或提交一个拉取请求。
This server cannot be installed
连接 AI 助手和 Unity 项目的协议服务器,允许它们通过专门的工具分析代码、解析场景、生成脚本和执行其他 Unity 操作。
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that connects Claude and other AI assistants to your Notion workspace, allowing AIs to interact with databases, pages, and blocks.Last updated -12647JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -1Python
- -securityAlicense-qualityA Unity Master Control Protocol implementation that allows AI agents to control and interact with Unity, enabling them to execute code, query editor state, modify GameObjects, and capture screenshots through a WebSocket-based communication system.Last updated -7MIT License
- -securityAlicense-qualityA server that enables AI assistants to understand and interact with Unity projects in real-time, providing access to scene hierarchy, project settings, and the ability to execute code directly in the Unity Editor.Last updated -40MIT License