### Install uv Package Manager Source: https://github.com/glade-tool/glade-mcp/blob/main/README.md Install the uv package manager for Mac/Linux or Windows. This is a one-time setup step. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install GUT for GladeKit MCP Bridge Source: https://github.com/glade-tool/glade-mcp/blob/main/godot-bridge/tests/README.md Clone the GUT repository and move the plugin to the correct directory. This is a one-time setup step. ```bash git clone --depth 1 --branch v9.4.0 https://github.com/bitwes/Gut.git godot-bridge/addons/_gut_repo mv godot-bridge/addons/_gut_repo/addons/gut godot-bridge/addons/gut rm -rf godot-bridge/addons/_gut_repo ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/CONTRIBUTING.md Clone the glade-mcp repository and install development dependencies using uv. ```bash git clone https://github.com/Glade-tool/glade-mcp.git cd glade-mcp/mcp-server uv sync --extra dev ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Example JSON configuration for clients to connect to the GladeKit MCP server via HTTP. ```APIDOC ## Client Configuration for HTTP Transport This is an example of how a client can be configured to use the streamable HTTP transport. ```json { "mcpServers": { "gladekit-mcp": { "url": "http://127.0.0.1:8766/mcp" } } } ``` ``` -------------------------------- ### Verify uvx Tool Installation Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Checks if the 'uvx' command-line tool is available. If not, provides alternative installation methods. ```bash uvx gladekit-mcp ``` -------------------------------- ### Install Unity Bridge Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Add the GladeKit MCP Unity bridge package using the Git URL in Unity's Package Manager. ```git https://github.com/Glade-tool/glade-mcp.git?path=/unity-bridge ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/eval/README.md Commands to install development dependencies and run the pytest suite and the MCP eval harness. ```bash # From mcp-server/ # 1. Install dev dependencies pip install -e ".[dev]" # 2. Run pytest (unit + integration tests) pytest tests/ -v # 3. Run the MCP eval harness (core suite, mock bridge) python -m eval.run # 4. Run all eval suites python -m eval.run --suite all --save # 5. Run against live Unity python -m eval.run --live-unity --verbose ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md This JSON configuration defines an MCP server named 'gladekit-mcp' with a specific command, arguments, and environment variables, including an API key. ```json { "mcpServers": { "gladekit-mcp": { "command": "uvx", "args": ["gladekit-mcp"], "env": { "GLADEKIT_API_KEY": "your-api-key" } } } } ``` -------------------------------- ### GLADE.md Configuration Example Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md This markdown file serves as a permanent context layer for the MCP server, allowing you to define game design intent, conventions, and constraints. ```markdown # My Game Genre: 3D platformer Player: CharacterController, double jump enabled Art style: pixel art, 16x16 sprites Naming: PascalCase for scripts, snake_case for folders ``` -------------------------------- ### Create Start Menu UI Elements Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/StartMenu.cs.txt This code creates the main title and subtitle labels, along with 'Play' and 'Quit' buttons for the start menu. It utilizes helper functions to instantiate and configure UI elements. ```csharp var titleLabel = MakeLabel(canvas.transform, font, title, new Vector2(0.5f, 0.5f), new Vector2(0f, 220f), TextAnchor.MiddleCenter); titleLabel.fontSize = 96; titleLabel.rectTransform.sizeDelta = new Vector2(1200f, 160f); if (!string.IsNullOrEmpty(subtitle)) { var sub = MakeLabel(canvas.transform, font, subtitle, new Vector2(0.5f, 0.5f), new Vector2(0f, 120f), TextAnchor.MiddleCenter); sub.fontSize = 34; sub.color = new Color(1f, 1f, 1f, 0.75f); sub.rectTransform.sizeDelta = new Vector2(900f, 60f); } MakeButton(canvas.transform, font, "Play", new Vector2(0f, 0f), Play); MakeButton(canvas.transform, font, "Quit", new Vector2(0f, -84f), Quit); } ``` -------------------------------- ### Start GLADE MCP with HTTP Transport Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Launches the MCP server using HTTP transport on a specified port. Useful for testing network communication. ```bash gladekit-mcp --transport http --port 8766 ``` -------------------------------- ### Asset Search Query Example Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md An example JSON payload for the `find_asset` tool, used to search for assets based on description, type, and style. This tool is read-only and does not dispatch to Unity. ```json { "description": "platformer character and tiles", "asset_type": "sprite_2d", "max_results": 5 } ``` -------------------------------- ### Unity Tool C# Implementation Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/CONTRIBUTING.md Example of a C# implementation for a Unity tool, defining its name and execution logic. ```csharp public class MyTool : ITool { public string Name => "my_tool"; public string Execute(Dictionary args) { // ... Unity Editor API calls ... return ToolUtils.CreateSuccessResponse("Done", extras); } } ``` -------------------------------- ### StartMenu Class Definition Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/StartMenu.cs.txt Defines a Unity MonoBehaviour that acts as a self-contained start menu. It freezes the game, displays a title screen, and handles player input for starting or quitting. ```csharp using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using UnityEngine.InputSystem.UI; // InputSystemUIInputModule — what makes the buttons clickable // A self-contained START / TITLE SCREEN: on play it FREEZES the game // (Time.timeScale = 0) and shows a full-screen title with a Play and a Quit button. // Press Play and the menu tears itself down and un-freezes the game — so the player // starts on a title card instead of being dropped straight into a moving scene. It // builds its own Canvas, buttons and EventSystem at runtime (no art, no extra scene, // no Build Settings surgery). // // Why an in-scene overlay instead of a separate menu scene: a scaffolded start screen // that lives in its OWN scene needs both scenes saved AND added to Build Settings, or // Play does nothing — a brittle, multi-step setup. Freezing the live scene behind an // overlay gives the same "title → game" flow immediately, in any scene, with no build // configuration. (For a true multi-scene menu, save a menu scene and load the gameplay // scene with SceneManager.LoadScene from Play() instead.) // // Why a vetted template: hand-rolled title screens reliably ship the same bugs — they // forget the EventSystem / input module so Play is unclickable; they don't actually // freeze the game, so it plays out behind the menu; or they disable the menu without // restoring timeScale, leaving the game frozen after Play. // // Reach it from gameplay code without a reference via the static Instance: // StartMenu.Instance?.Play(); // e.g. start on any key, not just the button [DisallowMultipleComponent] public class StartMenu : MonoBehaviour { public static StartMenu Instance { get; private set; } [Tooltip("Big title shown on the start screen.")] public string title = "My Game"; [Tooltip("Smaller line under the title (e.g. a controls hint). Empty hides it.")] public string subtitle = "Press Play to start"; [Tooltip("Freeze the game (Time.timeScale = 0) until the player presses Play.")] public bool freezeUntilStart = true; private void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); return; } Instance = this; EnsureEventSystem(); BuildMenu(); if (freezeUntilStart) Time.timeScale = 0f; } private void OnDestroy() { if (Instance == this) Instance = null; } // ── Public API ───────────────────────────────────────────────────────────── // Dismiss the title screen and run the game. Always restores timeScale, then // destroys this object — taking its title Canvas (a child) down with it. public void Play() { Time.timeScale = 1f; Destroy(gameObject); } public void Quit() { Time.timeScale = 1f; #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif } // ── UI (built at runtime so the menu is fully self-contained) ────────────── // Buttons are dead without an EventSystem + input module. Build one (matching the // new Input System backend) only if the scene has none, so we never duplicate it. private void EnsureEventSystem() { if (Object.FindFirstObjectByType() != null) return; var es = new GameObject("EventSystem"); es.AddComponent(); var module = es.AddComponent(); module.AssignDefaultActions(); // wire the built-in UI actions (point/click/navigate) } private void BuildMenu() { Font font = Resources.GetBuiltinResource("LegacyRuntime.ttf"); if (font == null) font = Resources.GetBuiltinResource("Arial.ttf"); var canvasGo = new GameObject("Start Menu Canvas"); canvasGo.transform.SetParent(transform, false); var canvas = canvasGo.AddComponent(); canvas.renderMode = RenderMode.ScreenSpaceOverlay; canvas.sortingOrder = 100; // draw above any gameplay HUD behind the title card var scaler = canvasGo.AddComponent(); scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(1920f, 1080f); canvasGo.AddComponent(); // without this the buttons receive no clicks // Full-screen opaque backdrop so the live scene doesn't show through the title. var bg = new GameObject("Backdrop"); bg.transform.SetParent(canvas.transform, false); var bgImg = bg.AddComponent(); bgImg.color = new Color(0.06f, 0.07f, 0.10f, 1f); var br = bgImg.rectTransform; br.anchorMin = Vector2.zero; br.anchorMax = Vector2.one; br.offsetMin = Vector2.zero; br.offsetMax = Vector2.zero; ``` -------------------------------- ### Godot Tool GDScript Implementation Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/CONTRIBUTING.md Example of a GDScript implementation for a Godot tool, including initialization and execution logic. ```gdscript extends "res://addons/com.gladekit.mcp-bridge/tools/i_tool.gd" const ToolUtils = preload("res://addons/com.gladekit.mcp-bridge/bridge/tool_utils.gd") func _init() -> void: tool_name = "my_tool" requires_edit_mode = true # false for read-only tools func execute(args: Dictionary) -> Dictionary: var missing := ToolUtils.require_string(args, "node_path") if not missing.is_empty(): return ToolUtils.error(missing) # ... Godot Editor API calls ... return ToolUtils.success("Done", {"extra": "field"}) ``` -------------------------------- ### Troubleshooting: `GLADE.md` Not Picked Up Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Information on why the `GLADE.md` file might not be recognized by the system. ```APIDOC ## Troubleshooting: `GLADE.md` Not Being Picked Up Ensure that the `GLADE.md` file meets the following criteria: - **Exact Naming:** The file must be named exactly `GLADE.md` (case-sensitive on Mac/Linux). - **Project Root Location:** The file must be placed in the root directory of the Unity project, in the same directory as `Assets/`, `Packages/`, and `ProjectSettings/`. ``` -------------------------------- ### Streamable HTTP Server Launch Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Instructions on how to launch the GladeKit MCP server with the HTTP transport, including default and custom configurations. ```APIDOC ## Launching the HTTP Server To launch the GladeKit MCP server with the streamable HTTP transport, use the following command: ```bash # Defaults: host=127.0.0.1, port=8766, path=/mcp gladekit-mcp --transport http # Custom host/port/path gladekit-mcp --transport http --host 127.0.0.1 --port 9000 --path /mcp ``` ### Endpoints - `POST/GET/DELETE http://127.0.0.1:8766/mcp` - MCP streamable-HTTP endpoint - `GET http://127.0.0.1:8766/health` - liveness check ``` -------------------------------- ### Test Beginner Mode Skill Calibration Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Check if GladeKit responds with plain-language, encouraging, and step-by-step explanations for beginner users. Also verifies the update of skill_level.json. ```text Um, how do I make the cube bounce? Like, when it hits the ground it bounces back? ``` -------------------------------- ### Prompt to Read Unity Project Context Resource Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Request the `unity://context` resource for a comprehensive snapshot of your Unity project. This includes details on the render pipeline, input system, scene hierarchy, scripts, and current selection, providing GladeKit with full project understanding. ```text Read the `unity://context` resource. ``` -------------------------------- ### Player Respawn Logic Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/GameManager.cs.txt Resets the player's position to their starting point and clears their velocity. Captures the player if not already found. ```csharp public void Respawn() { if (player == null) CapturePlayer(); if (player == null) return; ``` -------------------------------- ### Locking Pause from Gameplay Code Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/PauseMenu.cs.txt Example of how to temporarily disable the pause functionality from other gameplay scripts. This is useful during cutscenes or other moments where pausing should be prevented. ```csharp PauseMenu.Instance?.SetPausable(false); ``` -------------------------------- ### Create Prefab and Instantiate Copies Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Convert an existing GameObject into a prefab and then instantiate multiple copies of that prefab into the scene at specified positions. This tests prefab workflow and instantiation. ```text Turn the cube into a prefab at Assets/Prefabs/PlayerCube.prefab, then instantiate 3 copies in a row at (0, 0, 0), (3, 0, 0), and (6, 0, 0). ``` -------------------------------- ### LevelSystem.Instance Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/LevelSystem.cs.txt Provides static access to the LevelSystem singleton instance from anywhere in the game. Use this to interact with the level system, such as adding XP. ```APIDOC ## LevelSystem.Instance ### Description Static singleton access point for the LevelSystem. Allows interaction with the level system from any script without needing a direct reference. ### Usage ```csharp LevelSystem.Instance?.AddXP(5); ``` ``` -------------------------------- ### StartMenu Public API Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/StartMenu.cs.txt The StartMenu script offers a static Instance to access its public methods for controlling the title screen and game state. ```APIDOC ## StartMenu.Instance ### Description Provides static access to the singleton instance of the StartMenu component. ### Usage ```csharp StartMenu.Instance?.Play(); ``` ## StartMenu.Play() ### Description Dismisses the title screen, restores the game's time scale to normal, and destroys the StartMenu GameObject. ### Method ```csharp public void Play() ``` ## StartMenu.Quit() ### Description Restores the game's time scale to normal and quits the application. In the Unity Editor, it stops playback. ### Method ```csharp public void Quit() ``` ``` -------------------------------- ### Run Pre-push Checklist Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/CONTRIBUTING.md Execute the pre-push checklist to ensure code quality, linting, formatting, and test suite pass before pushing changes. ```bash uv sync --extra dev # required first; ruff lives in the dev extra uv run ruff check . # lint uv run ruff format --check . # formatting uv run pytest -q # full test suite (234+ tests, ~100 seconds) ``` -------------------------------- ### Checking Pause State from Gameplay Code Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/PauseMenu.cs.txt Example of how to check if the game is currently paused from other gameplay scripts. This allows for conditional logic based on the pause state. ```csharp bool paused = PauseMenu.Instance != null && PauseMenu.Instance.IsPaused; ``` -------------------------------- ### Prompt to Read GLADE.md Resource Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md If a GLADE.md file exists in your project root, use this prompt to read its contents via the `unity://glade-md` resource. This confirms the file is accessible and its content can be retrieved. ```text Read the `unity://glade-md` resource. ``` -------------------------------- ### Get User PATH for Unity AI Gateway Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Commands to retrieve the user's PATH environment variable on Mac/Linux and Windows, needed for Unity's AI Gateway. ```bash echo $PATH ``` ```bash echo %PATH% ``` -------------------------------- ### Godot Bridge Installation Confirmation Source: https://github.com/glade-tool/glade-mcp/blob/main/godot-bridge/README.md This message confirms the GladeKit MCP Bridge is active and listening on the default WebSocket port. Ensure this appears in your editor's Output panel after enabling the plugin. ```text [GladeKit MCP Bridge] listening on ws://127.0.0.1:8766 (v0.6.4, 60 tools registered, thread-polled at 200Hz) ``` -------------------------------- ### Launch GladeKit MCP with HTTP Transport Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/README.md Use these bash commands to launch the GladeKit MCP server with the HTTP transport. The first command uses default host, port, and path, while the second specifies custom values. ```bash gladekit-mcp --transport http ``` ```bash gladekit-mcp --transport http --host 127.0.0.1 --port 9000 --path /mcp ``` -------------------------------- ### GladeKit MCP Bridge Error Response Structure Source: https://github.com/glade-tool/glade-mcp/blob/main/godot-bridge/README.md Example of an error JSON response from the GladeKit MCP Bridge. It indicates failure with 'success: false' and provides an 'error' and 'message' detailing the issue. ```json { "id": "req-1", "success": false, "error": "Unknown tool 'foo'", "message": "Unknown tool 'foo'" } ``` -------------------------------- ### Set Up Animator Controller with States and Transitions Source: https://github.com/glade-tool/glade-mcp/blob/main/mcp-server/TESTING.md Create an Animator Controller asset with specified states, parameters, and transitions. This is used to define animation logic for GameObjects. ```text Create an Animator Controller at Assets/Anim/Player.controller with two states: Idle and Run. Add a Bool parameter 'isRunning' that transitions from Idle→Run (true) and Run→Idle (false). ``` -------------------------------- ### GladeKit MCP Bridge Success Response Structure Source: https://github.com/glade-tool/glade-mcp/blob/main/godot-bridge/README.md Example of a successful JSON response from the GladeKit MCP Bridge. It includes the original 'id', a 'success' flag, a 'message', and the requested data payload. ```json { "id": "req-1", "success": true, "message": "Scene tree retrieved", "tree": { ... }, "node_count": 12 } ``` -------------------------------- ### MakeButton Function for Unity UI Source: https://github.com/glade-tool/glade-mcp/blob/main/unity-bridge/Editor/Tools/Templates/StartMenu.cs.txt This C# function creates a Unity UI Button with specified properties. It handles GameObject creation, Image and Button component setup, color customization, and adds an onClick listener. ```csharp private Button MakeButton(Transform parent, Font font, string label, Vector2 anchoredPos, UnityEngine.Events.UnityAction onClick) { var go = new GameObject(label + " Button"); go.transform.SetParent(parent, false); var img = go.AddComponent(); var rect = img.rectTransform; rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMax = new Vector2(0.5f, 0.5f); rect.pivot = new Vector2(0.5f, 0.5f); rect.sizeDelta = new Vector2(320f, 64f); rect.anchoredPosition = anchoredPos; var btn = go.AddComponent