roblox-studio-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorking in Roblox Studio through MCP
通过 MCP 在 Roblox Studio 中工作
Roblox Studio ships a built-in MCP server (stdio). With it, an agent can explore the open place,
edit scripts, run Luau in edit/server/client contexts, playtest, read the Output, capture the viewport,
and simulate player input. It is the fastest way to verify Roblox changes instead of guessing.
Roblox Studio 自带一个 内置 MCP server(stdio)。借助它,Agent 可以探索已打开的 place,
编辑脚本,在 Edit/Server/Client 上下文中运行 Luau,进行 playtest,读取 Output,截取视口画面,
并模拟玩家输入。这是验证 Roblox 改动的最快方式,无需依赖猜测。
Setup
设置
- Latest Studio → open Assistant → … → Manage MCP Servers → enable Enable Studio as MCP server.
- Use Quick connect (Claude Code, Claude Desktop, Codex CLI, Cursor, Gemini CLI, VS Code, Antigravity) or configure the client manually:
| OS | Command |
|---|---|
| macOS | |
| Windows | |
bash
undefined- 最新版 Studio → 打开 Assistant → … → Manage MCP Servers → 启用 Enable Studio as MCP server。
- 使用 Quick connect(Claude Code、Claude Desktop、Codex CLI、Cursor、Gemini CLI、VS Code、Antigravity) 或手动配置客户端:
| 操作系统 | 命令 |
|---|---|
| macOS | |
| Windows | |
bash
undefinedClaude Code
Claude Code
claude mcp add Roblox_Studio -- /Applications/RobloxStudio.app/Contents/MacOS/StudioMCP
claude mcp add Roblox_Studio -- cmd.exe /c "%LOCALAPPDATA%\Roblox\mcp.bat" # Windows
```json
{ "mcpServers": { "Roblox_Studio": { "command": "/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP" } } }Client-specific config (Codex , OpenCode , Cursor/VS Code ):
references/client-setup.md. A green indicator in Manage MCP Servers
confirms the connection. Only connect clients you trust: they can read and modify your places.
config.tomlopencode.jsonmcp.jsonclaude mcp add Roblox_Studio -- /Applications/RobloxStudio.app/Contents/MacOS/StudioMCP
claude mcp add Roblox_Studio -- cmd.exe /c "%LOCALAPPDATA%\Roblox\mcp.bat" # Windows
```json
{ "mcpServers": { "Roblox_Studio": { "command": "/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP" } } }客户端专属配置(Codex 、OpenCode 、Cursor/VS Code ):
references/client-setup.md。Manage MCP Servers 中出现绿色指示灯
即表示连接成功。仅连接你信任的客户端:它们可以读取和修改你的 place。
config.tomlopencode.jsonmcp.jsonTools
工具
| Group | Tools |
|---|---|
| Session | |
| Explore | |
| Edit | |
| Run | |
| Playtest | |
| Assets | |
| Delegation | |
| Knowledge | |
| 分组 | 工具 |
|---|---|
| 会话 | |
| 探索 | |
| 编辑 | |
| 运行 | |
| Playtest | |
| 资产 | |
| 委派 | |
| 知识 | |
The working loop
工作流程
- Orient: → pick
list_roblox_studios;studio_id. Map the project withget_studio_state(depth-limited: services first), thensearch_game_tree/script_grepfor the feature.script_search - Read before writing: every script you'll touch and its requirers. Check for a Rojo/Script Sync setup (see below) before editing in Studio.
script_read - Edit with (exact, minimal edits; keep existing style). Create instances/attributes/ tags with
multi_editinexecute_luaucontext — changes made this way are real edits to the place.Edit - Verify statically: re-read the script; for pure modules, a quick check (
execute_luauthe module inrequireand call functions).Edit - Playtest: (start) → wait →
start_stop_playfor errors → drive the scenario withget_console_output/ input tools →character_navigationinexecute_luau/Serverto assert state →Clientfor visual checks →screen_capture(stop). Always stop play when done.start_stop_play - Report what changed and what was verified (and what wasn't).
luau
-- Example execute_luau (Server context during play): assert game state instead of eyeballing.
local Players = game:GetService("Players")
local results = {}
for _, player in Players:GetPlayers() do
local leaderstats = player:FindFirstChild("leaderstats")
local coins = leaderstats and leaderstats:FindFirstChild("Coins")
table.insert(results, `{player.Name}: {if coins and coins:IsA("IntValue") then coins.Value else "missing"}`)
end
return table.concat(results, "\n")- 定位:→ 选择
list_roblox_studios;studio_id。使用get_studio_state梳理项目结构(限制 depth:先查各项 services),再通过search_game_tree/script_grep查找目标功能。script_search - 写入前先读取:读取你将要修改的每个脚本及其调用方。编辑 Studio 前,检查是否配置了 Rojo/Script Sync(见下文)。
- 编辑:使用 进行精确、最小化的编辑,并保持现有风格。通过
multi_edit在execute_luau环境中创建 instances/attributes/tags——以此方式进行的更改是对 place 的真实编辑。Edit - 静态验证:重新读取脚本;对于纯 module,在 中
Edit该 module 并调用 functions, 使用require执行快速检查。execute_luau - Playtest:(启动)→ 等待 → 通过
start_stop_play检查错误 → 使用get_console_output/input tools 驱动测试场景 → 在character_navigation/Server中执行Client以 assert 状态 → 使用execute_luau进行视觉检查 →screen_capture(停止)。完成后务必停止 play。start_stop_play - 报告修改了哪些内容、验证了哪些内容,以及哪些内容未经验证。
luau
-- Example execute_luau (Server context during play): assert game state instead of eyeballing.
local Players = game:GetService("Players")
local results = {}
for _, player in Players:GetPlayers() do
local leaderstats = player:FindFirstChild("leaderstats")
local coins = leaderstats and leaderstats:FindFirstChild("Coins")
table.insert(results, `{player.Name}: {if coins and coins:IsA("IntValue") then coins.Value else "missing"}`)
end
return table.concat(results, "\n")Rules of thumb
经验法则
- in
execute_luaumutates the place: prefer read-only queries while exploring, and batch intentional changes into one clear script. UseEditrecording (ChangeHistoryService/TryBeginRecording) so the user can undo your edit as one step.FinishRecording - Changes made during play (Server/Client contexts) are discarded when play stops — edit in .
Edit - Rojo projects: the file system is the source of truth — edit files on disk, let Rojo sync, and use
MCP to playtest/inspect. Editing synced scripts via gets overwritten. Script Sync projects sync both ways, so either side works, but don't edit the same script in both at once.
multi_edit - Keep queries narrow (path + depth); large places produce huge outputs.
search_game_tree - Multiple Studio windows: always pass the right ; tell the user which place you touched.
studio_id - Inserted assets from the Creator Store can contain scripts: inspect them (+
search_game_tree) before keeping them; remove unexpected scripts (backdoors are common in free models).script_read - Don't claim success without evidence: cite console output, assertion results, or screenshots.
- 在
execute_luau中会修改 place:探索时优先使用只读查询,并将有意进行的更改批量合并到一个清晰的脚本中。使用Editrecording(ChangeHistoryService/TryBeginRecording),让用户可以将编辑作为一步撤销。FinishRecording - play 期间(Server/Client 上下文)所做的更改会在停止 play 时被丢弃——应在 中编辑。
Edit - Rojo 项目:文件系统是 source of truth——在磁盘上编辑文件,让 Rojo 同步,并通过 MCP 进行 playtest/检查。通过 编辑已同步的脚本会被覆盖。Script Sync 项目会双向同步,因此任一侧都可编辑,但不要同时在两侧编辑同一脚本。
multi_edit - 保持 查询范围狭窄(path + depth);大型 place 会产生巨量输出。
search_game_tree - 多个 Studio 窗口:始终传入正确的 ;告知用户修改了哪个 place。
studio_id - 从 Creator Store 插入的资产可能包含 scripts:保留前先检查它们(+
search_game_tree);删除意外的 scripts(免费模型中常见 backdoors)。script_read - 没有证据时不要宣称成功:应引用 console output、assertion results 或 screenshots 作为依据。
Roblox-authored skills and conversions
Roblox 编写的 skills 与转换工具
Studio exposes Roblox-authored skills through the tool (e.g. , ,
, , , ). Roblox also
publishes an official streaming conversion skill (, downloadable from the
"Techniques and conversion" streaming docs) that runs through this MCP server; back up the place first.
skillrbx-debugrbx-perf-profilingrbx-scene-analysisrbx-unit-testrbx-docs-searchrbx-device-simulator-lua/rbx-convert-to-streamingStudio 通过 工具提供由 Roblox 编写的 skills(例如 、、
、、、)。Roblox 还
发布了官方 streaming conversion skill(,可从 streaming 文档中的
“Techniques and conversion”下载),该 skill 通过此 MCP server 运行;请先备份 place。
skillrbx-debugrbx-perf-profilingrbx-scene-analysisrbx-unit-testrbx-docs-searchrbx-device-simulator-lua/rbx-convert-to-streamingRelated skills
相关 skills
roblox-testingroblox-performanceroblox-toolingroblox-architectureroblox-code-reviewroblox-testingroblox-performanceroblox-toolingroblox-architectureroblox-code-review