Skip to main content
Glama
unity-inspector-mcp

unity-inspector-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BROFORCE_PROFILENoThe r2modman profile the Steam launch loads Unity Mod Manager from: a name, or the profile's folder as an absolute path.Default
BROFORCE_STOP_CMDNoCommand line `stop_game` and `launch_game { restart: true }` run to stop your own game. Unset, and the game is stopped by signalling its own process.
BROFORCE_LAUNCH_CMDNoCommand line `launch_game` runs to start your own game, replacing Steam's default launch. Parsed into a command plus arguments with shell-style quoting; `--vanilla` and `launchArgs` are appended.
UNITY_INSPECTOR_LOGNoPath to the log `read_log` reads: Unity's player log, or the Unity Mod Manager log. Unset, and the server searches for the log itself.
BROFORCE_LAUNCH_TYPENo`native` or `proton`: how the Steam launch on Linux runs the game. `auto` means Proton when the game folder has a `.forceproton` file or an `.exe`.auto
UNITY_INSPECTOR_HOSTNoHost your own game runs on; on WSL the default is 127.0.0.1 and then the Windows host. A game on another machine needs the mod's "Allow remote connections (LAN)" setting on, and a copy of its token file named in `UNITY_INSPECTOR_TOKEN_FILE`.127.0.0.1
UNITY_INSPECTOR_PORTNoTCP port the mod listens on. Set it to match if you change the port from the default in the Unity Inspector Mod.9999
BROFORCE_INSTANCE_CMDNoThe launcher that creates and runs this session's own game instance. Unset, and there are no instances.
UNITY_INSPECTOR_TOKEN_FILENoPath to the token file the mod writes. Unset, and the server searches the game's data folders itself.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
pingB

Test connection to Unity Inspector

list_gameobjectsC

List all GameObjects in the scene

inspect_gameobjectA

Inspect a specific GameObject by path

inspect_componentB

Inspect a specific component on a GameObject

query_gameobjectsB

Search for GameObjects by name or component

inspect_playerB

Get detailed information about the player(s)

list_enemiesA

List all enemies in the scene

take_screenshotA

Take a screenshot of the game. Returns the path to the saved screenshot.

execute_codeB

Execute C# expressions in the Unity context. Uses Mono.CSharp.Evaluator - expects expressions, not statements

modify_componentB

Modify properties of a component on a GameObject

teleport_playerB

Teleport a player to a specific position

set_player_healthC

Set a player's health

spawn_entityC

Spawn an entity at a specific position (limited implementation)

set_game_speedA

Set the game speed (time scale)

list_campaignsA

List all available campaigns with their indices

go_to_levelB

Go directly to a specific campaign level

swap_broA

Swap the current player's bro mid-level. Kills the current bro and spawns the new one at the same position. Integrates with Swap Bros Mod when available, falls back to direct game manipulation.

set_broA

Set which bro the player will spawn as next (on death/respawn/next level). Does NOT change the current bro mid-level.

list_brosA

List all available bros that can be used with swap_bro and set_bro. Reports the selected bro for the given player (currentBro) and for all active players (currentBros array).

restart_levelA

Restart the current level from the beginning. Clears checkpoints and trigger state for a full reset.

simulate_inputC

Simulate keyboard/controller input

list_test_scriptsA

List all available test scripts in scripts/ and scripts/examples/

wait_for_gameA

Wait for the game to start up and the Unity Inspector TCP server to become responsive. Polls the connection until a ping succeeds or timeout is reached.

game_stateA

Get a high-level summary of the current game state: scene, game mode, level info, player status, and bro type. Single call to orient yourself.

read_logB

Read the UMM mod manager log file. Returns the last N lines by default, or filter by pattern.

watch_logA

Return log entries that appeared since the last call to watch_log. First call returns the last 20 lines as a baseline. Use this for iterative debug loops.

run_test_scriptA

Execute a test script containing a sequence of commands. Scripts are JSON files with command sequences that can include wait delays. Steps run directly against the game, so only game-side commands work — server-side tools (read_log, watch_log, list_scripts, launch_game, stop_game, wait_for_game, ...) cannot be used as steps.

execute_scriptA

Compile and run a C# script file in the Unity runtime. Supports full class definitions, MonoBehaviours, Harmony patches, and private member access. Scripts can define Main() for execution and Unload() for cleanup. Use ScriptContext for Harmony instances, logging, and arguments.

Available library scripts:

  • Dump Harmony Patches: List all Harmony patches on a specified method, showing patch owner, type, and priority [args: typeName, methodName]

  • Find Objects By Type: Find all active instances of a type in the scene with key state info [args: typeName, maxResults]

  • Inspect Private Fields: Dump all field values (including private) of a component on a named GameObject [args: gameObjectName, componentType]

  • Menu Tweaker: Live-edit FlexMenu element properties without rebuilding. Target by name, type, or wildcard pattern. [args: elementName]

  • Rogueforce Runner: Test harness for the Rogueforce mod. Start a run, skip levels, log state, auto-run a full campaign, or trigger game over. [args: action]

  • Trace Method Calls: Harmony-patch a method to log every call with arguments for a specified number of frames [args: typeName, methodName, maxCalls]

  • Watch Field: Monitor a field on a component and log whenever its value changes. Runs until unloaded. [args: gameObjectName, componentType, fieldName]

compile_scriptA

Compile a C# script without running it. Returns compilation success/failure and any compiler errors. Useful for validating scripts before execution.

list_scriptsA

List available C# scripts in the script library with their metadata (name, description, tags, arguments).

unload_scriptA

Unload an active C# script, cleaning up its Harmony patches, GameObjects, and calling its Unload() method if defined.

launch_gameA

Launch Broforce and wait for it to become responsive. Uses the BROFORCE_LAUNCH_CMD environment variable when set, otherwise launches Steam app 274190. Returns a warning if the game is already running unless restart is true.

stop_gameA

Stop the running Broforce process.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
C# Script LibraryAvailable C# scripts for Unity runtime execution

TDQS

B3.4/5.0

Scored across 33 tools

Disambiguation4/5

Tools generally target distinct resources/actions: scene inspection, component editing, player manipulation, and script execution. The main confusion risk is among execute_code, execute_script, and run_test_script, but their descriptions clearly distinguish C# expressions, C# script files, and JSON command sequences.

Naming Consistency4/5

Names consistently use snake_case and mostly follow a verb_noun pattern like list_gameobjects, set_player_health, and restart_level. Minor deviations such as game_state being noun-only, the bare ping, and mixing execute/run verbs prevent a perfect score.

Tool Count2/5

33 tools is well beyond the 25+ threshold and feels over-scoped for a single server. Many specialized tools like list_bros, swap_bro, set_bro, list_campaigns, and go_to_level could be grouped into broader commands or consolidated.

Completeness4/5

The surface covers scene inspection, component modification, player and level manipulation, input simulation, logging, screenshots, and script lifecycle management. Minor gaps like adding/removing components or destroying GameObjects exist, but execute_script can largely cover those cases.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues