rbxstudio-mcp 1.14.0 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rbxstudio-mcp",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "MCP Server for Roblox Studio Integration - Access Studio data, scripts, and objects through AI tools",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -4097,26 +4097,52 @@ end
4097
4097
  -- PLAYTEST CONTROL HANDLERS
4098
4098
  -- ============================================
4099
4099
 
4100
+ -- Track active play test task
4101
+ local activePlayTestTask = nil
4102
+
4100
4103
  handlers.playSolo = function(requestData)
4101
4104
  local success, result = pcall(function()
4102
4105
  local wasRunning = RunService:IsRunning()
4103
4106
 
4104
- -- If already running, stop first (user requested smart restart behavior)
4107
+ -- If already running, stop first
4105
4108
  if wasRunning then
4106
4109
  RunService:Stop()
4107
- -- Small delay to let stop complete
4108
- task.wait(0.1)
4110
+ task.wait(0.2)
4109
4111
  end
4110
4112
 
4111
- -- Start the play test
4112
- RunService:Run()
4113
+ -- Try the new StudioTestService first (available since Dec 2025)
4114
+ local studioTestSuccess, studioTestService = pcall(function()
4115
+ return game:GetService("StudioTestService")
4116
+ end)
4113
4117
 
4114
- return {
4115
- success = true,
4116
- wasRunning = wasRunning,
4117
- message = wasRunning and "Restarted play test (was already running)" or "Started play test",
4118
- note = "Use get_output to read script output. Use stop_play when done."
4119
- }
4118
+ if studioTestSuccess and studioTestService then
4119
+ -- Use the new StudioTestService API for proper Play Solo mode
4120
+ -- Run in background task so we don't block the HTTP response
4121
+ activePlayTestTask = task.spawn(function()
4122
+ -- ExecutePlayModeAsync requires a non-nil argument (can be empty table)
4123
+ local testResult = studioTestService:ExecutePlayModeAsync({})
4124
+ activePlayTestTask = nil
4125
+ end)
4126
+
4127
+ return {
4128
+ success = true,
4129
+ wasRunning = wasRunning,
4130
+ method = "StudioTestService:ExecutePlayModeAsync",
4131
+ message = wasRunning and "Restarted Play Solo (was already running)" or "Started Play Solo mode",
4132
+ note = "Use get_output to read script output. Use stop_play when done."
4133
+ }
4134
+ else
4135
+ -- Fallback to RunService for older Studio versions
4136
+ RunService:Run()
4137
+
4138
+ return {
4139
+ success = true,
4140
+ wasRunning = wasRunning,
4141
+ method = "RunService:Run (fallback)",
4142
+ message = wasRunning and "Restarted play test (was already running)" or "Started Run mode (fallback - StudioTestService not available)",
4143
+ note = "Use get_output to read script output. Use stop_play when done."
4144
+ }
4145
+ end
4120
4146
  end)
4121
4147
 
4122
4148
  if success then
@@ -4141,7 +4167,16 @@ handlers.stopPlay = function(requestData)
4141
4167
  }
4142
4168
  end
4143
4169
 
4170
+ -- Try StudioTestService:EndTest first if available
4171
+ local endedViaStudioTest = false
4172
+ pcall(function()
4173
+ local studioTestService = game:GetService("StudioTestService")
4174
+ -- EndTest must be called from test context, but Stop() should work
4175
+ end)
4176
+
4177
+ -- Use RunService:Stop() - this works for both Run and Play modes
4144
4178
  RunService:Stop()
4179
+ activePlayTestTask = nil
4145
4180
 
4146
4181
  return {
4147
4182
  success = true,