unity-mcp-server

unity-mcp-server

Unity MCP Server enables LLM-based clients to automate the Unity Editor, including scene manipulation, UI testing, input simulation, and code editing.

Category
访问服务器

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
  3. Open your Unity project (package starts TCP listener on port 6400)
  4. Launch your MCP client (it connects to the Node server)
  5. Test the connection with ping

Tip: npx @akiojin/unity-mcp-server@latest downloads and runs the latest build without cloning.

Architecture

┌────────────────┐        JSON-RPC (MCP)        ┌──────────────────────┐
│  MCP Client    │ ───────────────────────────▶ │  Node MCP Server     │
│ (Claude/Codex/ │ ◀─────────────────────────── │ (@akiojin/unity-     │
│   Cursor …)    │        tool responses        │ mcp-server)          │
└────────────────┘                              └──────────┬───────────┘
                                                         TCP│6400
                                                            ▼
                                                   ┌───────────────────┐
                                                   │  Unity Editor     │
                                                   │  (Package opens   │
                                                   │   TCP listener)   │
                                                   └───────────────────┘

Configuration

Configuration is optional; defaults work without any config file.

Node-side configuration uses environment variables only, and Unity-side host/port lives in Project Settings.

See docs/configuration.md.

Tools

Unity MCP Server ships 100+ tools. Use the search_tools meta-tool to discover the right tool quickly.

For clients with strict tool-count limits, you can filter exposed tools by category:

export UNITY_MCP_TOOL_INCLUDE_CATEGORIES=system,scene,gameobject,analysis,script
export UNITY_MCP_TOOL_EXCLUDE_CATEGORIES=ui,input,addressables,video,screenshot,profiler

See docs/tools.md for discovery tips and the recommended Code Index workflow.

Note: find_refs supports paging via startAfter and returns cursor when results are truncated.

Claude Code Skills

This package includes Claude Code skills that provide workflow-oriented guidance for effectively using the 108+ tools.

Available Skills

Skill Description Triggers
mcp-server-development Build MCP servers (TypeScript SDK), implement tools/resources/prompts, JSON-RPC patterns "MCP server", "tool handler", "JSON-RPC", "TypeScript"
unity-csharp-editing C# script editing, search, refactoring with TDD workflow "C# edit", "script search", "refactoring"
unity-scene-management Scene, GameObject, Component management "scene create", "GameObject", "component add"
unity-playmode-testing PlayMode control, input simulation, UI automation "playmode", "input simulate", "UI click"
unity-asset-management Prefab, Material, Addressables management "prefab create", "material", "Addressables"
unity-editor-imgui-design Unity Editor IMGUI for EditorWindow/Inspector/PropertyDrawer (not for in-game UI) "EditorWindow", "Custom Inspector", "PropertyDrawer", "IMGUI"
unity-game-ugui-design In-game uGUI (Canvas/RectTransform/Anchors) UI design "uGUI", "Canvas", "RectTransform", "Anchors", "HUD"
unity-game-ui-toolkit-design In-game UI Toolkit (UXML/USS/Flexbox) UI design "UI Toolkit", "UXML", "USS", "VisualElement", "Flexbox"

Installation

Install as a Claude Code plugin from GitHub:

# Step 1: Add marketplace
/plugin marketplace add akiojin/unity-mcp-server

# Step 2: Install plugin
/plugin install unity-mcp-server@unity-mcp-server

Or manually copy the .claude/skills/ directory to your project.

Usage

Skills activate automatically when you mention related keywords. You can also invoke them directly:

# Ask about C# editing workflow
"How do I edit Unity C# scripts?"

# Ask about scene management
"Create a new scene with basic lighting"

# Ask about testing
"How do I simulate keyboard input in playmode?"

Troubleshooting

See docs/troubleshooting/README.md.

OpenUPM Scoped Registry

To use OpenUPM packages, add the scoped registry to your project:

Via Project Settings

  1. Edit > Project Settings > Package Manager
  2. Under Scoped Registries, click +
  3. Add:
    • Name: OpenUPM
    • URL: https://package.openupm.com
    • Scopes: com.akiojin, com.akiojin.unity-mcp-server

Via manifest.json

"scopedRegistries": [
  {
    "name": "OpenUPM",
    "url": "https://package.openupm.com",
    "scopes": ["com.akiojin", "com.akiojin.unity-mcp-server"]
  }
]

Repository Structure

.unity/
├── cache/           # Local caches (git-ignored)
└── capture/         # Screenshots/videos (git-ignored)

UnityMCPServer/
├── Packages/unity-mcp-server/  # UPM package (source)
└── Assets/                     # Samples only

mcp-server/          # Node MCP server

csharp-lsp/          # Roslyn-based LSP tool

Feature Documentation

All features are documented with SDD format: specs/

Contributing

See CONTRIBUTING.md for development setup, commit guidelines, and PR process.

Development Documentation

For internal development details (Spec Kit, release process, LLM optimization):

License

MIT License - see LICENSE file.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选