This repository was archived by the owner on Apr 3, 2026. It is now read-only.
feat: add run_server_code tool for server context execution#55
Open
kevinswint wants to merge 1 commit intoRoblox:mainfrom
Open
feat: add run_server_code tool for server context execution#55kevinswint wants to merge 1 commit intoRoblox:mainfrom
kevinswint wants to merge 1 commit intoRoblox:mainfrom
Conversation
4 tasks
07b5940 to
c07a213
Compare
c07a213 to
85f4f6c
Compare
Adds MCP tool to execute Luau code in the actual game server context during playtest, unlike run_code which executes in the plugin context. - run_server_code: Executes code where ServerScriptService scripts run - GET/POST /mcp/server_code: HTTP endpoints for command queue/results - MCPServerCodeRunner.lua: ServerScript that polls and executes commands - Built-in commands (STOP, PING, PLAYERS, STATE) work without loadstring - Arbitrary code requires LoadStringEnabled in ServerScriptService Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
85f4f6c to
52f82ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds new MCP tool to execute Luau code in the actual game server context during playtest, unlike
run_codewhich executes in the plugin context.Motivation
Currently,
run_codeexecutes in the plugin's Lua context, which is isolated from server-side game state during playtest. This means you can't:_Gvalues set by ServerScriptService scriptsThis PR adds
run_server_codewhich executes in the actual game server context.New Tool: run_server_code
Architecture
/mcp/server_codeendpointMCPServerCodeRunner.lua) polls for pending codeSetup
MCPServerCodeRunner.luato ServerScriptService in your gamerun_server_codetoolBuilt-in Commands (work without LoadStringEnabled)
PING- Returns "pong" to verify script is runningPLAYERS- Returns list of current playersSTATE- Returns server state info as JSONSTOP- Stops the playtestTest plan
🤖 Generated with Claude Code