rbxstudio-mcp 2.2.0 → 2.2.1
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 +36 -13
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
|
@@ -4384,20 +4384,35 @@ handlers.stopPlay = function(requestData)
|
|
|
4384
4384
|
}
|
|
4385
4385
|
end
|
|
4386
4386
|
|
|
4387
|
-
-- Try StudioTestService:EndTest first if available
|
|
4388
|
-
local
|
|
4389
|
-
|
|
4390
|
-
local studioTestService = game:GetService("StudioTestService")
|
|
4391
|
-
-- EndTest must be called from test context, but Stop() should work
|
|
4387
|
+
-- Try StudioTestService:EndTest first if available (matches ExecutePlayModeAsync)
|
|
4388
|
+
local studioTestSuccess, studioTestService = pcall(function()
|
|
4389
|
+
return game:GetService("StudioTestService")
|
|
4392
4390
|
end)
|
|
4393
4391
|
|
|
4394
|
-
|
|
4392
|
+
if studioTestSuccess and studioTestService then
|
|
4393
|
+
local endSuccess = pcall(function()
|
|
4394
|
+
studioTestService:EndTest()
|
|
4395
|
+
end)
|
|
4396
|
+
|
|
4397
|
+
if endSuccess then
|
|
4398
|
+
activePlayTestTask = nil
|
|
4399
|
+
return {
|
|
4400
|
+
success = true,
|
|
4401
|
+
wasRunning = true,
|
|
4402
|
+
method = "StudioTestService:EndTest",
|
|
4403
|
+
message = "Stopped play test (state restored)"
|
|
4404
|
+
}
|
|
4405
|
+
end
|
|
4406
|
+
end
|
|
4407
|
+
|
|
4408
|
+
-- Fallback to RunService:Stop() if StudioTestService failed
|
|
4395
4409
|
RunService:Stop()
|
|
4396
4410
|
activePlayTestTask = nil
|
|
4397
4411
|
|
|
4398
4412
|
return {
|
|
4399
4413
|
success = true,
|
|
4400
4414
|
wasRunning = true,
|
|
4415
|
+
method = "RunService:Stop",
|
|
4401
4416
|
message = "Stopped play test",
|
|
4402
4417
|
warning = "Note: RunService:Stop() does NOT restore pre-play state. Objects created/modified during play remain changed."
|
|
4403
4418
|
}
|
|
@@ -4462,9 +4477,9 @@ handlers.captureScreenshot = function(requestData)
|
|
|
4462
4477
|
local CaptureService = game:GetService("CaptureService")
|
|
4463
4478
|
local AssetService = game:GetService("AssetService")
|
|
4464
4479
|
|
|
4465
|
-
-- Parameters
|
|
4466
|
-
local maxWidth = requestData.maxWidth or
|
|
4467
|
-
local maxHeight = requestData.maxHeight or
|
|
4480
|
+
-- Parameters (default 768 to avoid CaptureService bug with <600px)
|
|
4481
|
+
local maxWidth = requestData.maxWidth or 768
|
|
4482
|
+
local maxHeight = requestData.maxHeight or 768
|
|
4468
4483
|
local returnBase64 = requestData.returnBase64 ~= false -- Default true
|
|
4469
4484
|
|
|
4470
4485
|
-- Use a BindableEvent to wait for the async callback
|
|
@@ -4724,10 +4739,10 @@ handlers.renderObjectView = function(requestData)
|
|
|
4724
4739
|
}
|
|
4725
4740
|
end
|
|
4726
4741
|
|
|
4727
|
-
-- Parse resolution
|
|
4728
|
-
local resolution = requestData.resolution or {width =
|
|
4729
|
-
local width = resolution.width or
|
|
4730
|
-
local height = resolution.height or
|
|
4742
|
+
-- Parse resolution (default 768 to avoid CaptureService bug with <600px)
|
|
4743
|
+
local resolution = requestData.resolution or {width = 768, height = 768}
|
|
4744
|
+
local width = resolution.width or 768
|
|
4745
|
+
local height = resolution.height or 768
|
|
4731
4746
|
|
|
4732
4747
|
-- Clamp resolution for performance
|
|
4733
4748
|
width = math.clamp(width, 64, 2048)
|
|
@@ -4831,11 +4846,19 @@ handlers.renderObjectView = function(requestData)
|
|
|
4831
4846
|
tempGui.Name = "MCPTempCapture"
|
|
4832
4847
|
tempGui.ResetOnSpawn = false
|
|
4833
4848
|
tempGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
|
|
4849
|
+
|
|
4850
|
+
-- CRITICAL FIX: Scale ViewportFrame to fill most of the screen before capture
|
|
4851
|
+
-- CaptureScreenshot captures the ENTIRE screen, so a small ViewportFrame = tiny object
|
|
4852
|
+
-- By scaling to ~90% of screen, the object fills most of the captured image
|
|
4853
|
+
local screenSize = workspace.CurrentCamera.ViewportSize
|
|
4854
|
+
viewportFrame.Size = UDim2.fromOffset(screenSize.X * 0.9, screenSize.Y * 0.9)
|
|
4855
|
+
viewportFrame.Position = UDim2.fromOffset(screenSize.X * 0.05, screenSize.Y * 0.05)
|
|
4834
4856
|
viewportFrame.Parent = tempGui
|
|
4835
4857
|
tempGui.Parent = game.CoreGui
|
|
4836
4858
|
|
|
4837
4859
|
-- Wait a frame for rendering
|
|
4838
4860
|
RunService.Heartbeat:Wait()
|
|
4861
|
+
task.wait(0.05) -- Extra wait to ensure viewport renders at new size
|
|
4839
4862
|
|
|
4840
4863
|
-- Capture screenshot of the viewport
|
|
4841
4864
|
local captureComplete = Instance.new("BindableEvent")
|