-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Description:
When using the UnrealGenAISupport plugin, I'm unable to correctly connect to or retrieve event nodes (such as Event BeginPlay
, Event ActorBeginOverlap
, and Event Tick
) in the EventGraph through the MCP (Model Control Protocol) server and tool functions. Errors occur when attempting to get these nodes' GUIDs or add new nodes to the EventGraph.
Environment Information:
- Windows 11 24H2 64bit
- Unreal Engine 5.4.4
- Visual Studio 2022 17.13.4
- MSVC v143
- UnrealGenAISupport version: Latest (cloned from main branch)
- MCP Host: Cursor 0.47.8
Prerequisites Completed:
- Set up
.cursor/mcp.json
with the configuration:
{
"mcpServers": {
"unreal-handshake": {
"command": "python",
"args": ["D:/MyProjectPath/ExamplesForUEGenAIPlugin/Plugins/GenerativeAISupport/Content/Python/mcp_server.py"],
"env": {
"UNREAL_HOST": "localhost",
"UNREAL_PORT": "9877"
}
}
}
}
- Installed MCP using pip:
pip install mcp[cli]
- Enabled Python Editor Script Plugin in Unreal Engine
- Successfully started the MCP server:
D:/MyProjectPath/ExamplesForUEGenAIPlugin/Plugins/GenerativeAISupport/Content/Python/unreal_socket_server.py
- Confirmed server initialization with console output:
LogPython: [AI Plugin] Socket server thread started
LogPython: [AI Plugin] Command processor registered
LogPython: [AI Plugin] Unreal Engine AI command server initialized successfully
LogPython: [AI Plugin] Available commands:
LogPython: [AI Plugin] - Basic: handshake, spawn, create_material, modify_object
LogPython: [AI Plugin] - Blueprint: create_blueprint, add_component, add_variable, add_function, add_node, connect_nodes, compile_blueprint, spawn_blueprint, add_nodes_bulk, connect_nodes_bulk
LogPython: [AI Plugin] Unreal Engine socket server started on port 9877
Steps to Reproduce:
- Successfully created a new blueprint 'HelloWorldBP' using
mcp_unreal_handshake_create_blueprint
- Attempted to get the GUID of the default "Event BeginPlay" node in EventGraph using
get_blueprint_node_guid
- Attempted to add a PrintString node to the EventGraph using
add_nodes_to_blueprint_bulk
- Attempted to connect Event BeginPlay node to other nodes
Error Information:
- When attempting to get node GUID:
- Called MCP tool
get_blueprint_node_guid
{
"blueprint_path": "/Game/Blueprints/HelloWorldBP",
"graph_type": "EventGraph",
"node_name": "Event BeginPlay"
}
{
"blueprint_path": "/Game/Blueprints/HelloWorldBP",
"graph_type": "EventGraph",
"node_name": "BeginPlay"
}
- Result
Failed to get node GUID: Node not found: Event BeginPlay
Failed to get node GUID: Node not found: BeginPlay
- When attempting to add nodes to EventGraph:
- Called MCP tool
add_nodes_to_blueprint_bulk
{
"blueprint_path": "/Game/Blueprints/HelloWorldBP",
"function_id": "EventGraph",
"nodes": [
{
"id": "print_string",
"node_type": "PrintString",
"node_position": [
300,
0
],
"node_properties": {
"InString": "Hello World"
}
}
]
}
- Result
Failed to add nodes: Failed to add nodes to /Game/Blueprints/HelloWorldBP
- For individual node addition function:
- Called MCP tool
add_node_to_blueprint
{
"blueprint_path": "/Game/Blueprints/HelloWorldBP",
"function_id": "EventGraph",
"node_type": "PrintString",
"node_position": [
0,
0
]
}
- Result
Failed to add node: add_node() required argument 'finalize_changes' (pos 7) not found
UE Console Logs:
LogPython: [AI Plugin] Processing get_node_guid command: Blueprint: /Game/Blueprints/HelloWorldBP, Graph: EventGraph, Node: Event BeginPlay
LogTemp: Error: Could not find node Event BeginPlay in EventGraph of blueprint /Game/Blueprints/HelloWorldBP
LogPython: Error: [AI Plugin] ERROR: Failed to find node: Event BeginPlay
LogPython: [AI Plugin] Processing get_node_guid command: Blueprint: /Game/Blueprints/HelloWorldBP, Graph: EventGraph, Node: BeginPlay
LogTemp: Error: Could not find node BeginPlay in EventGraph of blueprint /Game/Blueprints/HelloWorldBP
LogPython: Error: [AI Plugin] ERROR: Failed to find node: BeginPlay
LogPython: [AI Plugin] Processing add_nodes_bulk command: Blueprint: /Game/Blueprints/HelloWorldBP, Adding 1 nodes
LogTemp: Error: Invalid GUID format: EventGraph
LogPython: Error: [AI Plugin] ERROR: Failed to add nodes to /Game/Blueprints/HelloWorldBP
LogPython: [AI Plugin] Processing add_node command: Blueprint: /Game/Blueprints/HelloWorldBP, Node: PrintString
LogPython: Error: [AI Plugin] ERROR: Error adding node: add_node() required argument 'finalize_changes' (pos 7) not found
LogPython: Error: [AI Plugin] Traceback:
Traceback (most recent call last):
File "MyProjectPath/ExamplesForUEGenAIPlugin-main/Plugins/GenerativeAISupport/Content/Python\handlers\blueprint_commands.py", line 216, in handle_add_node
node_id = gen_bp_utils.add_node(blueprint_path, function_id, node_type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: add_node() required argument 'finalize_changes' (pos 7) not found
Expected Behavior:
Should be able to:
- Get GUID of default event nodes in EventGraph
- Add new nodes (like
Print String
) to EventGraph - Connect
Event BeginPlay
and other event nodes to other nodes
Working Features:
- Successfully creating new blueprints
- Successfully adding new functions
- Successfully adding and connecting nodes in function graphs
- Successfully compiling blueprints
- Successfully spawning blueprint instances in the level
Here are the successful operation logs:
LogPython: [AI Plugin] Processing add_function command: Blueprint: /Game/Blueprints/HelloWorldBP, Function: PrintHelloWorldFunc
LogTemp: Created function PrintHelloWorldFunc in blueprint /Game/Blueprints/HelloWorldBP
LogPython: [AI Plugin] add_function command successful: Added function PrintHelloWorldFunc to /Game/Blueprints/HelloWorldBP with ID: 262111564132BA98024A959EE7CE40DD
LogPython: [AI Plugin] Processing add_nodes_bulk command: Blueprint: /Game/Blueprints/HelloWorldBP, Adding 1 nodes
LogTemp: Added node of type PrintString to blueprint /Game/Blueprints/HelloWorldBP with GUID DFC8203D4761A0FDAE9B4BA5D21EBF43
LogTemp: Added 1 nodes to blueprint /Game/Blueprints/HelloWorldBP
LogPython: [AI Plugin] add_nodes_bulk command successful: Added 1 nodes to /Game/Blueprints/HelloWorldBP
LogPython: [AI Plugin] Processing connect_nodes command: Blueprint: /Game/Blueprints/HelloWorldBP, CD58F4D847B18FC0E7B95B869923E0A1.Then -> DFC8203D4761A0FDAE9B4BA5D21EBF43.execute
LogTemp: Connected CD58F4D847B18FC0E7B95B869923E0A1.Then to DFC8203D4761A0FDAE9B4BA5D21EBF43.execute in blueprint /Game/Blueprints/HelloWorldBP
LogPython: [AI Plugin] connect_nodes command successful: Connected nodes in /Game/Blueprints/HelloWorldBP
Additional Information:
While attempting to operate nodes in the EventGraph using MCP functions, I observed that manual operations in the Unreal Editor work fine. The issues seem to only occur when using MCP tools for remote operations.
I successfully created a blueprint with a PrintHelloWorldFunc function and added and connected nodes within the function, but cannot perform any operations in the main EventGraph.
The logs indicate specific issues:
- Event BeginPlay node cannot be found in EventGraph (even though it's visible in the UI)
- When trying to add nodes to EventGraph, the system identifies "EventGraph" as an invalid GUID format
- The add_node function is missing the 'finalize_changes' parameter
Could you please provide guidance on how to correctly retrieve and operate nodes in the EventGraph, or indicate if there are any specific settings or conditions that need to be met?
I want to express my sincere appreciation for your work on this plugin. The UnrealGenAISupport plugin is an impressive project that bridges the gap between AI and Unreal Engine development. While I've encountered these issues with EventGraph operations, the plugin's other features work flawlessly, and the architecture is well-designed.
Your efforts in creating this tool that combines cutting-edge LLM/GenAI models with Unreal Engine are truly valuable to the game development community. I'm excited to see this project grow and evolve, and I'm looking forward to contributing to its development in any way I can.
Thank you for your dedication to this project, and I hope this issue report helps improve the plugin's functionality further.