rbxstudio-mcp 2.2.0 → 2.2.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/dist/index.js +6 -6
- package/dist/tools/index.js +3 -3
- package/package.json +1 -1
- package/studio-plugin/plugin.luau +47 -23
package/dist/index.js
CHANGED
|
@@ -758,13 +758,13 @@ class RobloxStudioMCPServer {
|
|
|
758
758
|
properties: {
|
|
759
759
|
maxWidth: {
|
|
760
760
|
type: 'number',
|
|
761
|
-
description: 'Maximum width of the returned image (default:
|
|
762
|
-
default:
|
|
761
|
+
description: 'Maximum width of the returned image (default: 768). Smaller = faster + less data.',
|
|
762
|
+
default: 768
|
|
763
763
|
},
|
|
764
764
|
maxHeight: {
|
|
765
765
|
type: 'number',
|
|
766
|
-
description: 'Maximum height of the returned image (default:
|
|
767
|
-
default:
|
|
766
|
+
description: 'Maximum height of the returned image (default: 768). Smaller = faster + less data.',
|
|
767
|
+
default: 768
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
770
|
}
|
|
@@ -818,8 +818,8 @@ Lighting presets: bright (3-point lighting), studio (flat/even), dark (dramatic)
|
|
|
818
818
|
resolution: {
|
|
819
819
|
type: 'object',
|
|
820
820
|
properties: {
|
|
821
|
-
width: { type: 'number', description: 'Image width (64-2048, default:
|
|
822
|
-
height: { type: 'number', description: 'Image height (64-2048, default:
|
|
821
|
+
width: { type: 'number', description: 'Image width (64-2048, default: 768)' },
|
|
822
|
+
height: { type: 'number', description: 'Image height (64-2048, default: 768)' },
|
|
823
823
|
},
|
|
824
824
|
description: 'Render resolution',
|
|
825
825
|
},
|
package/dist/tools/index.js
CHANGED
|
@@ -867,8 +867,8 @@ export class RobloxStudioTools {
|
|
|
867
867
|
// ============================================
|
|
868
868
|
async captureScreenshot(maxWidth, maxHeight) {
|
|
869
869
|
const response = await this.client.request('/api/capture-screenshot', {
|
|
870
|
-
maxWidth: maxWidth ||
|
|
871
|
-
maxHeight: maxHeight ||
|
|
870
|
+
maxWidth: maxWidth || 768,
|
|
871
|
+
maxHeight: maxHeight || 768,
|
|
872
872
|
returnBase64: true
|
|
873
873
|
});
|
|
874
874
|
// If we have base64 RGBA data, convert it to PNG for proper image viewing
|
|
@@ -949,7 +949,7 @@ export class RobloxStudioTools {
|
|
|
949
949
|
const response = await this.client.request('/api/render-object-view', {
|
|
950
950
|
instancePath,
|
|
951
951
|
angle: options?.angle || 'iso',
|
|
952
|
-
resolution: options?.resolution || { width:
|
|
952
|
+
resolution: options?.resolution || { width: 768, height: 768 },
|
|
953
953
|
lighting: options?.lighting || 'bright',
|
|
954
954
|
background: options?.background || 'transparent',
|
|
955
955
|
autoDistance: options?.autoDistance !== false,
|
package/package.json
CHANGED
|
@@ -4374,30 +4374,46 @@ end
|
|
|
4374
4374
|
|
|
4375
4375
|
handlers.stopPlay = function(requestData)
|
|
4376
4376
|
local success, result = pcall(function()
|
|
4377
|
-
|
|
4377
|
+
-- NOTE: RunService:IsRunning() returns false from plugin context even when play test is running
|
|
4378
|
+
-- So we always try to stop via StudioTestService first
|
|
4378
4379
|
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
wasRunning = false,
|
|
4383
|
-
message = "Play test was not running"
|
|
4384
|
-
}
|
|
4385
|
-
end
|
|
4386
|
-
|
|
4387
|
-
-- Try StudioTestService:EndTest first if available
|
|
4388
|
-
local endedViaStudioTest = false
|
|
4389
|
-
pcall(function()
|
|
4390
|
-
local studioTestService = game:GetService("StudioTestService")
|
|
4391
|
-
-- EndTest must be called from test context, but Stop() should work
|
|
4380
|
+
-- Try StudioTestService:EndTest first (matches ExecutePlayModeAsync)
|
|
4381
|
+
local studioTestSuccess, studioTestService = pcall(function()
|
|
4382
|
+
return game:GetService("StudioTestService")
|
|
4392
4383
|
end)
|
|
4393
4384
|
|
|
4394
|
-
|
|
4385
|
+
if studioTestSuccess and studioTestService then
|
|
4386
|
+
local endSuccess, endError = pcall(function()
|
|
4387
|
+
studioTestService:EndTest()
|
|
4388
|
+
end)
|
|
4389
|
+
|
|
4390
|
+
if endSuccess then
|
|
4391
|
+
activePlayTestTask = nil
|
|
4392
|
+
return {
|
|
4393
|
+
success = true,
|
|
4394
|
+
method = "StudioTestService:EndTest",
|
|
4395
|
+
message = "Stopped play test"
|
|
4396
|
+
}
|
|
4397
|
+
else
|
|
4398
|
+
-- EndTest failed, try RunService:Stop as fallback
|
|
4399
|
+
RunService:Stop()
|
|
4400
|
+
activePlayTestTask = nil
|
|
4401
|
+
return {
|
|
4402
|
+
success = true,
|
|
4403
|
+
method = "RunService:Stop (fallback)",
|
|
4404
|
+
message = "Stopped play test",
|
|
4405
|
+
warning = "EndTest failed: " .. tostring(endError) .. ". Used RunService:Stop() which does NOT restore pre-play state."
|
|
4406
|
+
}
|
|
4407
|
+
end
|
|
4408
|
+
end
|
|
4409
|
+
|
|
4410
|
+
-- No StudioTestService, use RunService:Stop
|
|
4395
4411
|
RunService:Stop()
|
|
4396
4412
|
activePlayTestTask = nil
|
|
4397
4413
|
|
|
4398
4414
|
return {
|
|
4399
4415
|
success = true,
|
|
4400
|
-
|
|
4416
|
+
method = "RunService:Stop",
|
|
4401
4417
|
message = "Stopped play test",
|
|
4402
4418
|
warning = "Note: RunService:Stop() does NOT restore pre-play state. Objects created/modified during play remain changed."
|
|
4403
4419
|
}
|
|
@@ -4462,9 +4478,9 @@ handlers.captureScreenshot = function(requestData)
|
|
|
4462
4478
|
local CaptureService = game:GetService("CaptureService")
|
|
4463
4479
|
local AssetService = game:GetService("AssetService")
|
|
4464
4480
|
|
|
4465
|
-
-- Parameters
|
|
4466
|
-
local maxWidth = requestData.maxWidth or
|
|
4467
|
-
local maxHeight = requestData.maxHeight or
|
|
4481
|
+
-- Parameters (default 768 to avoid CaptureService bug with <600px)
|
|
4482
|
+
local maxWidth = requestData.maxWidth or 768
|
|
4483
|
+
local maxHeight = requestData.maxHeight or 768
|
|
4468
4484
|
local returnBase64 = requestData.returnBase64 ~= false -- Default true
|
|
4469
4485
|
|
|
4470
4486
|
-- Use a BindableEvent to wait for the async callback
|
|
@@ -4724,10 +4740,10 @@ handlers.renderObjectView = function(requestData)
|
|
|
4724
4740
|
}
|
|
4725
4741
|
end
|
|
4726
4742
|
|
|
4727
|
-
-- Parse resolution
|
|
4728
|
-
local resolution = requestData.resolution or {width =
|
|
4729
|
-
local width = resolution.width or
|
|
4730
|
-
local height = resolution.height or
|
|
4743
|
+
-- Parse resolution (default 768 to avoid CaptureService bug with <600px)
|
|
4744
|
+
local resolution = requestData.resolution or {width = 768, height = 768}
|
|
4745
|
+
local width = resolution.width or 768
|
|
4746
|
+
local height = resolution.height or 768
|
|
4731
4747
|
|
|
4732
4748
|
-- Clamp resolution for performance
|
|
4733
4749
|
width = math.clamp(width, 64, 2048)
|
|
@@ -4831,11 +4847,19 @@ handlers.renderObjectView = function(requestData)
|
|
|
4831
4847
|
tempGui.Name = "MCPTempCapture"
|
|
4832
4848
|
tempGui.ResetOnSpawn = false
|
|
4833
4849
|
tempGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
|
|
4850
|
+
|
|
4851
|
+
-- CRITICAL FIX: Scale ViewportFrame to fill most of the screen before capture
|
|
4852
|
+
-- CaptureScreenshot captures the ENTIRE screen, so a small ViewportFrame = tiny object
|
|
4853
|
+
-- By scaling to ~90% of screen, the object fills most of the captured image
|
|
4854
|
+
local screenSize = workspace.CurrentCamera.ViewportSize
|
|
4855
|
+
viewportFrame.Size = UDim2.fromOffset(screenSize.X * 0.9, screenSize.Y * 0.9)
|
|
4856
|
+
viewportFrame.Position = UDim2.fromOffset(screenSize.X * 0.05, screenSize.Y * 0.05)
|
|
4834
4857
|
viewportFrame.Parent = tempGui
|
|
4835
4858
|
tempGui.Parent = game.CoreGui
|
|
4836
4859
|
|
|
4837
4860
|
-- Wait a frame for rendering
|
|
4838
4861
|
RunService.Heartbeat:Wait()
|
|
4862
|
+
task.wait(0.05) -- Extra wait to ensure viewport renders at new size
|
|
4839
4863
|
|
|
4840
4864
|
-- Capture screenshot of the viewport
|
|
4841
4865
|
local captureComplete = Instance.new("BindableEvent")
|