Roblox Studio MCP
The official Roblox Studio MCP server is built into Studio. It provides direct access to the data model, script editing, code execution, asset generation, and playtesting. This skill documents every tool and the patterns for using them reliably.
Available Tools
Scripts
| Tool | What it does |
|---|
| Read scripts by dot-notation path (e.g. game.ServerScriptService.MyScript
). Supports line ranges. |
| Apply multiple edits to a script. Creates the script if the path doesn't exist. |
| Fuzzy search for scripts by name. Returns up to 10 results. |
| Search for a string pattern across all scripts. Returns up to 50 matches. |
Asset & Content Generation
| Tool | What it does |
|---|
| Generate a textured 3D mesh from a description. |
| Generate a custom material or texture. |
generate_procedural_model
| Generate procedural models that scale and adapt automatically. |
insert_from_creator_store
| Insert assets, plugins, and models from the Creator Store. |
Data Model Exploration
| Tool | What it does |
|---|
| Investigate the place in parallel, returns a compact summary. |
| Explore instance hierarchy as flat JSON. Filter by path, type, keywords. |
| Detailed info about a specific instance: properties, attributes, children summary. |
Luau Execution
| Tool | What it does |
|---|
| Run Luau code in Studio. Returns result or error. |
Playtesting
| Tool | What it does |
|---|
| Start or stop playtesting. |
| Retrieve output logs while the game is running. |
| Capture the current Studio viewport in Play mode. |
| Spawn a test character that runs through gameplay scenarios. |
Player Input Simulation
| Tool | What it does |
|---|
| Move the player character to a position or instance. |
| Simulate key presses, holds, and text input. |
| Simulate mouse clicks, movement, and scrolling. |
Session Management
| Tool | What it does |
|---|
| List all connected Studio instances (name, ID, active status). |
| Set which Studio instance receives subsequent tool calls. |
MCP Reliability Patterns
Statelessness
is stateless. Every call is a blank slate. Variables and references do not persist between calls.
luau
-- ALWAYS re-acquire references at the start of every execute_luau call
local model = workspace:FindFirstChild("MyModel")
if not model then
model = Instance.new("Model")
model.Name = "MyModel"
model.Parent = workspace
end
Silent Failures
may return success even when objects weren't created (parent doesn't exist, name collision, etc). Always verify after creation:
luau
-- Create then verify
local part = Instance.new("Part")
part.Name = "Floor"
part.Parent = workspace.MapRoot
-- Verify it exists
local check = workspace.MapRoot:FindFirstChild("Floor")
print(check and "OK" or "FAILED: Floor not created")
Script Truncation
When writing scripts via
or
with
, long scripts may silently truncate. For scripts over ~300 lines:
- Split into logical chunks
- Write each chunk separately using string concatenation
- After writing, read back the last 10-20 lines to verify no truncation
luau
-- Chunked write pattern
local s = game.ServerScriptService.MyScript
local part1 = [=[
-- chunk 1: services and config
local Players = game:GetService("Players")
...
]=]
local part2 = [=[
-- chunk 2: main logic
...
]=]
s.Source = part1 .. part2
Batching
- Part creation: 10-20 parts per call (safe), 25-50 with loops (risky)
- Script writes: one script per call for reliability
- Property changes: batch related changes in one call
- Verification: always verify after creation batches
Ground Truth Rule
Never guess coordinates, sizes, or property values from chat history. If you need current state, READ it:
luau
local part = workspace.MapRoot:FindFirstChild("Tower")
if part then
print("Position:", part.Position)
print("Size:", part.Size)
print("CFrame:", part.CFrame)
end
Workflows
Script Development
- Explore — Use to understand existing structure
- Read — Use to understand existing code before modifying
- Write — Use to create or modify scripts
- Verify — Use to confirm the write succeeded
- Test — Use + to test
Building Geometry
- Plan — Use to see what exists
- Build — Use to create parts (see roblox-building skill)
- Verify — Use to count parts and check properties
- Visual check — Use in play mode to see the result
Debugging
- Reproduce — to enter play mode
- Observe — to read errors/warnings
- Inspect — or to check runtime state
- Fix — to patch the script
- Retest — again
Playtesting
- Start play mode with
- Navigate with
- Interact with /
- Observe with and
- Stop with
MCP Mode Detection
Different MCP servers provide different tool sets. Detect what's available:
- Official Roblox MCP (built into Studio): , , , , , , etc.
- Community MCP (Chrrxs/robloxstudio-mcp): , , , , plus per-peer execution.
- No MCP: Pure code generation only. Provide copy-paste-ready scripts.
Adapt your approach based on what tools are actually available. If a tool call fails with "not found", fall back gracefully.
Setup Reference
Windows
json
{
"mcpServers": {
"Roblox_Studio": {
"command": "cmd.exe",
"args": ["/c", "%LOCALAPPDATA%\\Roblox\\mcp.bat"]
}
}
}
macOS
json
{
"mcpServers": {
"Roblox_Studio": {
"command": "/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP"
}
}
}
Enable in Studio
- Open Assistant
- Click ... > Manage MCP Servers
- Turn on "Enable Studio as MCP server"
Quick connect supports: Codex CLI, Claude Code, Claude Desktop, Cursor, Gemini CLI, VS Code.