Skip to main content
Glama

Unity MCP Server

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

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

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

  1. 特征
    1. 入门
      1. 先决条件
      2. 安装
      3. 运行服务器
    2. 配置
      1. API 工具
        1. 创建 Unity 项目
        2. 开放 Unity 项目
        3. 创建 Unity 场景
        4. 创建 Unity 预制件
        5. 生成 Unity 脚本
      2. Docker 支持
        1. 执照

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            A starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.
            Last updated -
            1
            6
            9
            TypeScript
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI assistants like Claude to interact with Zulip workspaces, supporting capabilities such as posting messages, listing channels, sending direct messages, and accessing conversation history.
            Last updated -
            JavaScript
            Apache 2.0
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI assistants to interact with the Godot game engine, allowing them to launch the editor, run projects, capture debug output, and control project execution.
            Last updated -
            62
            JavaScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that provides access to Unity Catalog Functions, allowing AI assistants to list, get, create, and delete functions within Unity Catalog directly through a standardized interface.
            Last updated -
            8
            Python
            MIT License

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/GrandMasterK414/unity-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server