Mcp.bat fails to launch Studio MCP due to unquoted path containing spaces ('...\Roblox' is not recognized)

Describe the issue:

When connecting an MCP client (such as Cursor, VS Code, or Claude Desktop) to Roblox Studio via the generated %LOCALAPPDATA%\Roblox\mcp.bat launcher script, the batch script fails during startup if any referenced directory path contains spaces (for example, C:\Users<username>\Documents\Roblox Studio or custom user/content paths).

Because the path inside mcp.bat is not wrapped in double quotes when passed to the shell, Windows cmd.exe splits the path at the first whitespace. This causes the execution to terminate immediately with the following error:

'c:\Users\user\Documents\Roblox' is not recognized as an internal or external command,
operable program or batch file.

As a result, the stdio connection abruptly drops before initialization completes (Connection closed: MCP error -32000). Bypassing mcp.bat and pointing the MCP client directly to StudioMCP.exe inside the active version-… folder completely resolves the issue, confirming the bug is isolated to path string handling inside the batch script.

Steps to Reproduce:

  1. Configure an MCP client using standard Roblox Studio MCP stdio setup referencing mcp.bat:
{
  "mcpServers": {
    "Roblox_Studio": {
      "command": "cmd.exe",
      "args": ["/c", "cd /d %LOCALAPPDATA%\\Roblox && .\\mcp.bat"]
    }
  }
}
  1. Ensure the environment or user content directory contains a path with spaces (e.g., Documents\Roblox Studio).
  2. Attempt to establish an MCP connection from the client while Roblox Studio is running with Enable Studio as MCP server turned on.
  3. Observe the client console log failing at the first whitespace in the path.

Bypass Issue:

Bypass mcp.bat and point directly to StudioMCP.exe
The most reliable fix is to point Cursor directly to Roblox’s StudioMCP.exe executable instead of using the broken batch file.

Step 1: Find the path to your current StudioMCP.exe

Press Win + X and select Terminal or PowerShell.

Paste and run this command:

Get-ChildItem -Path "$env:LOCALAPPDATA\Roblox\Versions" -Filter "StudioMCP.exe" -Recurse | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName
Verification: PowerShell will print a path like:C:\Users\user\AppData\Local\Roblox\Versions\version-xxxxxxxxxxxxxxxx\StudioMCP.exe

Copy this path.

Step 2: Update mcp.json in Cursor

Return to Cursor where you have c:\Users\user.cursor\mcp.json open.

Replace the contents of mcp.json with the following (inserting double backslashes \ into your copied path):

{
    "mcpServers": {
        "Roblox_Studio": {
            "command": "C:\\Users\\user\\AppData\\Local\\Roblox\\Versions\\YOUR_VERSION_FOLDER_HERE\\StudioMCP.exe"
        }
    }
}
Note: Replace YOUR_VERSION_FOLDER_HERE with the actual version-… folder name output by the PowerShell command in Step 1. No cmd.exe or args array is required when targeting the binary directly.

Save the file (Ctrl + S).

Step 3: Enable the server in Roblox Studio and verify

Open Roblox Studio and open any place/project.

In Roblox Studio, open Assistant > click the three dots (…) > Manage MCP Servers > ensure Enable Studio as MCP server is toggled ON.

In Cursor, open Settings > Features > MCP and click Retry next to Roblox_Studio.

Verification: The red status indicator will switch to green, and the full list of Roblox Studio MCP tools (execute_luau, search_game_tree, etc.) will load.

The bypass will not work the next time Studio updates, and you will have to repeat the steps again or figure out a way to get it to point to the correct Studio instance every time.

A private message is associated with this bug report

1 Like