Skip to content

LWJGL3 desktop CLI examples

The terminal replay uses the installed lbiome launcher. Captured transcripts retain the original libgdx-mcp spelling. Both names invoke the same CLI.

Launch the bundled 3D fixture and export LIBGDX_MCP_PROJECT_PATH from a second shell at the repository root. Leave its window open. The capture used the default 900×620 viewport on native macOS LWJGL3. Window dimensions affect projection and picking results.

Claude Code via Bash

Claude Code-style workflow replay

Illustrated from an actual Claude Code session. The prompts are verbatim and the replies summarize verified CLI results.

Claude Desktop-style replay

Illustrative Claude Desktop-style replay

Illustrated Claude Desktop-style conversation showing the same CLI-verified workflow. This is not a recording of an MCP session.

System-shell walkthrough

Verified system-shell walkthrough

A system-shell walkthrough. The installed CLI has no built-in interactive prompt.

Recorded workflow

The five requests below were sent in English to one Claude Code 2.1.337 print-mode session per project. The display is illustrated, not a screen recording. Each collapsed turn includes the actual Bash calls and their tool results, with trailing whitespace trimmed. No MCP servers were loaded for this capture.

Prepare this workflow fixture Follow the [libGDX setup](getting-started.md#quickstart) to start the bundled 3D fixture and select its live world. Run from the isolated workspace described below. Managed object IDs are generated at runtime and must be replaced with the IDs from your own create results. The changes are in memory. Restart the fixture to discard them.
1. Create a sphere named Checkpoint.
./libgdx-mcp call create_world_primitive '{"name":"Checkpoint","primitive":"sphere"}' --json
{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","name":"Checkpoint","parent_id":null,"primitive":"sphere","managed":true,"children_count":0}
./libgdx-mcp tree --world --no-ids
3D world [7 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
"Checkpoint"
2. Move Checkpoint to (2, 1, -3).
./libgdx-mcp call set_world_transform '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","position":[2,1,-3]}' --json
{"position":[2.0,1.0,-3.0],"rotation":[0.0,-0.0,0.0],"scale":[1.0,1.0,1.0],"sheared":false,"matrix":[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,2.0,1.0,-3.0,1.0],"space":"local"}
./libgdx-mcp call get_world_transform '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb"}' --json
{"position":[2.0,1.0,-3.0],"rotation":[0.0,-0.0,0.0],"scale":[1.0,1.0,1.0],"sheared":false,"matrix":[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,2.0,1.0,-3.0,1.0],"space":"local"}
3. Make Checkpoint teal.
./libgdx-mcp call set_world_material '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","color":[0,0.5,0.5,1]}' --json
{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","materials":[{"slot":0,"id":"diffuse","color":[0.0,0.5,0.5,1.0]}]}
./libgdx-mcp call get_world_material '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb"}' --json
{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","materials":[{"slot":0,"id":"diffuse","color":[0.0,0.5,0.5,1.0]}]}
4. Add a cone named Pointer under Checkpoint.
./libgdx-mcp call create_world_primitive '{"name":"Pointer","primitive":"cone","parent_id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb"}' --json
{"id":"world-971b2717-485a-48eb-9181-2d235053f3f4","name":"Pointer","parent_id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","primitive":"cone","managed":true,"children_count":0}
./libgdx-mcp tree --world --no-ids
3D world [8 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
"Checkpoint"
  "Pointer"
5. Verify the position, color, and child.
./libgdx-mcp call get_world_transform '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb"}' --json
{"position":[2.0,1.0,-3.0],"rotation":[0.0,-0.0,0.0],"scale":[1.0,1.0,1.0],"sheared":false,"matrix":[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,2.0,1.0,-3.0,1.0],"space":"local"}
./libgdx-mcp call get_world_material '{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb"}' --json
{"id":"world-e6dc1ed9-117a-4edf-bfdd-310de2cd8feb","materials":[{"slot":0,"id":"diffuse","color":[0.0,0.5,0.5,1.0]}]}
./libgdx-mcp tree --world --no-ids
3D world [8 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
"Checkpoint"
  "Pointer"

Captured Claude Code Bash calls

These five calls came from one Claude Code 2.1.337 print-mode session with Bash enabled and no MCP servers. The transcript shows the actual commands and tool results, not a simulated assistant response.

Prepare a disposable capture workspace Follow the quickstart and open only the disposable fixture described above. For these captures the installed CLI was linked into an otherwise empty directory. From the repository root:
DEMO_DIR="$(mktemp -d)"
ln -s "$PWD/server/.venv/bin/libgdx-mcp" "$DEMO_DIR/libgdx-mcp"
cd "$DEMO_DIR"
Keep `LIBGDX_MCP_PROJECT_PATH` pointing to the bundled 3D fixture. The new box is added only to the running game. Close the game after the demo, or restart the fixture before repeating it.
1. Read the registered scene objects
./libgdx-mcp tree --world --no-ids
3D world [6 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
2. Measure Tower bounds
./libgdx-mcp call get_world_bounds '{"id":"tower"}' --json --fields min,max
{"min":[-1.3,0.0,-1.3],"max":[1.3,4.12,1.3]}
3. Read Rotor local position
./libgdx-mcp call get_world_transform '{"id":"rotor"}' --json --fields position,space
{"position":[0.0,1.76,0.0],"space":"local"}
4. Create a temporary MarkerBox in the running fixture
./libgdx-mcp call create_world_primitive '{"name":"MarkerBox","primitive":"box"}'
id: world-30656f4d-861a-4a6e-835a-44c18f7bcab6
name: MarkerBox
parent_id: null
primitive: box
managed: true
children_count: 0
5. Verify MarkerBox appears in the live hierarchy
./libgdx-mcp tree --world
3D world [7 objects]
"Floor" [floor]
"Tower" [tower]
  "Rotor" [rotor]
  "Beacon" [beacon]
"Boulder" [boulder]
"Pylon" [pylon]
"MarkerBox" [world-30656f4d-861a-4a6e-835a-44c18f7bcab6]
1. Read registered objects and their parents
server/.venv/bin/libgdx-mcp tree --world --no-ids
3D world [6 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
2. Read the Rotor position in local space
server/.venv/bin/libgdx-mcp call get_world_transform '{"id":"rotor"}'   --json --fields position,space
{"position":[0.0,1.76,0.0],"space":"local"}
3. Measure the Tower world bounds
server/.venv/bin/libgdx-mcp call get_world_bounds '{"id":"tower"}'   --json --fields min,max
{"min":[-1.3,0.0,-1.3],"max":[1.3,4.12,1.3]}
4. Project the world origin through the main camera
server/.venv/bin/libgdx-mcp call project_world_point   '{"point":[0,0,0],"camera_id":"main"}' --json
{"camera_id":"main","screen":[450.0,350.28503,0.9952451],"visible":true}
5. Identify the model under the center pixel
server/.venv/bin/libgdx-mcp call pick_world_object   '{"x":450,"y":310,"camera_id":"main"}' --json
{"camera_id":"main","id":"tower","point":[0.56664944,1.3541899,0.85],"distance":14.183114}

Captured MCP responses

The CLI can add presentation labels or format a result differently. These are the actual text responses behind the illustrative chat replay.

Read registered objects and their parents
3D world [6 objects]
"Floor"
"Tower"
  "Rotor"
  "Beacon"
"Boulder"
"Pylon"
Read the Rotor position in local space
{"position":[0.0,1.76,0.0],"space":"local"}
Measure the Tower world bounds
{"min":[-1.3,0.0,-1.3],"max":[1.3,4.12,1.3]}
Project the world origin through the main camera
{"camera_id":"main","screen":[450.0,350.28503,0.9952451],"visible":true}
Identify the model under the center pixel
{"camera_id":"main","id":"tower","point":[0.56664944,1.3541899,0.85],"distance":14.183114}