Skip to content

client_control

Jan Boon edited this page Nov 20, 2026 · 11 revisions

title: Client Control Endpoint description: The control endpoint of the Ryzom client (--ctrl-listen) and nel_mcp, the Model Context Protocol server that drives and inspects clients for an agent or a test script; methods, rules, and how to set it up. published: true date: 2026-11-20T18:00:00.000Z tags: editor: markdown dateCreated: 2026-11-20T18:00:00.000Z

A test of the client usually means logging in, choosing a character, going somewhere, clicking through windows and reading what comes back. The control endpoint lets a program do that, with the same access a player has, plus the inspection a developer needs: the client's state, its log, its interface tree, the entities around it, its database, pictures of its frames. nel_mcp puts it in the hands of an agent such as Claude Code, over the Model Context Protocol, or of any script that speaks JSON-RPC on stdin and stdout.

Nothing goes through the window system: the input is posted to the client's own event server, and the pictures are read from the frame it renders. So it works while the window is covered or does not have the focus, it never touches the rest of the desktop, and several clients can run side by side, each addressed by name.

Starting a client with it

ryzom_client_dev_r.exe --ctrl-listen=a
ryzom_client_dev_r.exe <login> <password> <shard id> --ctrl-listen=b

The client listens on a local pipe under the name given (client, clientb... after its log file when the name is left out). A # in the name stands for the same letter of the client in its directory, nothing for the first one: --ctrl-listen=client_dev# gives client_dev, then client_devb for a second client started the same way. The client writes a record of itself to a per-user registry: %LOCALAPPDATA%\nel\ctrl on Windows, $XDG_RUNTIME_DIR/nel.ctrl elsewhere. The record holds its process, its program, its log file, the account and character once known, and, when it exits, the reason. Its log says that the endpoint listens.

The endpoint exists in every client that is not a final build. A final build has it only when compiled with the CMake option WITH_RYZOM_CLIENT_CTRL; without it, the option --ctrl-listen does not exist.

On a second desktop

On Windows, clients driven by a tool can run on a second virtual desktop, so the desktop shown stays free for other work:

ryzom_client_dev_r.exe --ctrl-listen=client_dev# --desktop=2

--desktop takes the desktop's number, 1 for the first one in the task view, or the name it was given there. The desktop has to exist: make it once in the task view (Win+Ctrl+D). The window of the client goes there without taking the focus, and the desktop shown and the window in front stay as they are: activating a window on another desktop would switch the screen to that desktop. The system moves a window to another desktop only a moment after it is shown, so the client shows it off the screen until then, and it shows no splash screen. It stays in a window, as a full screen mode would take the monitor of the desktop shown. When the desktop cannot be had, the log says why, and the client shows on the desktop shown, still without taking the focus.

The client renders on the desktop that is not shown at its normal pace, with OpenGL 3, legacy OpenGL and Direct3D alike, and the screen grabs read its frames. Input comes from the tool, which counts as the focus. client.window says which desktop the window is on, and client.desktop moves it to another one while the client runs, with the same rules from then on. --desktop is in the args of a program in the profile of nel_mcp, so the clients it launches go there.

Setting up nel_mcp

nel_mcp is built with the client (and with the NeL tools). For Claude Code, register it in the project's .mcp.json:

{ "mcpServers": { "client": { "command": "nel_mcp", "args": ["--profile=C:/path/to/client_profile.json"] } } }

The quick start does this already: its client launchers (client_dev.bat, client_dev_live.bat and the debug ones) start the client with --ctrl-listen=client_dev# or --ctrl-listen=client_dev_live#, and its .mcp.json registers nel_mcp through _client_mcp.bat, without a profile.

The profile names the programs it may launch and the accounts they log in with. There is no default profile: without one, launch and login say so, and the other tools work on clients started by hand.

{
 "programs": {
  "client": {
   "program": "C:/ryzomcore/build/bin/Release/ryzom_client_dev_r.exe",
   "cwd": "C:/ryzomcore/pipeline/client_dev",
   "args": [],
   "env": { "PATH": "C:/ryzomcore/build/bin/Release;C:/external/bin;${PATH}" }
  }
 },
 "accounts": {
  "tester1": { "login": "tester1", "password": "...", "shard": 301 }
 }
}

${NAME} in a value is the variable of nel_mcp's own environment. A password goes from the profile to the client; it never passes through the conversation. When launch logs in with an account, the password is on the client's command line, where other processes of the machine can read it: use this for throwaway development accounts only.

The tools

Tool What it does
list_instances The clients of the machine: name, state, process, log file, account, character. A client that exited shows its reason once; one that crashed shows as gone without a reason.
launch Starts a program of the profile under a name, optionally logged in with an account and a character slot, and waits until its endpoint answers.
login Logs a client in on its login screen with an account of the profile.
kill_instance Kills a client at once.
get_state, wait_for_state The state (login, shard_list, connecting, character_selection, entering_game, loading with its text, in_game, far_tp, leaving_game, quitting), its detail (the login state, the Ring mode, whether the characters arrived), the frame, and whether the main thread runs or has been busy for how long. A wait replaces sleeping, and does not run out its time when the state cannot come: it ends at once when a message box opens or the client exits, and when the client went to another settled state and stays there (a character back in the game instead of the editor).
get_log The client's log lines, indexed from 1 since it started, by index, time or count, by level and word; with wait_seconds it waits for the next matching line.
get_events The same for events: state changes, windows opened and closed and the modal window, message boxes (a login refused with its code shows here), system messages, chat lines, database changes being watched, the exit. With wait_seconds it waits for the next one: a window to open, a line in a channel.
list_commands, run_command The client's commands, run with their arguments as a list; the result has their output and the system messages they showed.
list_methods, call_method Everything else, below. Pictures come back as images.

