ui-toolkit-mcp
UI Toolkit MCP
AIエージェントがUnity Editorを開いたままUI Toolkitの画面を検査できるようにするMCPサーバーです。Play Modeに入ったりPlayerをビルドしたりせずに、UXML/USSファイルの構造と外観を調べ、スクリーンショットを撮影できます。
主な機能:
UXMLファイルの一覧表示とUI Toolkitウィンドウのオープン
要素ツリー、テキスト、値、位置、サイズ、解決済みスタイルの検査
画面全体または選択した要素をPNG画像としてキャプチャ
長い画面を自動的にタイルに分割(1画像あたり最大8192 px、合計100 MP)
UXML/USSファイルの再インポート
Unity 2022.3 LTSおよびUnity 6.3での互換性テスト済み
セットアップ
1. Unityパッケージを追加する
Unity EditorでWindow > Package Managerを開き、左上隅の+ボタンをクリックしてAdd package from git URL...を選択します。
次のURLを入力します:
https://github.com/adzukyat/ui-toolkit-mcp.git?path=/unity-packageプレビューサーバーはUnityのスクリプトコンパイル完了後に自動的に起動します。使用中はUnity Editorを開いたままにしてください。
2. MCPサーバーを登録する
Node.js 20以降が必要です。Codexの設定例:
[mcp_servers.ui_toolkit_mcp]
command = "npx"
args = [
"-y",
"ui-toolkit-mcp-server@latest",
"mcp"
]Related MCP server: Unity MCP Server
MCPツール
ツール | 目的 |
| パッケージがインストールされている開いているUnityプロジェクトを一覧表示 |
| 作業するUnityプロジェクトを選択 |
| Unityのバージョンと接続状態を確認 |
| プレビュー設定、UXMLファイル、開いている |
| UI要素の構造、位置、サイズ、スタイルを検査 |
| UIをPNG画像としてキャプチャ |
| UnityでUXML/USSの変更を再読み込み |
まずui_list_projectsでプロジェクトを探し、ui_select_projectで選択します。次にui_list_targetsで検査したい画面を見つけ、続けてui_inspectまたはui_screenshotを使用します。
プレビュー設定(オプション)
プロジェクトルートに.ui-toolkit-mcp-preview.jsonファイルを配置すると、安定したエイリアス、追加のUSSファイル、テーマ、ビューポートを定義できます。次の例をコピーして調整してください:
{
"$schema": "./Packages/me.adzuki.ui-toolkit-mcp.preview-server/Schemas/ui-toolkit-mcp-preview.schema.json",
"schemaVersion": 1,
"previews": [
{
"alias": "settings",
"document": "Assets/UI/Settings.uxml",
"stylesheets": ["Assets/UI/Settings.uss"],
"theme": "editor-dark",
"selector": "#settings-root",
"viewport": { "width": 480, "height": "full" }
}
]
}サポートされているテーマはeditor-dark、editor-light、runtimeです。runtimeテーマにはpanelSettingsアセットパスも指定できます。
開発と検証
npm test
npm run typecheck
npm run build
node scripts/mcp-smoke.mjs [project-id]Unity EditModeテストはtest-projects/2022.3とtest-projects/6000.3にあります。ピクセル単位の正確な検証にはグラフィックスデバイスが必要です。ツリー検査は-nographicsで動作しますが、PNGレンダリングは動作しないため、最終検証は通常起動したUnity Editorで行ってください。
現在の制限事項
サーバーは主に静的UI状態を対象としています。C#で後から構築される画面については、実際の
EditorWindowを開くか、プレビューUXMLファイルで必要な状態を準備してください。Editorオフスクリーンレンダラーはリフレクションを通じて内部UI Toolkit APIを呼び出します。
ui_statusはサポートされていないUnityバージョンについて警告を報告します。開いているウィンドウのIDは現在のUnityセッションでのみ有効です。
ホバーやフォーカスなどの擬似状態の注入、ポインター/キーボード操作、固定アニメーション時間はまだサポートされていません。
フォント、アイコン、カスタムコントロール、データバインディングは、ターゲットプロジェクトで解決できる場合にのみレンダリングされます。
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.
A design agent in your coding agent's loop: briefs each screen, reviews UX and visual quality.
Generate images, GIFs, videos, and PDFs from HTML, URLs, or templates — from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to interact with Unity projects through multimodal vision, code analysis, asset management, and scene manipulation. Supports real-time Unity editor control, project search, script creation, and visual debugging through screenshots.32MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Unity Editor projects through 68+ tools for manipulating scenes, GameObjects, components, and assets, plus live access to console logs, hierarchies, and test results.15 npm9MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query and control the Unity Editor, supporting scene management, GameObject manipulation, asset browsing, play mode control, and real-time editor operations through 52+ tools.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI models to interact with Unity games at runtime by providing tools to list UI actions, inspect GameObjects, capture screenshots, and manage scenes.9MIT