Unity MCP Server

Integrations

  • Supports deployment through Docker with configuration options, allowing the server to be containerized and run in isolated environments.

  • Enables repository interactions for cloning the Unity MCP server codebase as part of the installation process.

  • Supports accessing and cloning the Unity MCP server repository from GitHub as part of the setup workflow.

Smithery.ai 的 Unity MCP 服务器

用于 Unity 游戏开发的综合模型上下文协议 (MCP) 服务器,提供项目管理、场景编辑、预制件创建、脚本生成等工具。

特征

  • 项目管理:创建并打开 Unity 项目
  • 场景编辑:创建和修改 Unity 场景
  • 预制件创建:使用可定制组件生成预制件
  • 脚本生成:使用各种模板(MonoBehaviour、ScriptableObject、EditorWindow)创建 C# 脚本
  • Smithery.ai 集成:与 Smithery.ai 平台完全兼容

入门

先决条件

  • Node.js 18 或更高版本
  • Unity 已安装(用于实际的 Unity 操作)

安装

  1. 克隆存储库:
git clone https://github.com/GrandMasterK414/unity-mcp-server.git cd unity-mcp-server
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

运行服务器

本地开发

npm run dev

Smithery.ai部署

npm run smithery:start

或者使用 Docker:

docker-compose up -d

配置

可以通过环境变量配置服务器:

  • SMITHERY :设置为“true”以启用 Smithery 模式(使用 WebSocket 传输)
  • PORT :WebSocket 服务器端口(默认值:3000)
  • UNITY_PROJECTS_PATH :存储 Unity 项目的目录
  • SCRIPT_ROOT :存储脚本模板的目录

API 工具

创建 Unity 项目

使用指定的配置创建一个新的 Unity 项目。

{ "name": "MyGameProject", "path": "./projects", "unityVersion": "2022.3.5f1" }

开放 Unity 项目

打开现有的 Unity 项目。

{ "path": "./projects/MyGameProject" }

创建 Unity 场景

创建一个新的 Unity 场景。

{ "name": "MainLevel", "projectPath": "./projects/MyGameProject" }

创建 Unity 预制件

创建一个新的 Unity 预制件。

{ "name": "EnemyCharacter", "projectPath": "./projects/MyGameProject", "components": ["Rigidbody", "MeshRenderer", "BoxCollider"] }

生成 Unity 脚本

为 Unity 生成一个新的 C# 脚本。

{ "name": "PlayerController", "projectPath": "./projects/MyGameProject", "scriptType": "MonoBehaviour", "template": "// Optional custom template content" }

Docker 支持

可以使用 Docker 部署服务器:

# Build the Docker image docker build -t unity-mcp-server . # Run the container docker run -p 3000:3000 -d unity-mcp-server

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

-
security - not tested
F
license - not found
-
quality - not tested

用于 Unity 游戏开发的模型上下文协议服务器,使用户能够通过与 Smithery.ai 的自然语言集成来管理项目、编辑场景、创建预制件和生成脚本。

  1. Features
    1. Getting Started
      1. Prerequisites
      2. Installation
      3. Running the Server
    2. Configuration
      1. API Tools
        1. Create Unity Project
        2. Open Unity Project
        3. Create Unity Scene
        4. Create Unity Prefab
        5. Generate Unity Script
      2. Docker Support
        1. License
          ID: x6qf49foir