How to Connect Claude Code to Roblox Studio | MCP Integration

Connecting Claude Code to Roblox Studio lets you offload Luau script generation, Instance creation, property changes, and debugging during test play — all from outside the editor — using nothing but natural language instructions. The key is combining the Model Context Protocol (MCP) server officially provided by Roblox with the file-sync tool Rojo. This article organizes three workflows — the official MCP server, community extensions, and the Rojo-based approach — along with hands-on setup instructions.

Article Summary by AI Chatpowered by Claude
結論powered by Claude

There are two main ways to connect Roblox Studio with Claude Code. The official Roblox MCP server exposes object manipulation inside Studio and Luau execution directly as an API, allowing Claude Code to call tools such as create_object, set_property, set_script_source, and execute_luau. The Rojo-based approach, on the other hand, focuses purely on file sync: Claude Code writes local .luau files, and Studio picks them up. The former is interactive; the latter integrates more naturally with Git.

Setup follows the flow of building the MCP server with Rust/Cargo, installing the Rojo plugin in Studio, and connecting with claude --mcp-config. Using the community-distributed npx roxlit setup command lets you generate Rojo initialization and a CLAUDE.md template all at once, and the process takes around 10 minutes on Windows, macOS, or Linux. The most common stumbling blocks when something goes wrong are Rojo's PATH issues and needing to restart aftman.

In practice, the more project conventions you write into CLAUDE.md, the more accurate the output becomes. Declaring naming rules for *.server.luau / *.client.luau / *.luau, enforcing the use of task.wait(), and specifying assumed patterns for RemoteEvents and DataStoreService will naturally align generated code with Roblox conventions. Costs via the Anthropic API typically run a few to around 15 dollars per month — a level that individuals can sustain even for serious game development.

目次 (10)

What Is Roblox Studio MCP?

MCP (Model Context Protocol) is an open standard proposed by Anthropic that connects AI clients with external tools through a shared protocol. In the second half of 2025, Roblox released an official MCP server that makes the Instance tree, scripts, and test-play environment inside Studio operable via MCP. This allows Claude Code to translate instructions like "create a Part and color it red" or "fix the bug in the currently open script" into structured tool calls executed directly against Studio.

The official repository is Roblox/studio-rust-mcp-server, which bundles a Rust-based server binary with a Studio plugin. The plugin holds script execution permissions inside Studio, while the server acts as a bridge to the MCP client — a two-tier architecture. Source: Roblox Creator Docs — Connect to the Roblox Studio MCP server.

Two Connection Approaches: MCP Server and Rojo

There are broadly two implementation methods.

The first is the official MCP server approach. Because Claude Code operates Studio directly, you can interactively add and delete Instances, change properties, inject Luau code, and run test plays. The feedback loop is fast, making it ideal for prototyping. roblox-studio-mcp-claude-code, published by ZubeidHendricks, is a fork of the official server with setup tailored for Claude Code, with reported success on Linux/WSL/macOS/Windows.

The second is the Rojo-based approach. Claude Code writes local files, and the Rojo plugin on the Studio side syncs them in real time. Because it doesn't use MCP, configuration is simpler, commits go cleanly to Git, and it works well for team development. The setup guide published by Roxlit uses this approach (source: Roxlit — How to Use Claude Code with Roblox Studio).

Both approaches can coexist: using MCP for interactive exploration and Rojo for committing stable versions is a practical combination.

Setting Up the Official MCP Server

The official server is written in Rust and built with Cargo. Prerequisites are the Rust toolchain, Roblox Studio, and the Claude Code CLI.

# 1. Install Claude Code
npm install -g @anthropic-ai/claude-code

# 2. Clone and build the official MCP server
git clone https://github.com/Roblox/studio-rust-mcp-server
cd studio-rust-mcp-server
cargo build --release

# 3. Place the Studio plugin (via Rojo or manual copy)
cp plugin/StudioMCP.rbxmx ~/Documents/Roblox/Plugins/

Next, pass the MCP configuration to Claude Code. Create a .mcp.json file at the project root and specify the path to the server binary.

{
  "mcpServers": {
    "roblox-studio": {
      "command": "/absolute/path/to/studio-rust-mcp-server/target/release/studio-mcp",
      "args": []
    }
  }
}

Launch claude in the terminal to start the MCP server, then click the plugin icon on the Studio side and allow the connection. You're ready to go. Use the /mcp command to verify which tools are loaded.

Key MCP Tools Available

