Roblox MCP
Connects to Roblox Studio via a local Studio plugin, enabling AI clients to inspect the scene tree, read and write scripts, modify instance properties, create/delete instances, insert models, and execute Luau directly in the open place.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Roblox MCP把 Workspace/Baseplate 的 Size 改成 Vector3(100,1,100),材质改成 Neon"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Roblox MCP
把 Roblox Studio 接进任意 MCP 客户端(Claude Desktop、Claude Code、Cursor、Codex、DSH……), 让 AI 直接读场景、改属性、写脚本、跑 Luau,每一步都能 Ctrl+Z 撤销。
只在本机工作:MCP 服务器监听
127.0.0.1:44755,Studio 插件用长轮询连上来,不经过任何外网。
MCP 客户端 ──stdio──▶ roblox-mcp ──HTTP 127.0.0.1:44755──▶ Studio 插件 ──▶ 你的 place功能
分类 | 工具 | 说明 |
观察 |
| 插件是否连接、当前 place、桥接端口 |
观察 |
| 场景树(服务 / 实例 / 类名),可限深度和节点数 |
观察 |
| 单个实例的类、常用属性、Attributes、子节点 |
观察 |
| 按名字片段 / 类名搜索实例 |
观察 |
| 列出所有脚本及行数 |
观察 |
| 读取脚本源码 |
观察 |
| 用户当前选中的实例 |
修改 |
| 新建 Part / Script / Model 等,可带初始属性 |
修改 |
| 改属性,支持 |
修改 |
| 删除实例(拒绝删服务) |
修改 |
| 用 InsertService 从资产 id 插入模型 |
修改 |
| 整段替换脚本源码 |
执行 |
| 在 Studio 里跑 Luau 片段并返回结果 |
所有修改都会包在 ChangeHistoryService 记录里,Studio 里按一次 Ctrl+Z 即可回滚。
Related MCP server: Roblox Studio MCP
安装
1. 装 Python 服务器
git clone https://github.com/sdhzcxnb0/Roblox-MCP.git
cd Roblox-MCP
pip install -e . # 需要 Python 3.10+,会装官方 MCP SDK也可以不安装、直接从仓库目录用 python -m roblox_mcp 启动。
2. 装 Studio 插件
把 plugin/RobloxMCP.lua 复制到 Studio 的插件目录:
系统 | 路径 |
Windows |
|
macOS |
|
然后重启 Studio,在工具栏 Plugins 里找到 MCP 按钮(插件第一次运行会自动开始连接)。
还需要打开 HTTP 请求:Studio → Game Settings → Security → Allow HTTP Requests。
3. 配 MCP 客户端
Claude Desktop(claude_desktop_config.json):
{
"mcpServers": {
"roblox": {
"command": "roblox-mcp"
}
}
}Claude Code / Codex CLI:
claude mcp add roblox -- roblox-mcpDSH(本 Harness):在 profile 的 cordis.patch.yml 里加一条:
- id: mcp-roblox
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: roblox
transport: stdio
command: python3
args: ['-m', 'roblox_mcp']
cwd: /path/to/Roblox-MCPCursor / 其他客户端:同样填 command: roblox-mcp、transport: stdio。
4. 验证
重启客户端后问一句「Studio 连上了吗?」,模型会调用 studio_status;
返回 connected 且 place 名称正确就说明通了。
用法示例
帮我看看 Workspace 里有哪些 Part。
把 Workspace/Baseplate 的 Size 改成 Vector3(100, 1, 100),颜色改成 Enum.Material.Neon。
在 ServerScriptService 里新建一个 Script 叫 Main,内容是一个每 5 秒 print 的循环。
读一下 ReplicatedStorage/Config,把 speed 改成 32。
在 Workspace 里插入模型 1033714,放在 Vector3(0, 10, 0)。路径写法:从服务开始,/ 分隔,例如 Workspace/House/Wall,根可以写 game。
属性值写法:普通 JSON 标量(true、0.5、"hi")或字面量:
Vector3(1,2,3)、Color3(1,0,0)、Color3("#ff8800")、Enum.Material.Glass、
CFrame(0,5,0)、UDim2(0,100,0,50)、NumberRange(0,10)。
常见问题
现象 | 处理 |
工具报「插件未连接」 | Studio 没开、插件没启用,或 44755 端口被占用(换端口见下) |
Studio 输出里出现 HTTP 403 | Game Settings 里没开 Allow HTTP Requests |
| 该资产不允许 free 拉取;换公开模型 id 或在 Creator Store 授权 |
| 插件需要能 |
端口冲突 |
|
想加一层认证 |
|
安全说明
execute_luau等同于让 AI 在 Studio 里执行任意代码(以插件权限),只在你信得过的客户端/模型下使用。服务器只绑定
127.0.0.1,不对外网开放;可选--token防止本机其他程序冒充插件。插件不发送你的文件、账号或 Cookie,只回传场景结构与脚本内容。
开发
python tests/test_e2e.py # 无需 Studio:用假插件跑通 13 个工具的端到端测试roblox_mcp/— MCP 服务器(server.py工具、bridge.py长轮询桥、values.py值编解码)plugin/RobloxMCP.lua— Studio 插件(单文件)tests/fake_plugin.py— 模拟 Studio 的桥接客户端docs/protocol.md— 桥接协议说明
Roadmap
capture_viewport(截图给模型看效果)批量
apply_patch(一次改多个实例,单条 undo)资源/属性的事件订阅,长任务进度上报
License
MIT
Available Tools
13 toolscreate_instanceC
Create a new instance. class_name is a Roblox class such as 'Part', 'Script', 'Model'. properties is an optional JSON object like {"Size": "Vector3(4,1,2)", "Anchored": true}.
Inputs: class_name (required), name, parent, properties.
delete_instanceB
Delete (Destroy) an instance by path. Wrapped in an undo recording.
Inputs: path (required).
execute_luauB
Run a Luau snippet inside Studio and return its return value plus printed output. Use sparingly: dedicated tools are safer. The snippet runs as a temporary ModuleScript.
Inputs: code (required).
get_instanceA
Read one instance: class, curated properties, attributes and children. path is like 'Workspace/Baseplate'. properties is an optional comma list of property names.
Inputs: path (required), properties.
get_selectionB
Show what the user currently has selected in Studio.
Inputs: no named parameters.
get_treeA
Print the instance tree of the open place as text. root is a path like 'Workspace' or 'game' (default), max_depth limits recursion (default 2).
Inputs: root, max_depth, max_nodes.
insert_modelB
Insert a model or asset from the Roblox catalog into the place via InsertService. asset_id is the catalog asset id; position is optional like 'Vector3(0,5,0)'.
Inputs: asset_id (required), parent, position.
list_scriptsC
List all scripts in the place (path, class, line count).
Inputs: root, max_results.
read_scriptC
Read the source of a Script/LocalScript/ModuleScript by path.
Inputs: path (required).
search_instancesB
Find instances by name substring and/or exact class name. Returns paths with class.
Inputs: query (required), root, class_name, max_results.
set_propertyB
Set one property on an instance. Values accept plain JSON scalars or literals such as 'Vector3(4,1,2)', 'Color3(1,0,0)', 'Enum.Material.Neon', 'CFrame(0,5,0)'.
Inputs: path (required), value (required), property (required).
studio_statusA
Check whether the Roblox Studio plugin is connected and report the open place, port and queue state.
Inputs: no named parameters.
write_scriptB
Replace the source of a Script/LocalScript/ModuleScript by path (undoable).
Inputs: path (required), source (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 13 tools
Each tool targets a distinct resource or action, but there are mild overlaps: get_instance vs read_script (both read instance data, one script-source-specific) and create_instance vs insert_model (both add objects, one generic, one catalog asset). execute_luau intentionally overlaps with everything, though its description explicitly says to prefer dedicated tools.
Almost all tools follow a clean snake_case verb_noun pattern (read_script, get_tree, create_instance, set_property, delete_instance, list_scripts, write_script). The only deviation is studio_status, which is a descriptive noun phrase without a verb, but it remains readable and predictable.
13 tools is well within the sweet spot and every tool maps to a meaningful Studio operation: status, inspection, search, mutation, scripts, and asset insertion. Nothing feels redundant enough to remove, and nothing essential is obviously missing from the count.
The surface covers the core lifecycle: inspect (status, tree, instance, selection, search), mutate (create, set_property, delete, insert_model), and script management (read/list/write) plus an escape hatch via execute_luau. Gaps include no explicit playtest start/stop control, no undo/redo tool, and no dedicated reparent/rename operation, though most can be worked around via set_property (Parent/Name) or execute_luau.
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Connect AI agents to Replynodes over the Model Context Protocol.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Roblox Studio to AI coding editors via the Model Context Protocol, allowing AI agents to understand and interact with live Roblox Studio sessions through scene manipulation, scripting, and optional Roblox Open Cloud API integration.66MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Roblox Studio, enabling them to interact with instance hierarchy, edit Luau scripts, manage properties, and sync files over a local connection.7 npm2MIT
- AlicenseNot gradedqualityDmaintenanceConnects Roblox Studio to local AI agents via HTTP, allowing them to control Studio tools.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to explore, edit, and automate Roblox Studio sessions locally, including browsing instance hierarchies, reading and modifying scripts, manipulating properties, creating instances, building terrain, and running playtests.875 npmMIT