Every answer carries the client's frame number and clock, so a result lines up with the log and the pictures. The instance parameter can be left out while one client runs.

Methods

list_methods with a prefix lists a group with its descriptions; with schemas it gives their arguments.

  • lua.run runs a Lua chunk of any length in the interface's Lua state and returns what it returns, or the error with a traceback. ah.run runs an action handler by name, ah.list lists them.
  • input.key, input.text, input.mouse: raw input, as the keyboard and mouse give it, with modifiers. Mouse coordinates are pixels of the client area from its top left. A key or button left held is released when the tool disconnects.
  • login.login, chars.list, chars.play (play, or enter the scenario editor), client.reselect (back to the character selection), client.quit.
  • screen.grab (a region, a scale, with or without the interface, the depth), screen.filmstrip (several frames as one picture of thumbnails), screen.diff (where something moves over a series of frames, as a heat map and figures per region), screen.stats (mean colour and luminance). Image pixels divided by the scale given back are the pixels of input.mouse.
  • ui.windows (the open windows front to back, the modal window, the keyboard focus), ui.tree (the element tree with ids, rectangles, texts, tooltips, handlers), ui.get, ui.at (what the mouse would find at a point), ui.click, ui.hover, ui.wheel, ui.drag, ui.set_text. A click by id checks first that the mouse would reach the element at its centre, and fails with what covers it otherwise: a click that passes a modal window would test something a player cannot do.
  • chat.send (say, shout, region, universe, guild, team, a tell, a dynamic channel), chat.channels; the lines that arrive are chat events.
  • world.self, world.entities, world.target, world.face, world.go_to, world.stop, camera.get, camera.set. A move goes to an entity with the client's own move, or to a point by turning and walking in a straight line, sliding along what it meets: there is no path finding. It answers when it arrived, is blocked, or timed out.
  • world.collision: a top-down SVG picture, in world metres, of what Ctrl+Alt+O draws: walls, the boundaries between walkable surfaces, cell borders, water edges, exterior meshes and doors, the collision primitives, the entities and the character. It covers the collision data loaded around the character.
  • db.get, db.list, db.set, db.watch: the client database; the server branches are read-only, as they are for Lua. strings.get (a string id of the server), strings.ui (a text of the interface by key).
  • web.list, web.page (text with its links, or HTML), web.browse, web.back: the in-game browser views.
  • inventory.list, missions.list (with the journal index the CSR commands take).
  • ring.state, ring.tree, ring.palette, ring.set, ring.create, ring.erase, ring.move, ring.undo, ring.select: the scenario editor, through the editor's own requests, so the changes reach the server and the co-editors and can be undone. An NPC, a creature or an object is created from a palette element, as the palette makes it. The server applies each request a moment later and ring.tree shows it from then on, so a client that quits right after an edit can lose it.
  • net.record, net.stats: the impulses of msg.xml received and sent (the position of the character among them), by name, size and server tick, and the connection's state and ping. The actions the connection sends by itself (targets, pickups), visual properties and acknowledgements are not impulses and are not in the record.
  • client.window (on Windows with the virtual desktops, the one shown and the one the window is on), client.desktop (moves the window to another desktop), client.perf.

The methods that act as a button of a screen (logging in, playing a character, going back to the character selection) refuse while a modal window is open, as the button would: ui.windows names it and ui.click closes it.

The methods that change something take the client's lease: one connection drives a client at a time, the others can still read. The lease goes with the connection that holds it. While a tool holds it, the client takes its input as if it had the focus.

Rules

  • Only the command line switches it on. Not client.cfg, which the client reads again while it runs and patches replace, nor a variable or a command, which the server and the interface's Lua can reach.
  • The user of the machine is the boundary. The endpoint is a named pipe that refuses remote clients, cannot be taken over by another process, and admits the current user only; elsewhere a socket in a folder only the user can open. There is no network port, not even on loopback. Whoever opens it acts as the user: it runs Lua with what the interface's Lua has (with AllowDebugLua, the host libraries too) and the client's commands.
  • No new powers in the game. It does what the interface and the commands of the client can already do for that account. A move, a target, a camera or a Ring edit is what the player's input would send.
  • Methods are not commands. They are reachable from the endpoint only; neither the command registry, nor Lua, nor the server can call them.

For other programs

The endpoint is part of NeL (nel/misc/ctrl_endpoint.h): any NeL program can listen the same way and add its own methods, and nel_mcp knows nothing of the client. nel/samples/misc/ctrl_endpoint is a small program that hosts one. The channel is the one the services already use with the service dashboards, in its version 3: lines of tab-separated fields, with calls, JSON arguments and results, and data frames for pictures.

Clone this wiki locally