roblox-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseroblox-mcp
roblox-mcp
Official sources:
- https://create.roblox.com/docs/en-us/studio/mcp
- https://create.roblox.com/docs/en-us/ai/build
- https://create.roblox.com/docs/en-us/scripting/sync
- https://modelcontextprotocol.io/docs/getting-started/intro
The official Roblox Studio MCP server lets a connected AI client inspect and edit an open place. It provides tools for scripts, instances, Luau execution, assets, and playtesting.
官方来源:
- https://create.roblox.com/docs/en-us/studio/mcp
- https://create.roblox.com/docs/en-us/ai/build
- https://create.roblox.com/docs/en-us/scripting/sync
- https://modelcontextprotocol.io/docs/getting-started/intro
官方 Roblox Studio MCP server 允许已连接的 AI 客户端检查和编辑打开的 place。它提供用于脚本、instance、Luau 执行、asset 和 playtesting 的工具。
What the Studio MCP server is
Studio MCP server 是什么
Roblox Studio implements a Model Context Protocol (MCP) server using transport. The server runs as a local process on your machine and proxies requests from a supported AI client into the active Studio session. It is the bridge between your editor's agent and Studio: Script Sync handles disk-to-Studio file syncing, while MCP handles everything else (Explorer selection, instance inspection, script editing, Luau execution, play mode, input simulation, and asset insertion).
stdioRoblox Studio 基于 transport 实现了一个 Model Context Protocol(MCP) server。该 server 作为本地进程运行在你的机器上,并将受支持 AI 客户端的请求代理到活动的 Studio 会话中。它是编辑器中的 agent 与 Studio 之间的桥梁:Script Sync 负责从磁盘到 Studio 的文件同步,而 MCP 负责其他所有工作(Explorer 选中操作、instance 检查、脚本编辑、Luau 执行、play mode、输入模拟和 asset 插入)。
stdioPrerequisites
先决条件
- Latest Roblox Studio. Update through the launcher or download from the Creator Hub.
- An MCP-capable AI client. Cursor, VS Code with Claude Code, Claude Desktop, Codex CLI, Gemini CLI, Antigravity, or any client that supports transport.
stdio - A Roblox account signed into Studio.
- Git (recommended) for the file-based workflow.
- 最新版本的 Roblox Studio。通过启动器更新,或从 Creator Hub 下载。
- 支持 MCP 的 AI 客户端。Cursor、配合 Claude Code 使用的 VS Code、Claude Desktop、Codex CLI、Gemini CLI、Antigravity,或任何支持 transport 的客户端。
stdio - 已登录 Studio 的 Roblox 账号。
- Git(推荐),用于基于文件的工作流。
Enabling the server in Studio
在 Studio 中启用 server
- Open Studio and load the place you want the agent to work on.
- Open Assistant (button in the upper right).
- Click ⋯ → Manage MCP Servers.
- Turn on Enable Studio as MCP server.
- The panel shows quick-connect options and manual configuration snippets. A green indicator appears when a client connects.
If you do not see MCP options, restart Studio after updating to the latest version.
- 打开 Studio 并加载希望 agent 操作的 place。
- 打开 Assistant(右上角的按钮)。
- 点击 ⋯ → Manage MCP Servers。
- 开启 Enable Studio as MCP server。
- 面板会显示快速连接选项和手动配置片段。客户端连接后会出现绿色指示器。
如果更新后仍看不到 MCP 选项,请重启 Studio。
Connecting your client
连接客户端
Choose the method that matches your client:
Quick connect supports Antigravity, Codex CLI, Claude Code, Claude Desktop, Cursor, Gemini CLI, and Visual Studio Code.
- In Studio: Assistant → ⋯ → Manage MCP Servers → Quick connect.
- Turn on your installed client.
- Restart the client if the tools do not appear immediately.
For clients that read an or similar config file, see references/setup-and-connection.md for per-OS, copy-paste configurations.
mcp.jsonFor clients that need a raw CLI command, see references/setup-and-connection.md for Windows and macOS commands.
After connecting, verify with:
Use the Roblox MCP to read the current game tree in Roblox Studio. List what's in Workspace.
选择与你的客户端匹配的方法:
Quick connect 支持 Antigravity、Codex CLI、Claude Code、Claude Desktop、Cursor、Gemini CLI 和 Visual Studio Code。
- 在 Studio 中:Assistant → ⋯ → Manage MCP Servers → Quick connect。
- 开启已安装的客户端。
- 如果工具没有立即显示,请重启客户端。
对于会读取 或类似配置文件的客户端,请参阅 references/setup-and-connection.md,其中提供了针对各 OS、可直接复制的配置。
mcp.json对于需要原始 CLI 命令的客户端,请参阅 references/setup-and-connection.md,其中提供了 Windows 和 macOS 命令。
连接后,使用以下提示进行验证:
使用 Roblox MCP 读取 Roblox Studio 中当前的游戏树。列出 Workspace 中的内容。
What you can do with the MCP tools
可以使用 MCP 工具完成什么
The server exposes tools in several categories. The current tool names and usage guidance are in references/tool-reference.md.
| Category | Examples |
|---|---|
| Scripts | |
| Data model | |
| Luau execution | |
| Asset generation & insertion | |
| Playtesting | |
| Input simulation | |
| Documentation | |
| Instance discovery | |
该 server 公开了多个类别的工具。当前工具名称和使用指南位于 references/tool-reference.md。
| 类别 | 示例 |
|---|---|
| 脚本 | |
| 数据模型 | |
| Luau 执行 | |
| Asset 生成与插入 | |
| Playtesting | |
| 输入模拟 | |
| 文档 | |
| Instance 发现 | |
Work with MCP and Script Sync
结合使用 MCP 和 Script Sync
Script Sync maps folders on disk (, , , etc.) to Studio services, so files you edit locally appear in Studio automatically. MCP covers everything Script Sync cannot reach: editing , inserting models, running commands, playtesting, and inspecting instances.
ServerScriptService/ReplicatedStorage/StarterPlayerScripts/.luauStarterGuiTypical agent loop:
- Edit disk files through Script Sync for reusable modules and scripts.
- Use MCP to inspect instances, run Luau snippets, start play mode, and capture output/screenshots.
- Use MCP to edit scripts that live in containers not covered by Script Sync (for example, ).
StarterGui
See references/script-sync-integration.md for the full setup and a starter-project layout.
Script Sync 将磁盘上的文件夹(、、 等)映射到 Studio service,因此在本地编辑的 文件会自动出现在 Studio 中。MCP 覆盖 Script Sync 无法触及的所有内容:编辑 、插入 model、执行命令、playtesting 和检查 instance。
ServerScriptService/ReplicatedStorage/StarterPlayerScripts/.luauStarterGui典型的 agent 工作流:
- 通过 Script Sync 编辑磁盘文件,以管理可复用的 module 和 script。
- 使用 MCP 检查 instance、运行 Luau 片段、启动 play mode,并捕获输出和截图。
- 使用 MCP 编辑 Script Sync 未覆盖容器中的 script(例如 )。
StarterGui
有关完整设置和 starter project 布局,请参阅 references/script-sync-integration.md。
Multi-instance handling
多 instance 处理
Call to discover connected windows, their Studio instance IDs, and place IDs. Local places without a place ID are listed by name. Pass the selected instance's on every subsequent tool call; do not rely on a shared active window or infer the target from an object path. Re-list instances when a window closes or the target changes.
list_roblox_studiosstudio_id调用 可发现已连接的窗口、其 Studio instance ID 和 place ID。没有 place ID 的本地 place 会按名称列出。在每次后续工具调用中传入所选 instance 的 ;不要依赖共享的活动窗口,也不要根据 object path 推断目标。当窗口关闭或目标发生变化时,请重新列出 instance。
list_roblox_studiosstudio_idSecurity and trust
安全与信任
MCP clients can read and modify your open places. Treat MCP connections like any privileged integration:
- Only connect clients you trust.
- Work on test places or version-controlled projects.
- Review agent edits before publishing.
- Keep and other place files out of Git (use the starter
.rbxlx)..gitignore - Disconnect or disable the MCP server when it is not in use.
- Treat as privileged code: it can publish places, write to DataStores, make HTTP requests, and access credentials loaded in Studio.
execute_luau
See references/security-and-troubleshooting.md for the full security checklist and troubleshooting steps.
MCP 客户端可以读取和修改你打开的 place。请将 MCP 连接视为任何其他特权集成:
- 仅连接你信任的客户端。
- 在测试 place 或受版本控制的项目中工作。
- 发布前检查 agent 的编辑内容。
- 不要将 和其他 place 文件提交到 Git(使用 starter
.rbxlx)。.gitignore - 不使用时断开或禁用 MCP server。
- 将 视为特权代码:它可以发布 place、写入 DataStores、发起 HTTP 请求,以及访问 Studio 中加载的凭据。
execute_luau
有关完整安全检查清单和故障排除步骤,请参阅 references/security-and-troubleshooting.md。
Verification checklist
验证清单
- Studio is updated and MCP is enabled.
- AI client shows the Roblox MCP tools after restart.
- or
script_readreturns the current place structure.search_game_tree - Script Sync maps the expected service folders to disk (if using file-based workflow).
- can run a simple
execute_luauand return output.print - enters/exits play mode successfully.
start_stop_play
- Studio 已更新且 MCP 已启用。
- AI 客户端在重启后显示 Roblox MCP 工具。
- 或
script_read返回当前 place 结构。search_game_tree - Script Sync 将预期的 service 文件夹映射到磁盘(如果使用基于文件的工作流)。
- 可以运行简单的
execute_luau并返回输出。print - 可以成功进入和退出 play mode。
start_stop_play
Scripts
脚本
- : a diagnostic snippet you can run with
scripts/MCPReadyChecker.luato verify Script Sync status and basic model health.execute_luau - : a reusable utility for summarizing the game tree, useful as a pattern for agent exploration prompts.
scripts/StudioModelProbe.lua
- :可通过
scripts/MCPReadyChecker.lua运行的诊断片段,用于验证 Script Sync 状态和基本模型运行状况。execute_luau - :用于汇总游戏树的可复用 utility,可作为 agent 探索提示词的参考模式。
scripts/StudioModelProbe.lua
How to proceed
后续操作
- Confirm prerequisites and enable MCP in Studio.
- Connect your client using quick connect or the manual config in references/setup-and-connection.md.
- Verify the connection with a simple tree-read or call.
execute_luau - If using a file-based workflow, set up Script Sync per references/script-sync-integration.md.
- Use the tool reference to craft precise agent prompts and the security guide to keep the workflow safe.
- 确认先决条件并在 Studio 中启用 MCP。
- 使用 Quick connect 或 references/setup-and-connection.md 中的手动配置连接客户端。
- 使用简单的 tree-read 或 调用验证连接。
execute_luau - 如果使用基于文件的工作流,请按照 references/script-sync-integration.md 设置 Script Sync。
- 使用工具参考编写精准的 agent 提示词,并遵循安全指南以确保工作流安全。
Reference index
参考索引
- script-sync-integration.md: Combine files on disk with Studio MCP edits and playtests.
- security-and-troubleshooting.md: Investigate MCP connection failures or review Studio access.
- setup-and-connection.md: Enable Studio MCP and connect a client on Windows or macOS.
- tool-reference.md: Choose a Studio MCP tool and identify the target Studio instance.
- script-sync-integration.md:将磁盘上的文件与 Studio MCP 编辑和 playtest 结合起来。
- security-and-troubleshooting.md:排查 MCP 连接故障或检查 Studio 访问权限。
- setup-and-connection.md:在 Windows 或 macOS 上启用 Studio MCP 并连接客户端。
- tool-reference.md:选择 Studio MCP 工具并确定目标 Studio instance。