Roblox Studio MCP exposes three tools for running Luau code against a connected Studio place. They differ in one critical dimension: which Lua VM the code runs in.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Chrrxs/robloxstudio-mcp/llms.txt
Use this file to discover all available pages before exploring further.
execute_luau always runs inside the Studio plugin’s own thread, which carries PluginSecurity permissions and a separate require cache from your game scripts. eval_server_runtime and eval_client_runtime run directly inside the running game’s Script and LocalScript VMs respectively, sharing the same require cache as your live game code. Choosing the right tool determines whether you see real game state or a plugin-context snapshot of it.
execute_luau
Executes Luau code in the Studio plugin context. The code always runs with PluginSecurity permissions, regardless of the target. When target="server" or target="client-N" is set, the code runs against the live runtime DataModel (so game.Workspace and services reflect live state) but it is not executed in the game’s Script VM — it still runs in the plugin thread with no access to the game’s require cache.
Use print() and warn() for output. Return values are captured and returned to the MCP caller.
When to use: Inspecting and modifying instance properties, calling Plugin APIs, reading DataModel state in the edit context, or performing non-game-logic tasks that need PluginSecurity (e.g. ChangeHistoryService, Selection, Plugin).
Luau code to execute. Use
print() or warn() to emit output. Returned values from the top level are captured.DataModel to run code against.
"edit" (default) targets the edit DataModel. "server" and "client-1", "client-2", etc. target live runtime DataModels during a playtest, but execution still occurs in plugin context.Which connected Studio place to target. Required when multiple places are connected; omit when only one is open. Use
get_connected_instances to list available IDs.Example — read an instance property
When using
target="server" or target="client-N", the code runs against the live runtime DataModel (you see live positions, values, etc.) but in plugin context. If you need to call require() on a module that game scripts have already loaded, use eval_server_runtime or eval_client_runtime instead.eval_server_runtime
Executes Luau code inside the running game’s Server Script VM. This is fundamentally different from execute_luau target="server": the code runs in the same Lua environment as your Script instances, shares the require() module cache with all server scripts currently loaded, and has access to values stored in module-level upvalues.
A runtime bridge is created automatically inside the play DataModel, including for playtests started manually via the Studio Play button — no extra setup is required.
Use return ... to get a value back.
When to use: Inspecting live game state (player data, active rounds, module-level singletons), calling game services, debugging game logic that only exists in the Server Script VM.
Luau code to execute in the server Script VM. Use
return ... to return a value to the MCP caller.Which connected Studio place to target. Required when multiple places are connected; omit when only one is open.
Example — inspect a live server module singleton
eval_client_runtime
Executes Luau code inside a running game client’s LocalScript VM. Like eval_server_runtime, this runs inside the actual game VM (not plugin context) and shares the require() cache with LocalScript and ModuleScript instances loaded on that client.
Use return ... to get a value back.
When to use: Inspecting client-side state — PlayerGui, LocalPlayer, StarterPlayerScripts module singletons, local variables, HUD state, or any client-only logic.
Luau code to execute in the client LocalScript VM. Use
return ... to return a value.Which client to target.
"client-1" (default), "client-2", etc. for multiplayer tests. Use get_connected_instances to see available client roles.Which connected Studio place to target. Required when multiple places are connected; omit when only one is open.
Example — read client-side player state
Plugin context vs. game Script VM — side-by-side
Understanding this distinction is essential when debugging game logic:execute_luau | eval_server_runtime | eval_client_runtime | |
|---|---|---|---|
| VM | Plugin thread (PluginSecurity) | Game Server Script VM | Game Client LocalScript VM |
require() cache | Plugin’s own cache | Shared with game server scripts | Shared with game client scripts |
| Sees live module state? | No (separate cache) | Yes | Yes |
| PluginSecurity APIs? | Yes | No | No |
| Requires playtest? | No (target="edit") | Yes | Yes |
target param? | Yes (edit/server/client-N) | No (always server) | Yes (client-1, client-2, …) |
When you call
execute_luau with target="server", you can read instance properties of live DataModel objects (positions, values, etc.) but you cannot reach into module-level upvalues or singletons that game scripts have populated — because your code runs in the plugin’s separate require() environment. Use eval_server_runtime for that.