StudioMCP.exe drops connection (EOF) on server/discover initialization request after recent update

So today i updated my Roblox studio and when i opened my antigravity IDE. It gave me an error log heres the error:

Error: expect initialized request, but received: Some(Request(JsonRpcRequest { jsonrpc: JsonRpcVersion2_0, id: Number(1), request: CustomRequest(CustomRequest { method: “server/discover”, params: Some(Object {}), extensions: Extensions }) })) ‘else’ is not recognized as an internal or external command, operable program or batch file. ‘“%B/..\StudioMCP.exe”’ is not recognized as an internal or external command, operable program or batch file. ‘))’ is not recognized as an internal or external command, operable program or batch file. : connection closed: calling “initialize”: client is closing: EOF.

Note: This broke the auto generated Windows batch script file syntax failing with %B/..\StudioMCP.exe is not recognized as an internal or external command

14 Likes

It seems like the MCP server connects normally with Claude Code or Visual Studio Code and the error only occurs after Antigravity latest update

3 Likes

Yeah that makes sense because this happened right after i updated my antigravity IDE. But i hope Roblox can update the system so it can work for all.

2 Likes

That’s weird, we haven’t touched that part. You’re using Antigravity IDE, right? Please copy-paste your MCP config. To get it press Ctrl + Shift + P → Manage MCP Servers, click “View raw config” in top right.

3 Likes

This is the Json config that i have been using:
{
“mcpServers”: {
“Roblox_Studio”: {
“command”: “cmd.exe”,
“args”: [
“/c”,
“cd /d %LOCALAPPDATA%\Roblox && .\mcp.bat”
]
}
}
}

1 Like

Also i think the issue stems form the mcp.bat file.

3 Likes

You can try locating the “StudioMCP.exe” file in your current running studio version folder, and instead of having those “args”, replace “cmd.exe” directly with StudioMCP.exe’s path location.
JSON:

"Roblox_Studio": {
  "command": "C:\\Users\\YourUser\\AppData\\Local\\Roblox\\Versions\\version-1234567890(replace with your version file)\\StudioMCP.exe",
  "args": []
}

To locate the studiomcp.exe file, go to run (win+r), type in "%LOCALAPPDATA%/Roblox", and you can use the search bar, when u find the StudioMCP.exe file however, copy its path, they will only have one backslash so you gotta add one more, this is because in JSON ’ \ ’ is an escape character, so you gotta type it twice for it to register once. Lmk if this works.

The problem with Roblox, not Antigravity.

First problem was incorrect use of else statement in mcp.bat

Then Gemini solved that for me but then it gave another error

Gemini created whole another js file to connect Antigravity with Roblox Studio, so it now uses custom mcp bridge file instead of official one. It said official roblox mcp protocol is old.
Just write error to your ai and wait for it to solve it

1 Like

There is one more issue even after connecting to StudioMCP.exe directly. It says:

"Error: Error: expect initialized request, but received: Some(Request(JsonRpcRequest { jsonrpc: JsonRpcVersion2_0, id: Number(1),
request: CustomRequest(CustomRequest { method: "server/discover", params: Some(Object {}), extensions: Extensions }) }))
 : connection closed: calling "initialize": client is closing: EOF."

and after digging into it, and playing around I understood that the reason why we are seeing this error specifically in Antigravity is because Antigravity’s MCP loader sends a custom server/discover request when it first connects to a server. However, the Roblox Studio MCP proxy is written strictly according to the protocol and expects initialize to be the very first request it ever receives, so it immediately crashes when it sees Antigravity’s discovery request.

Roblox needs to rework/update their mcp stuff.
@Urukeli can you please get this resolved?

3 Likes

the “mcp bridge” your talking about is basically a proxy that your agent might have created, usually a python file, but it isn’t the best solution and if u switch models, it will require the other model to gather context again and spend unnecessary credits/usage.

2 Likes

If anyone’s still stuck on this, reverting Antigravity back to 2.1.1 fixes it for now.

Looks like the latest update changed something during startup and sends a request Studio doesn’t expect yet, so Studio just immediately drops the connection. Reverting to 2.1.1 avoids the issue completely.

3 Likes

Yes this is the solution for now. But am still waiting on a for concrete solution for now.

This is still an active bug with the latest version of antigravity.

Still hit the same issue.
As CelestialHonour guy said above, Roblox needs to fix their mcp.