Between the official server and the fork, around 50 Studio operation tools are available. Here are some of the most notable ones.

  • create_object — Creates an Instance of any class. Places Parts, Folders, Scripts, RemoteEvents, and more under a specified parent.
  • set_property — Updates properties of existing Instances. Useful for bulk changes like BrickColor, Anchored, and Size.
  • set_script_source — Overwrites the contents of a Script, LocalScript, or ModuleScript. Supports differential editing as well.
  • execute_luau — Runs arbitrary Luau code in the Studio context. Handy for one-off investigations and data formatting.
  • run_code / insert_model — Shorthand wrappers provided in the fork. Lets you bulk-insert models by specifying asset IDs.

Because Claude Code calls these in combination based on the flow of the conversation, users can give natural-language instructions like "double the HP of all enemy characters" and Instance traversal with a set_property loop will be generated automatically.

Rojo-Based Approach and Roxlit Setup

If file sync is all you need, the Rojo + CLAUDE.md setup is straightforward. The community tool roxlit handles Rojo initialization, Aftman configuration, and CLAUDE.md template generation all at once.

# Run inside a new project directory
npx roxlit setup
rojo serve            # Terminal 1
claude                # Terminal 2

Start the Rojo plugin in Studio and press "Connect," and everything under local src/ will sync to ReplicatedStorage and other locations. Each time Claude Code rewrites a file, Studio reflects the change immediately, so you can watch behavior during test play and issue the next instruction.

The most common stumbling block on Windows is the Rojo PATH issue: if you don't restart the terminal after running aftman add rojo-rbx/rojo, you'll get rojo: command not found. On macOS, you may also need to reload your shell rc file.

Declaring Project Conventions in CLAUDE.md

The biggest lever for improving generation quality is writing project-specific assumptions in CLAUDE.md at the repository root. The template recommended by Roxlit includes the following.

  • Language: Generate only Luau — no TypeScript or plain Lua.
  • File naming: *.server.luau (server) / *.client.luau (client) / *.luau (ModuleScript).
  • API patterns: C2S communication via RemoteEvents, shared logic in ModuleScripts, saves via DataStoreService.
  • Anti-patterns: No wait() — use task.wait(). Use task.spawn() instead of spawn().
  • Code style: Read existing scripts and match their naming conventions and indentation.

Claude Code automatically reads this CLAUDE.md on startup and applies it to all subsequent generation. When specs change, updating this file is enough to change behavior — no need to add comments at the end of every script.

Workflow for Real Projects

A stable practical loop consists of the following four steps.

  1. Write the design in Markdown — List game specs, data structures, and screen transitions in bullet points in docs/design.md.
  2. Hand the skeleton to Claude Code — Ask: "Read docs/design.md and generate all server-side scripts and ModuleScripts at once."
  3. Handle placement and adjustments in Studio — Visual elements like models, UI, and lighting are done manually. Tell Claude "you don't need to touch those."
  4. Paste test play logs and request fixes — Paste the full text of errors from the Output window, and you'll get back automatic root-cause identification and diff-based fixes.

The Medium article I Built a Roblox Game Using Only AI Agents describes an independent developer who completed a full game in two weeks using exactly this setup.

Pricing and Operational Considerations

Claude Code runs on Anthropic API billing or a Claude Max subscription. According to Roxlit's estimates, individual developers often stay within 5–15 dollars per month. For ongoing use cases — such as continuously having Claude analyze code after a game's release — Claude Max (flat monthly fee) is more economical.

If you're targeting commercial distribution, you'll want to build in a final human review step to ensure that the Luau code Claude generates doesn't contain API calls that violate Roblox's Terms of Service (external destinations via HttpService, unapproved asset IDs, content outside permitted ratings). MCP tools are powerful, but they can also perform destructive operations against Studio, so the safe approach is to verify behavior in an empty test project before connecting to your production project.

Summary

Connecting Claude Code and Roblox Studio comes down to two workflows: directly and interactively operating Studio via the official MCP server, or running things through file sync via Rojo. The former suits prototyping; the latter suits Git-centered team development. Both can be up and running in about 10 minutes with Rust/Cargo or npx roxlit setup, and generation quality improves the more project conventions you write into CLAUDE.md. Since costs start at just a few dollars per month, a practical approach is to try the Rojo method on a new project first, then add the official MCP server as needed.

Sources

参考になったら ♡
Clauder Navi 編集部
@clauder_navi

Anthropic の Claude / Claude Code を中心に、日本のエンジニア向けに最新動向と実務 を毎日発信。 運営方針 は メディアについて をご覧ください。