AccelByte Unity MCP Server
OfficialAn MCP server that lets an AI assistant generate AccelByte AGS uGUI prefabs and set up scenes in a Unity project, plus look up SDK best practices, search Byte Wars example code, and configure SDK credentials.
Prefab generation — pick a recipe from a feature description (
unity_ui_select_recipe), check readiness (unity_ui_preflight), validate/resolvea spec without Unity, thenunity_ui_generatea project-owned prefab, generate reusable components underAssets/AGS/UI/Components/,unity_ui_patchexisting prefabs, and inspect generated layout health.Style — discover uGUI/TMP style assets and approve the style fingerprint (
unity_ui_style_discover).AGS core kit — inspect or rebuild the package-owned core kit prefabs (
unity_ui_kit_inspect,unity_ui_kit_build).Scene setup — check scene readiness (Canvas, EventSystem, input module, panels) and then create Canvas/EventSystem, instantiate panels, attach a MenuManager, activate the initial panel, and save the scene.
Editor & bridge — detect whether Unity is running and the package is installed, check bridge health at
http://127.0.0.1:48758, trigger a C# recompile, and repair a stale UPM git-package cache.Backing classes — verify that
[SerializeField]fields match the spec'scs_bindings(unity_ui_verify_backing_class) and list approved prefab candidates for list/collection rows.SDK knowledge & examples — get AccelByte Unity SDK how-to guides with C# templates (
get_accelbyte_unity_how_to) and search/read Byte Wars example component source.SDK installation — write AccelByte SDK credentials/config into a Unity project, optionally patching
Packages/manifest.jsonto add the SDK git dependency.
Provides tools for generating AccelByte AGS uGUI prefabs, managing the Unity editor bridge, performing scene setup (Canvas, EventSystem, panels), and interacting with the Unity editor for prefab generation, C# script compilation, and SDK configuration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AccelByte Unity MCP Server Generate a login screen prefab using the AGS recipe."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AccelByte Unity MCP Server
An MCP (Model Context Protocol) server that gives AI assistants the tools to generate AccelByte AGS uGUI prefabs in Unity projects, look up AccelByte Unity SDK best practices, search Bytewars C# example components, and configure SDK credentials — all from a Claude Code or Cursor session.
Prerequisites
Python 3.10+
Unity 6. The package is tested on Windows with Unity 6000.0.84f1, 6000.1.17f1, 6000.3.13f1 and 6000.6.3f1
Unity Hub with the Unity editor version matching your project (auto-detected from
ProjectSettings/ProjectVersion.txt)com.accelbyte.ui-toolspackage installed in the target Unity project (see Installing the Unity Package)
Related MCP server: Unity-MCP
Installation
cd accelbyte-unity-mcp
pip install -r requirements.txt
python server.pyAll tools work with no build step. The example code search (search_unity_example_components and describe_unity_example_components) uses a copy of the SDK code from Byte Wars 1.9.8, which uses AccelByte Unity SDK 17.17.0. This copy ships with the server, together with its license (data/examples/bytewars/LICENSE.md).
MCP Configuration
Add the server to the .mcp.json at your Unity project root so Claude Code starts it automatically on session load:
{
"mcpServers": {
"accelbyte-unity-mcp": {
"type": "stdio",
"command": "python",
"args": ["<PathToRepo>\\accelbyte-unity-mcp\\server.py"]
}
}
}Installing the Unity Package
Copy the embedded package into your Unity project:
Copy-Item -Path "<PathToRepo>\accelbyte-unity-mcp\data\com.accelbyte.ui-tools" `
-Destination "<YourUnityProject>\Packages\com.accelbyte.ui-tools" `
-Recurse -ForceGenerated project prefabs are written to Assets/AGS/UI/Generated/. Reusable component prefabs go under Assets/AGS/UI/Components/.
Tools
Prefab Generation
Tool | What it does |
| Pick the right AGS recipe for a feature (login, leaderboard, friends list, etc.) |
| One-shot readiness report: style approval, recipe selection, validation blockers, bridge status |
| Validate a recipe spec file without opening Unity |
| Dry-run: resolve recipe → prefab spec without creating any assets |
| Generate a project-owned uGUI prefab (bridge mode when editor is open, batch mode when closed) |
| Generate reusable component prefabs under |
| Patch an existing prefab with narrow property changes |
| Inspect generated prefab health (layout, backing class, components, collections) |
Style
Tool | What it does |
| Discover uGUI/TMP style assets in the project and optionally approve the style fingerprint |
AGS Core Kit
Tool | What it does |
| Inspect package-owned AGS kit prefabs against component specs (read-only) |
| Rebuild all AGS core kit prefabs from scratch (bridge or batch mode) |
Scene Setup
Tool | What it does |
| Check scene readiness: Canvas, EventSystem, input module compatibility, active panels, blockers |
| Set up Canvas/EventSystem, instantiate generated panels, attach MenuManager, and save the scene |
Editor & Bridge
Tool | What it does |
| Detect the expected Unity editor, whether it is running, and whether |
| Lightweight health check for the editor bridge at |
| Refresh AssetDatabase and trigger C# script recompilation after writing a backing class |
| Force a clean re-resolve of a stale UPM git-dependency package (hash mismatch or EPERM rename failure) |
Backing Class & Entry Candidates
Tool | What it does |
| Validate that |
| Report approved project prefab candidates for generated list or collection rows |
SDK & Example Components
Tool | What it does |
| AccelByte Unity SDK best-practices guide with C# code templates for a feature topic. Returns |
| Search the Byte Wars SDK example code for classes matching a feature. Returns ranked metadata, URIs, and the Byte Wars and SDK versions |
| Read the C# source files returned by |
| Write AccelByte SDK credentials and config files into a Unity project; with |
How the Bridge Works
When Unity is open with com.accelbyte.ui-tools loaded, generation and scene setup go through a localhost HTTP bridge:
http://127.0.0.1:48758The bridge starts automatically when the editor loads the package. Prefabs generated through it appear in the open project immediately — no editor restart needed.
When Unity is closed, unity_ui_generate and unity_ui_kit_build fall back to Unity batch mode (-batchmode -nographics). The correct Unity executable is matched against ProjectSettings/ProjectVersion.txt. For non-standard installs or CI environments, set UNITY_EDITOR_PATH:
$env:UNITY_EDITOR_PATH = "<PathToUnityHubEditor>\<YourUnityVersion>\Editor\Unity.exe"If the editor is running but the bridge is not reachable (script compilation in progress, package not yet loaded), the MCP returns an actionable error — it will not launch a competing batch instance against an open project.
Typical Workflow
Check the editor —
unity_editor_statusconfirms Unity is running and the package is installed.Select a recipe —
unity_ui_select_recipewith a natural-language feature description returns a spec stub.Preflight —
unity_ui_preflightvalidates style approval, recipe fit, entry candidates, and bridge readiness in one call.Write a C# backing class (if the recipe requires one) — use
get_accelbyte_unity_how_toandsearch_unity_example_components/describe_unity_example_componentsfor SDK patterns and reference implementations.Verify the backing class —
unity_ui_verify_backing_classconfirms[SerializeField]fields match the spec.Trigger recompile —
unity_trigger_recompileimports the new file and starts compilation; pollunity_ui_bridge_healthuntilisCompilingis false.Generate —
unity_ui_generatecreates the prefab atAssets/AGS/UI/Generated/.Set up the scene —
unity_ui_scene_preflight+unity_ui_scene_setupwires the panel into a Canvas with the correct input module and saves the scene.
Project Structure
.
├── server.py # MCP server entry point — registers all tools
├── requirements.txt # Python dependencies
├── pyproject.toml # Package metadata and entry point
├── generate_source_cache.py # Copies the Byte Wars SDK example code into data/examples/bytewars/
├── data/
│ ├── best-practices.json # SDK how-to guides
│ ├── examples/bytewars/ # Byte Wars SDK example code and its search index
│ └── com.accelbyte.ui-tools/ # Unity Editor package (copy into your project's Packages/)
│ ├── Tools/ # Python UI tools library used by this server
│ ├── Prefabs/ # Package-owned AGS core kit prefabs
│ └── Specs/ # Component specs and recipes
└── tests/ # Python testsUpdating the Byte Wars examples
To move the example code to a new Byte Wars release:
Clone https://github.com/AccelByte/accelbyte-unity-bytewars-game.
Run
python generate_source_cache.py --bytewars-repo <PathToClone> --ref <ReleaseTag>.Run the tests and commit the changes in
data/examples/bytewars/.
The script reads the files from the release tag with git, so local changes in the clone do not get into the copy. It keeps only the module code that calls the SDK, and skips the *_Starter.cs tutorial files. It also copies the Byte Wars LICENSE.md from the tag, and stops with an error if the tag has no license or the SDK version is not a #tag in Packages/manifest.json.
Troubleshooting
Bridge not reachable (unity_ui_bridge_health returns ok: false)
Unity is open but the bridge is down. This usually means scripts are still compiling or the package failed to load. Wait for compilation to finish (check the editor status bar), or reimport Packages/com.accelbyte.ui-tools via the Package Manager.
Editor not detected
The server matches the Unity version in ProjectSettings/ProjectVersion.txt against known install roots. If your editor is in a non-standard location, set UNITY_EDITOR_PATH to the full path of Unity.exe before starting the server.
Compile errors block generation
unity_ui_generate refuses to proceed when the editor reports compile errors. Fix the errors shown in Unity's Console, then call unity_trigger_recompile and wait until isCompiling is false before retrying.
Stale UPM git-package cache (hash mismatch / EPERM rename)
A git-URL package dependency (e.g. com.accelbyte.ui-tools pinned via #main in <YourUnityProject>/Packages/manifest.json) can drift out of sync with what Unity has actually resolved, since #main is a moving ref rather than a fixed commit. Two symptoms point to the same root cause:
Hash mismatch —
Packages/packages-lock.jsonrecords one hash for<package-name>, butLibrary/PackageCache/<package-name>@<hash>on disk has a different hash. Package Manager's hash-keyed lookup then fails to find the package it just fetched.EPERM rename failure — a resolve or reimport attempt fails with
Failed to rename [...PackageCache\.tmp-<pid>-...\move] to [...PackageCache\<package-name>@<hash>] ... error code [EPERM]. This happens when the Unity Editor is still open and itsUnityPackageManagersubprocess can't atomically swap in the freshly-cloned revision because the live editor still holds file handles on the package's current contents.
Fix: fully close the Unity Editor first (confirm no Unity.exe process remains — e.g. Get-Process Unity on Windows), then call unity_repair_package_cache with projectPath and packageName (e.g. com.accelbyte.ui-tools). It deletes the stale Library/PackageCache/<package-name>@* folder(s) and removes the package's entry from packages-lock.json, leaving every other dependency untouched. Reopen the Unity editor afterward so Package Manager re-resolves the package fresh from the manifest's git ref, then confirm via Window → Package Manager that it appears under In Project with no error icon.
The tool refuses to run while a matching Unity editor process is detected, unless you pass force=true (only do this if you've independently confirmed it's safe). If you'd rather do it by hand instead of through the MCP tool: close Unity, delete the Library/PackageCache/<package-name>@* folder, remove that package's entry from Packages/packages-lock.json, then reopen Unity.
License
Apache-2.0
See LICENSE and NOTICE. The Byte Wars example code under data/examples/bytewars/ is not covered by this license; it keeps its own license, data/examples/bytewars/LICENSE.md.
Available Tools
23 toolsdescribe_unity_example_componentsA
Read C# source files for one or more bytewars components. Pass 'uris' from search_unity_example_components. Returns full C# source text for each file.
Inputs: uris (required), projectPath.
get_accelbyte_unity_how_toA
Query the AccelByte Unity SDK best-practices knowledge base for a topic. Returns SDK guides with C# code templates, best practices, and related component names. Use before writing a C# backing class.
Inputs: topic (required), projectPath.
search_unity_example_componentsA
Search the bytewars C# source index for classes matching a feature. Returns ranked component metadata (class name, URI, feature tags, public methods). Use URIs with describe_unity_example_components.
Inputs: feature (required), limit, projectPath.
unity_editor_statusA
Report the expected Unity editor, whether Unity is running, and whether com.accelbyte.ui-tools is installed (ui_tools_installed, ui_tools_path).
Inputs: projectPath (required), editorPath.
unity_install_sdkA
Set up AccelByte Unity SDK config in a Unity project. By default writes only config files and preserves valid split SDK/OAuth config; pass patchManifest=true only when manifest package installation is intended.
Inputs: clientId (required), namespace (required), projectPath (required), appId, +6 more.
unity_repair_package_cacheA
Force a clean re-resolve of a stale UPM git-dependency package. Use on a packages-lock.json hash mismatch against Library/PackageCache, or a 'Failed to rename ... EPERM' error during resolve. Deletes the stale Library/PackageCache/@* folder(s) and removes the package's packages-lock.json entry so Package Manager re-resolves it fresh on next editor launch. Refuses to run while a Unity editor process is open unless force=true.
Inputs: packageName (required), projectPath (required), force.
unity_trigger_recompileA
Refresh Unity's AssetDatabase, then ask the Unity editor to recompile all C# scripts via CompilationPipeline.RequestScriptCompilation(). Use after writing a C# backing class to import new/changed files without switching focus to the editor manually. Poll unity_ui_bridge_health.response.isCompiling until false.
Inputs: projectPath (required), bridgeUrl, classPath, editorPath, +2 more.
unity_ui_bridge_healthA
Check whether the AccelByte UI Tools bridge is healthy in the Unity editor. Returns ok, bridge URL, and the health response (including isCompiling). Lighter than unity_editor_status — use for a quick bridge-only check.
Inputs: bridgeUrl.
unity_ui_generateA
Generate a project-owned Unity uGUI prefab through the live editor bridge when Unity is open, or batch mode when it is closed. Refuses generate-blocking validation warnings, Unity compile errors, unverified backing classes, and failed post-generation verification/layout gates unless explicitly overridden where supported.
Inputs: specPath (required), projectPath (required), force, bridgeUrl, +5 more.
unity_ui_inspect_generated_layoutC
Inspect generated Unity UI prefabs for layout, backing-class, component, and collection health.
Inputs: projectPath (required), assetPath, bridgeUrl, editorPath.
unity_ui_kit_buildA
Rebuild all AGS core kit prefabs under Packages/com.accelbyte.ui-tools/Prefabs/Core/ with force=true. Use after plugin C# changes to regenerate existing prefabs. Uses the live editor bridge when Unity is open, batch mode when closed.
Inputs: projectPath (required), bridgeUrl, editorPath.
unity_ui_kit_inspectB
Inspect package-owned AGS uGUI kit prefabs against component specs without modifying assets.
Inputs: projectPath (required), kit.
unity_ui_list_entry_candidatesC
Report approved project prefab candidates for generated list or collection rows.
Inputs: projectPath (required), screen, feature, itemView, +1 more.
unity_ui_patchC
Patch existing generated or package-owned UI prefabs with narrow property operations.
Inputs: patchPath (required), projectPath (required), bridgeUrl, editorPath.
unity_ui_preflightA
Return one read-only readiness report for Unity UI generation, including style approval, recipe selection, validation blockers, entry candidates, missing project roles, and compile/bridge readiness.
Inputs: projectPath (required), feature, specPath, bridgeUrl, +2 more.
unity_ui_project_components_generateC
Generate project-owned reusable UI component prefabs under Assets/AGS/UI/Components.
Inputs: projectPath (required), role, force, roles, +2 more.
unity_ui_resolveA
Resolve an AGS recipe into a Unity uGUI prefab spec without creating assets.
Inputs: specPath (required), projectPath (required).
unity_ui_scene_preflightC
Return scene readiness for generated Unity UI, including Input System mode, EventSystem module compatibility, Canvas presence, generated panel candidates, active panel state, blockers, warnings, and next actions.
Inputs: projectPath (required), bridgeUrl, scenePath, editorPath.
unity_ui_scene_setupA
Set up and validate a Unity scene for generated UI through the live editor bridge. Creates/reuses Canvas and EventSystem, selects the compatible input module, instantiates panels, optionally attaches a compiled MenuManager MonoBehaviour and assigns generated panel fields, activates only initialPanel, and saves the scene on success.
Inputs: panels (required), projectPath (required), initialPanel (required), mode, +5 more.
unity_ui_select_recipeA
Select the best AGS Unity UI recipe for a feature and return a partial spec stub. Unknown broad screens do not silently accept generic_async; pass allowGenericAsync=true only for intentional one-shot async/status panels.
Inputs: feature (required), projectPath (required), allowGenericAsync.
unity_ui_style_discoverC
Discover uGUI/TMP project style and optionally approve its fingerprint.
Inputs: projectPath (required), approve, roleOverrides, clearRoleOverrides.
unity_ui_validateB
Validate a shared AGS Unity UI recipe without opening Unity.
Inputs: specPath (required), projectPath (required).
unity_ui_verify_backing_classA
Validate that [SerializeField] fields in a C# backing class match the cs_bindings from unity_ui_resolve. Call after writing the C# class and before unity_ui_generate.
Inputs: specPath (required), classPath (required), projectPath (required), allowNonstandardClassPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool has a clearly distinct purpose, whether in the SDK setup, UI generation pipeline, or example components. For instance, unity_ui_preflight and unity_ui_scene_preflight are differentiated by scope (general UI vs scene-specific readiness).
Most tools use snake_case with a 'unity_' or 'unity_ui_' prefix, but a few like 'get_accelbyte_unity_how_to' and 'describe_unity_example_components' deviate from the predominant noun-first pattern, introducing minor inconsistency.
23 tools is on the higher side, but each tool serves a specific need in a complex domain (SDK management, UI generation, knowledge base). While the set could potentially be trimmed, the count is still reasonable for the breadth of functionality.
The tool set covers the full workflow: SDK setup (install, repair, recompile), knowledge base, example components, and an extensive UI generation pipeline (recipe selection, resolution, validation, generation, inspection, patching, scene setup). No obvious gaps are apparent for the stated purpose.
Maintenance
Related MCP Connectors
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP Unity Server to integrate Unity Editor game engine with different AI Model clients (e.g. Claude Desktop, Windsurf, Cursor)58 npm2,014MIT
- AlicenseNot gradedqualityAmaintenanceSeamless automation and intelligent control over your Unity projects. By integrating with the MCP server and client, it allows AI agents or external tools to interact with your Unity environment—creating, modifying, and managing GameObjects, Components, Assets, Scenes, and more.4,630Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that integrates AI assistants like Claude and Cursor directly into the Unity Editor to automate game development workflows. It provides over 40 built-in tools for scene manipulation and project management, while offering a simple C# API for creating custom extensions.10GPL 3.0
- AlicenseNot gradedqualityDmaintenanceAn MCP Server that provides Retrieval-Augmented Generation (RAG) capabilities to surface the latest Unity API documentation (currently v6.x).1MIT