While waiting on an official fix, i have got a small workaround without reverting Antigravity/Gemini to older versions.
My idea is to write a thin wrapper and point your MCP config at that wrapper instead of StudioMCP directly. The wrapper sits in between and handles the protocol mismatch for you.

Requirements
  • Python 3.7+ (i wrote it against Python 3.12.13)
  • Edit STUDIO_PATH in the file to match your PC’s OS:
    • macOS: /Applications/RobloxStudio.app/Contents/MacOS/StudioMCP (same on every Mac)
    • Windows: %LOCALAPPDATA%\Roblox\Versions\version-XXXXXXXXXX\StudioMCP.exe (you must locate your own version- folder, don’t copy someone else’s, the hash differs per machine and changes on every Studio update)
  • macOS: make it executable → chmod +x studiomcp_wrapper.py
  • Windows: no chmod needed, but you can’t point command directly at a .py file → it must be invoked through the interpreter
  • Config syntax differs by OS:
    • macOS (~/.gemini/config/mcp_config.json)
    "Roblox_Studio": {
        "command": "/absolute/path/to/studiomcp_wrapper.py"
      }
    
    • Windows: (%USERPROFILE%\.gemini\config\mcp_config.json)
    "Roblox_Studio": {
      "command": "python",
      "args": ["C:\\absolute\\path\\to\\studiomcp_wrapper.py"]
    }
    
studiomcp_wrapper.py

Replace STUDIO_PATH with your own path

import sys
import json
import subprocess
import threading

STUDIO_PATH = "/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP"


def pump(src, dst):
    try:
        for line in iter(src.readline, ""):
            if not line:
                break
            dst.write(line)
            dst.flush()
    except Exception:
        pass


def main():
    proc = subprocess.Popen(
        [STUDIO_PATH] + sys.argv[1:],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        text=True,
        bufsize=1,
    )

    threading.Thread(target=pump, args=(proc.stdout, sys.stdout), daemon=True).start()
    threading.Thread(target=pump, args=(proc.stderr, sys.stderr), daemon=True).start()

    try:
        for line in sys.stdin:
            line_str = line.strip()
            if not line_str:
                continue

            try:
                msg = json.loads(line_str)
                if isinstance(msg, dict) and msg.get("method") == "server/discover":
                    resp = {
                        "jsonrpc": "2.0",
                        "id": msg.get("id"),
                        "error": {
                            "code": -32601,
                            "message": "Method not found",
                        },
                    }
                    sys.stdout.write(json.dumps(resp) + "\n")
                    sys.stdout.flush()
                    continue
            except Exception:
                pass

            if proc.poll() is not None:
                break

            proc.stdin.write(line_str + "\n")
            proc.stdin.flush()

    except (KeyboardInterrupt, BrokenPipeError):
        pass
    finally:
        try:
            proc.stdin.close()
        except Exception:
            pass
        proc.wait()


if __name__ == "__main__":
    main()

This script should be in /.gemini/studiomcp_wrapper.py. But really, any path works as long as it matches the command field in your config.

Result

3 Likes

downgrade the antigravity version to 2.1.1 it will work

For me it’s working upto 2.3.1.

But I feel like this is because of the MCP v2 update on july 28 (the same day antigravity 2.4.3 also released).

Btw does the new studio mcp update solved the problem for you guys? For me it’s not!

@Urukeli It would be great if you can help with it!

1 Like

But then you cant use 3.7, right?

Anyway, did you guys come up with a solution for this? I’m having the same problem.

2 Likes

I’m having the same issue here

Back to version 2,1,1 of antigravity (if it is the IDE) if it is the antigravity chatbot, it may be a newer version

I particularly abandoned antigravity, even though I signed the pro-annual plan. I realized how far Google is in relation to others AI. I am using Qoder (and that goes fantastic) the prices are very fair and the results are very good. Chinese AIs are very good and are still open source

And as Homer Simpsons (politically inept) would say: I will say something very patriotic as a good American DEATH TO THE UNITED STATES!

2 Likes

If anyone using latest version of Antigravity just like me and wanna stop having headache with this issue. You can download my antigravity plugins and install directly into your antigravity ~/.gemini/config/plugins folder.

Here is github project GitHub - AmmrYsir/roblox-studio-mcp-for-antigravity · GitHub

  1. Download project zip
  2. Move folder into C://.gemini/config/plugins
  3. Restart Antigravity and check your Plugins section on project settings.
  4. Edit mcp_config.json inside plugins folder to change studiowrapper.py path (read READMEmd)
  5. Makes sure plugin is enabled and verify it with AI.
5 Likes