Skip to content
Checking statusStatus

Roblox Studio

Give your Roblox game an AI from a server Script.

Two ways to use Evolved AI with Roblox: let an AI agent build your game in Studio for you (Claude Code, Cursor or Codex, through Studio's own MCP server), or give your game itself an AI brain (NPCs that talk, quests that write themselves) from a server Script.

Build your game with an AI agent

Roblox Studio has a built-in MCP server: an AI coding agent can read your place, write and edit scripts, add parts and assets, run a playtest and read the Output. The agent runs on your Evolved key, so every Claude, ChatGPT and Gemini model works.

  1. Connect your agent to evolved.to first

    Set up the tool you will use with your key: Claude Code (the best fit), Cursor or Codex. In VS Code, use the Claude Code extension. Install the latest Roblox Studio too.

  2. Turn on Studio's MCP server

    Open Roblox Studio and a place, click Assistant (upper right), then … → Manage MCP Servers, and turn on Enable Studio as MCP server.

  3. Quick connect your tool

    In the same MCP Servers settings, open Quick connect and turn on your tool: Claude Code, Cursor, Codex CLI, Visual Studio Code or Claude Desktop. Then restart the tool. If your tool is not in the list, install it and restart Studio.

  4. Check it works

    In Claude Code, run /mcp: Roblox_Studio should be connected. Then ask: Use the Roblox MCP to read the current game tree in Roblox Studio. List what's in Workspace. On a new Baseplate it names Camera, Terrain, Baseplate and SpawnLocation. In Studio, Manage MCP Servers shows a green light with the number of connected tools.

Add the MCP server by hand

If Quick connect is not there, add Studio's server yourself, named Roblox_Studio. For Claude Code, put it in a .mcp.json file in your project folder; for Cursor, in .cursor/mcp.json. If the file already lists other servers, add only the Roblox_Studio entry, then restart the tool.

.mcp.json (Windows)
{
  "mcpServers": {
    "Roblox_Studio": {
      "command": "cmd.exe",
      "args": [
        "/c",
        "%LOCALAPPDATA%\\Roblox\\mcp.bat"
      ]
    }
  }
}
.mcp.json (macOS)
{
  "mcpServers": {
    "Roblox_Studio": {
      "command": "/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP"
    }
  }
}

AI inside your game

Give your Roblox experience an AI brain: NPCs that talk, quests that write themselves, hints for players. Your game server calls evolved.to; the key never reaches a player.

  1. Turn on HTTP requests

    Open Roblox Studio and go to File → Game Settings → Security, then turn on Allow HTTP Requests. Roblox only lets a game call web services after this.

  2. Store your API key safely

    In the Roblox Creator Dashboard, open your experience, then Secrets → Create Secret. Name it EVOLVED_API_KEY and paste your key there.

  3. Add one server Script

    In Explorer, open ServerScriptService, add a Script and paste this test. It sends one message from your game server.

    ServerScriptService/EvolvedTest.server.lua
    local HttpService = game:GetService("HttpService")
    
    local function askEvolved(message)
      local ok, response = pcall(function()
        return HttpService:RequestAsync({
          Url = "https://api.evolved.to/v1/chat/completions",
          Method = "POST",
          Headers = {
            ["content-type"] = "application/json",
            ["x-api-key"] = HttpService:GetSecret("EVOLVED_API_KEY"),
          },
          Body = HttpService:JSONEncode({
            model = "gpt-5-mini",
            messages = {{ role = "user", content = message }},
            max_tokens = 300,
          }),
        })
      end)
    
      if not ok then
        warn("Could not reach Evolved AI:", response)
        return nil
      end
      if not response.Success then
        warn("Evolved AI error:", response.StatusCode, response.Body)
        return nil
      end
    
      local data = HttpService:JSONDecode(response.Body)
      return data.choices[1].message.content
    end
    
    print(askEvolved("Say hello from Roblox Studio."))
  4. Press Play

    Press Play, then open View → Output. The answer appears there.

Good to know

In a real game, give each player a cooldown before the next call, and never send a request on every click or every frame. gpt-5-mini and claude-haiku-4.5 are quick and cheap for game dialogue; every model ID is on the Models page.