Skip to main content

ue-remote-exec

Talk to a running Unreal Engine 5 editor from plain Python, over the editor's built-in Python Remote Execution channel. No C++ plugin, no project changes, no editor restart beyond enabling the built-in switch.

PyPI Python Dependencies License

This is the transport layer extracted from ue5-editor-agent, where it drives 31 editor tools and is tested against a live UE 5.8.2 editor on Windows. It is published separately because the transport is the part other people need to vendor, and because every other implementation of this channel I could find was either abandoned or a hundred lines that stopped at "it pinged once".

from ue_remote_exec import EditorSession

with EditorSession() as session:
    data = session.run("""
import unreal
sub = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)
for actor in sub.get_all_level_actors()[:5]:
    print(actor.get_actor_label())
""")
    print(data["success"])
    for entry in data["output"]:
        print(entry["type"], entry["output"])

Install

pip install ue-remote-exec

Editor setup (once per project)

  1. Edit → Plugins, enable Python Editor Script Plugin and Editor Scripting Utilities.
  2. Edit → Project Settings (project settings, not editor preferences), search for Python, enable Enable Remote Execution? and Develop Mode.
  3. Restart the editor. These settings are read at startup.

Then:

ue-remote discover
ue-remote exec "import unreal; print(unreal.SystemLibrary.get_engine_version())"

The two things that go wrong

These are not bugs in this library; they are properties of the channel. Both were established by reading PythonScriptRemoteExecution.cpp in UE 5.8, and both cost me an afternoon.

1. The TCP direction is inverted

You do not connect to the editor. The editor connects to you.

  1. You listen on a local TCP port (you are the server).
  2. You send open_connection over UDP: "connect to me at x:y".
  3. The editor connects out as a TCP client — in the source it is literally CommandChannelSocket->Connect(*CommandEndpoint.ToInternetAddr()).
  4. Only then can you send command and receive command_result.

Any implementation that tries to socket.connect() to the editor will hang.

2. MulticastBindAddress is one value used as three things

The editor builds its discovery socket like this:

.BoundToAddress(MulticastBindAddress)
.JoinedToGroup(MulticastGroupEndpoint.Address, MulticastBindAddress)
.WithMulticastInterface(MulticastBindAddress)

Bind address, join interface, and egress interface — from a single value, which defaults to 127.0.0.1 in 5.8. So a default install only joins the multicast group on the loopback NIC, and a ping sent from your real NIC reaches nobody.

ue-remote-exec handles this by trying loopback first (build_strategies()), so it works on a default install with no configuration. If discovery still returns nothing, set Project Settings → Plugins → Python → Advanced → Multicast Bind Address to 0.0.0.0 and restart — that is the configuration the engine treats as "normal networking".

Two corollaries worth knowing:

  • The editor's pong is broadcast back to the multicast group, not unicast to the requester. You must call IP_ADD_MEMBERSHIP yourself and bind port 6766. Multicast delivery matches on group address plus port, so binding a random port receives nothing.
  • On Windows, sending UDP to a port nobody is listening on earns an ICMP port-unreachable, which surfaces as WSAECONNRESET (10054) on the next recvfrom and kills the receive loop. This library disables it with SIO_UDP_CONNRESET. Omit that and discovery works exactly once.

API

EditorSession(group, port, command_ip, timeout, verbose) context manager; connect() on entry, close() on exit
session.connect() -> EditorNode discover, start the TCP server, ask the editor to connect back, accept
session.run(code, exec_mode="ExecuteFile", timeout=120.0) -> dict send one command, return the command_result payload
find_editor() -> EditorNode | None discovery only, no session
discover(group, port, timeout, verbose) -> list[dict] discovery with human-readable output
extract_json_objects(buffer) -> (list[dict], bytes) the framing function, if you are writing your own transport

exec_mode is ExecuteFile (a whole script), ExecuteStatement (one statement), or EvaluateStatement (an expression whose value you want).

session.run() returns the raw command_result data: success, command, result, and output (a list of {type, output} where type is Info, Warning, or Error). success is about whether the code raised, not whether it did what you wanted — a script that silently does nothing still reports success: True. Check the state you care about, not the flag.

Framing

Command channel frames have no length prefix and no terminator: bare JSON, one object per send, Strlen bytes. TCP coalesces and fragments them anyway, so extract_json_objects() counts braces while skipping string literals and escape characters, and hands back the incomplete remainder for the next read. That detail matters — a command_result whose result is itself dict-shaped used to swallow the rest of the stream.

What this is not

  • Not a tool layer. It sends strings of Python and returns stdout. If you want typed tools, validation, and a model loop on top, that is ue5-editor-agent.
  • Not a plugin. Everything it can do is what the Python API exposes; it cannot edit Blueprint graph nodes directly, for instance.
  • Not for PIE or packaged builds. The Python plugin only runs inside the editor, which is the engine's design, not a limitation of this library.
  • Not multi-editor. The first discovered node wins.

Tests

python tests/run_all.py      # 16 tests, zero dependencies

The suite covers payload shapes, GUID source ids, JSON framing (concatenated objects, partial reads, braces and escaped quotes inside strings), the loopback- first strategy order, and a real multicast socket bind. It does not need an editor; nothing in it fakes a discovery reply, because a fake reply would prove nothing about whether the real one is parsed correctly.

License

Apache-2.0. See LICENSE.

Metadata

Release files for ue-remote-exec 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ue-remote-exec 0.1.0
File Size Uploaded Provenance Actions
ue_remote_exec-0.1.0.tar.gz 20.4 kB With provenance Details for ue_remote_exec-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ue-remote-exec 0.1.0
File Interpreter ABI Platform Actions
ue_remote_exec-0.1.0-py3-none-any.whl Python 3 none any Details for ue_remote_exec-0.1.0-py3-none-any.whl

Total release size: 37.4 kB

Release files / ue_remote_exec-0.1.0.tar.gz

Download URL ue_remote_exec-0.1.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
16d103a7b50b151b4a8f45aaf3febe3a395c180df87aabd8aa6894f38e8d4df7
BLAKE2b-256 checksum
How to use checksums
36376d20c14c1132ba4aef296d389d035c2b8a469de361b7a653501ddba5aac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / ue_remote_exec-0.1.0-py3-none-any.whl

Download URL ue_remote_exec-0.1.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef1745ace522ecde09ba03f6dba7815de2e902917238a5b60d5bb5ebbebaffd1
BLAKE2b-256 checksum
How to use checksums
cdc636dcfa24c9bbd2444d5e768df6f9757458be2d92305ef496b31996ab11e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for ue-remote-exec 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ue_remote_exec-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page