AU

akiojin/unity-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

34 stars 8 forks 质量 83 趋势 32MIT

[已弃用]Unity MCP 服务器 — 继任者:akiojin/unity-cli

概览

开发已迁移至akiojin/unity-cli。该仓库将不再接收更新。请迁移到继任项目。 Unity MCP 服务器允许基于 LLM 的客户端自动化 Unity 编辑器。它专注于可靠、可脚本化的工作流程,界面简单,配置零或低配置。 - : 创建/修改场景、游戏对象、组件、预制件、材质 - : 定位并交互界面,验证界面状态 - : 用于测试游戏模式的键盘/鼠标/手柄/触控(仅输入系统) - : 从游戏/场景/资源管理器/窗口视图获取确定性截图 - : 安全结构化编辑和由捆绑的 C# LSP 驱动的准确符号/搜索(无

概述(AI 翻译)

[!警告] 本仓库已被弃用。 开发已迁移至akiojin/unity-cli。 本仓库将不再接收更新。请迁移到后续项目。

英文 |日本語

概述

Unity MCP 服务器允许基于 LLM 的客户端自动化 Unity 编辑器。它专注于可靠、可脚本化的工作流程,界面简单,配置零或低配置。

它能做什么

  • 编辑器自动化:创建/修改场景、游戏对象、组件、预制件、材质
  • UI 自动化:定位并交互 UI,验证 UI 状态
  • 输入模拟:键盘/鼠标/手柄/触控用于测试游戏模式(仅限输入系统)
  • 视觉捕捉:游戏/场景/资源管理器/窗口视图的确定性截图
  • 代码库感知:安全的结构化编辑和由捆绑的 C# LSP 驱动的准确符号/搜索(无需 .sln 文件)
  • 项目控制:读取/更新项目/编辑器设置;读取日志,监控编译
  • 可寻址管理:注册/组织资产,管理组,构建自动化

表演

代码索引工具的性能优于标准文件操作:

|操作 |代码索引工具 |标准工具 |优势 |

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Unity MCP Server

[!WARNING] This repository is deprecated. Development has moved to akiojin/unity-cli. This repository will no longer receive updates. Please migrate to the successor project.

English | 日本語

Overview

Unity MCP Server lets LLM-based clients automate the Unity Editor. It focuses on reliable, scriptable workflows with a simple interface and zero or low-configuration setup.

What It Can Do

  • Editor automation: Create/modify scenes, GameObjects, components, prefabs, materials
  • UI automation: Locate and interact with UI, validate UI state
  • Input simulation: Keyboard/mouse/gamepad/touch for playmode testing (Input System only)
  • Visual capture: Deterministic screenshots from Game/Scene/Explorer/Window views
  • Code base awareness: Safe structured edits and accurate symbol/search powered by bundled C# LSP (no .sln file required)
  • Project control: Read/update project/editor settings; read logs, monitor compilation
  • Addressables management: Register/organize assets, manage groups, build automation

Performance

Code index tools outperform standard file operations:

Operation Code Index Tool Standard Tool Advantage
Symbol lookup find_symbol grep Instant vs 350ms
Reference search find_refs grep Structured results
Code search search grep 3-5x smaller responses

Key benefits:

  • 128,040 files indexed with 100% coverage
  • Non-blocking background index builds (Worker Threads)
  • LLM-optimized output with pagination and size limits

For detailed benchmarks, see docs/benchmark-results-2025-12-13.md

Requirements

  • Unity 2020.3 LTS or newer
  • Node.js 18.x / 20.x / 22.x / 24.x LTS (25+ not supported)
  • Claude Desktop or another MCP-compatible client

Installation

Unity Package

Package Manager → Add from git URL:

https://github.com/akiojin/unity-mcp-server.git?path=UnityMCPServer/Packages/unity-mcp-server

Or via OpenUPM:

openupm add com.akiojin.unity-mcp-server

MCP Client Configuration

Configure your MCP client (Claude Desktop example):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "unity-mcp-server": {
      "command": "npx",
      "args": ["@akiojin/unity-mcp-server@latest"]
    }
  }
}

HTTP Mode (for HTTP-only networks)

npx @akiojin/unity-mcp-server --http 6401 --no-telemetry
curl http://localhost:6401/healthz

Quick Start

  1. Install the Unity package (Git URL or OpenUPM)
  2. Configure your MCP client with the JSON above
在 GitHub 查看完整 README

安装

npx @akiojin/unity-mcp-server@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "unity-mcp-server": { "command": "npx", "args": ["@akiojin/unity-mcp-server@latest"] } } }