UE5.8 already ships official MCP support; this plugin is my own implementation that follows its design ideas, mainly for cases where the engine can’t be upgraded yet.
If you’re on UE5.8 or above, just use the official plugin — treat what follows as a record of the implementation approach.
Recently I gave the AI coding assistant in our project a new capability: letting it operate a UE project directly inside the editor. The motivation is simple. Large models are already good at editing code, but a lot of game development work isn’t in code — Blueprints, assets, UMG widgets, Level Actors, all these visual assets are out of reach for an AI that can only edit .cpp / .h. So I built an UnrealEngineMCP plugin that exposes these editor capabilities to AI assistants (opencode, Claude Code, and the like) via MCP (Model Context Protocol).
Architecture
Three layers in total:
| |
While building it I split “protocol” from “tools”: the plugin acts only as a tool backend, and the MCP protocol layer is left to the Node wrapper. The reason is simple too: UE 5.7’s HTTPServer module doesn’t support SSE streaming, and MCP depends on streaming. Rather than wrestling with the protocol inside the plugin, put protocol parsing in the wrapper (Node + @modelcontextprotocol/sdk) and leave the plugin with a few pure-JSON HTTP endpoints that take “tool name + arguments” and return a result. Local HTTP overhead is on the order of microseconds, the tools themselves take far longer than the network, you can debug directly with curl, and the Node side has zero dependencies.
run_python: the Universal Entry Point
The most important piece in the plugin is actually run_python: it runs engine Python inside the editor, and after import unreal you can touch basically anything. Use it as the universal entry point to cover most editor operations, then add a few convenience read tools and that’s enough. The usage handed to the AI looks roughly like this:
| |
Smart Startup and Multiple Instances
Once the first version was done and actually in use, three problems showed up:
- Forgot to start the editor — the AI calls a tool, the editor isn’t running, and it simply can’t connect;
- Instances stepping on each other — sometimes two editors are open (usually two instances of the same project), the plugin hardcodes port 8000, the second one can’t bind, and the two instances may read and write different in-memory states, so changes clobber each other;
- Node fallback — the wrapper depends on Node.js; if it isn’t installed, we need a clear message rather than a silent failure.
So I refactored it (the design doc is in docs/), handing the first two problems to the wrapper:
- When the client connects to
unreal-mcpand no editor is running, the wrapper resolves the engine path from the project’sEngineAssociationregistry key, launches the editor itself, and polls until it’s ready before handling calls (the first launch may take 1–3 minutes); - With multiple editors, the wrapper reads
Saved/MCP/instances.jsonto discover instances, picks the first healthy one by default, and you can switch targets withlist_instances/select_instance; all write operations go to the same instance; - The plugin side auto-increments on port conflicts (scanning upward from 8000 for a free one) and writes the actual port back to the registry file.
Tools at a Glance
Besides run_python, a few convenience tools are built in:
| Tool | Description |
|---|---|
list_blueprints | List Blueprint assets in the project (filterable by substring) |
get_blueprint | Read Blueprint structure: parent class, variables, functions |
list_widget_tree | Read the widget tree of a UMG WidgetBlueprint |
get_widget_properties | Read property values of a UMG widget instance |
create_widget_blueprint | Create a UMG WidgetBlueprint |
add_widget_to_tree | Add a widget to the widget tree |
set_widget_properties | Write widget properties by type via Reflection |
remove_widget_from_tree | Remove a widget from the widget tree |
exec_command | Execute shell commands on the editor machine |
list_assets | List assets under a path |
list_actors | List Actors in the current Level |
There are also two instance-management tools provided by the wrapper: list_instances / select_instance.
Usage
Setup isn’t much trouble: copy the plugin directory into the project’s Plugins/ and enable it in the .uproject, run npm install for the wrapper dependencies, build the editor target, and finally point your MCP client at the wrapper’s index.js in .mcp.json.
Day to day it’s basically transparent: just call the tools, and if the editor isn’t open it starts it automatically; with multiple instances, run list_instances first and then lock onto one with select_instance. For manual control, type UnrealEngineMCP.StartServer 8000 / UnrealEngineMCP.StopServer in the editor console.
Open Source
The plugin is open source on GitHub: UnrealEngineMCP — take a look if you’re interested.
Additional Notes
A few small implementation points:
- Adding a tool doesn’t require touching the wrapper: it discovers tools via
GET /api/toolsand converts JSON Schema → zod fully automatically, so a new tool only needs anIMCPToolclass implemented and registered in C++, with not a single line changed in the wrapper; - The plugin is an
Editormodule, editor-only, so it doesn’t affect the packaged game builds; run_pythoncan run arbitrary code, so it only listens on localhost by default (bListenOnLocalhostOnly), and it should only ever run code you trust — the data sent to the LLM is the project content itself.