Skip to content

Conversation

@michaelnugent
Copy link

This change allows the user to select listening on 0.0.0.0 instead of only loopback. Loopback is left as the default and the python portion's default assumes the hardcoded port on localhost unless cli arguments are passed. Dockerfile (see #108 ) has been updated to pass cli arguments.

Added

  • Network Interface Configuration in Unity MCP Bridge

    • Added toggle option to listen on all network interfaces (0.0.0.0) vs. loopback only (127.0.0.1)
    • Added display of available IP addresses in the editor window
    • Added persistence of network interface settings using EditorPrefs
    • Added helper method to discover available IP addresses on the machine
  • Docker Support for UnityMcpServer

    • Added command-line parameters to specify Unity host and port
    • Added --unity-host parameter to connect to specific Unity Editor hostname/IP
    • Added --unity-port parameter to specify custom port
    • Added --log-level parameter to control logging verbosity
    • Added README.docker.md with Docker configuration instructions
    • Added configuration examples for both Docker and Podman

Changed

  • Modified UnityMcpBridge to support binding to all interfaces
  • Updated Dockerfile to use a flexible ENTRYPOINT that accepts command-line arguments
  • Enhanced connection logging to show the host and port being used
  • Updated UnityMcpServer to explicitly use command-line parameters
  • Improved error messages with more diagnostic information

Security

  • Added warning message when listening on all interfaces
  • Default binding remains on loopback only (127.0.0.1) for security
  • Added documentation about security implications of network exposure

@bhadrik
Copy link

bhadrik commented May 20, 2025

I have created agent inside of Unity instead of managing MCP, check it out here.
https://github.com/bhadrik/unity-autopilot

@Scriptwonder
Copy link
Collaborator

Cool work! I will try it myself this week.

@dsarno
Copy link
Collaborator

dsarno commented Aug 12, 2025

Thanks for this! And sorry for delay while we got running again. This idea—letting the bridge listen on all interfaces (0.0.0.0) and adding simple flags so the Python server can point at a non‑localhost Unity—is useful. The editor UI that shows the bound address and available IPs is also handy. 

This PR is now behind our main branch, targets now deprecated master, and has merge conflicts in the hot files. To keep the repo tidy, I’m going to close this for now.

If you’d like to revive it, a smaller, rebased PR would be easy to review. Two good options:
1. Unity‑only: add the “Listen on all interfaces” toggle + warning + IP list in the Unity MCP window, no Python/Docker changes. 
2. Python‑only: add --unity-host / --unity-port (and optional --log-level) to the server and use them in the connection code, no Unity UI changes. 

Either way, please rebase onto main and we’ll take another look.

Where the conflicts are (so it’s clear what to trim or rework):
• UnityMcpBridge.cs: replaces the listener setup to switch between Loopback and Any, adds ListenOnAllInterfaces with EditorPrefs + restart logic. Our current bridge code on main has evolved, so this block won’t apply cleanly. 
• UnityMcpEditorWindow.cs: adds the binding toggle, warning, and IP list UI. The window layout/state code has changed on main, so the UI section will collide. 
• Python server: introduces CLI args in config.py, calls load_config_from_args() in server.py, and threads host/port into unity_connection.py. Our server bootstrap/logging has changed, so expect conflicts there too. 
• New Docker bits (UnityMcpServer/src/Dockerfile, README.docker.md): may overlap with current packaging/dev setup; safest to split into a separate PR if still needed. 

Appreciate the contribution—happy to review a slimmer, rebased version.

@dsarno dsarno closed this Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants