Unreal Engine MCP
repository·main·Indexed 22 days ago
https://github.com/flopperam/unreal-engine-mcpA Model Context Protocol (MCP) server that enables AI agents in IDEs like Cursor and Claude Code to control the Unreal Engine editor via natural language. It offers a hosted service with 50+ advanced tools for Blueprint authoring, Materials, VFX, and Animation, as well as an open-source local version for basic scene manipulation, actor management, and world building.
What's inside unreal-engine-mcp
- Blueprint Graph Programming allows you to programmatically create and manipulate Unreal Engine Blueprint graphs using the MCP server. You can add nodes, connect them to create execution and data flow, and create variables with custom types and default values. This enables building complete Blueprint logic through natural language commands without manually opening the Blueprint editor.
Available Blueprint Creation and Inspection Tools
mainThe MCP server provides two categories of tools for working with Blueprints:
Creation Tools
add_node: Add a node to a Blueprint graph (e.g., Print, Events, Variables).connect_nodes: Connect two nodes together to build execution flow and data connections.disconnect_nodes: Remove connections between nodes.create_variable: Add new properties/variables to your Blueprints.
Inspection Tools
read_blueprint_content: Read the complete Blueprint structure (variables, functions, components, event graph).analyze_blueprint_graph: Analyze detailed graph structure including nodes, pins, and connections.get_blueprint_variable_details: Get variable information like types, defaults, and metadata.get_blueprint_function_details: Get function signatures, parameters, and graphs.
The Blueprint Authoring Cycle
mainThe Flopperam Unreal Engine MCP follows a structured lifecycle for creating and editing Blueprints. For complex work, follow the full cycle. For trivial edits (like a single variable tweak), you can skip directly from reading to writing.
Full Cycle:
- Orient (Read): Use
bp_brieforbp_inspectto understand the existing structure. - Probe (Optional): Use
bp_dry_runto validate intent or specs without making changes. - Create: Use
bp_createto generate new assets. - Author: Perform "narrow writes" using specific tools (variables, components, nodes, etc.).
- Commit: Use
bp_committo compile and layout the changes. - Verify: Use
bp_inspectorpie_test_bpto confirm structural and runtime correctness.
Trivial Edit Shortcut:
bp_read_tool$\rightarrow$bp_write_tool$\rightarrow$bp_commit.- Orient (Read): Use
Best practices for efficient MCP tool usage
mainTo optimize performance and avoid hitting constraints when using the Unreal Engine MCP, follow these efficiency rules:
- Batch everything: Use tools that accept arrays (e.g.,
queries,variables,components,nodes,edges,operations) to perform multiple operations in a single call. - Parallelize calls: Call independent tools in parallel (e.g., you can call
search_assetsandscene_querysimultaneously if they don't depend on each other). - Use filters: Leverage filters in inspection tools like
bp_inspect,material_inspect,widget_inspect, andanimation_inspectto reduce data volume. - Defer compilation: When performing multiple Blueprint writes using
bp_*tools, defer the compilation step. Batch your writes first, then callbp_commitonce at the end.
Critical Constraints
- Response Limits: Responses are capped at 512KB. Use filters and targeted queries to stay within this limit.
- Path Resolution:
search_assetsreturns paths inPackageName.AssetNameformat. Always use the FULL path returned by this tool.- Do not guess
/Game/...paths; they resolve tonullptrif incorrect. Always resolve paths viasearch_assetsfirst.
- Actor Labels:
scene_queryreturns actor labels, which are NOT asset paths.
- Batch everything: Use tools that accept arrays (e.g.,
Understand Blueprint Graph tool architecture
mainThe Blueprint Graph tools consist of a high-performance C++ core and a Python MCP wrapper layer.
C++ Core (Performance Layer)
NodeManager.cpp: Handles node creation logic.BPConnector.cpp: Manages node connections.BPVariables.cpp: Handles variable creation and management.
Python Wrapper (MCP Interface)
node_manager.py: Provides theadd_nodetool.connector_manager.py: Providesconnect_nodesanddisconnect_nodestools.variable_manager.py: Provides thecreate_variabletool.
Performance Benchmarks
- Node creation: ~10-50ms per node
- Connection: ~5-20ms per connection
- Variable creation: ~20-50ms
- Blueprint compilation: ~100-500ms (depending on complexity)
Recommendation: Use batch operations where possible to minimize round-trip latency.
Understand the Unreal Engine MCP Architectures
mainThere are two distinct ways to integrate AI with Unreal Engine using MCP, depending on whether you want a managed service or a local open-source setup.
1. Hosted Flop MCP (Recommended)
This is a managed service that uses a streamable HTTP MCP protocol. It connects your AI client (like Cursor, Claude Code, or Windsurf) to a hosted server, which then communicates via WebSockets to the FlopAI Unreal plugin. This setup provides access to over 50+ specialized tools covering Blueprint authoring, Scene & Level management, Materials, VFX, Animation, and more.
2. Open-Source Local MCP
This is the version provided in this repository. It uses the
stdioMCP protocol to connect your AI client to a local Python server (unreal_mcp_server_advanced.py). The Python server communicates with the UnrealMCP C++ plugin via a TCP socket. This setup is focused on core tools like World Building, Physics, Materials, Blueprint Systems, and Actor Management.Multi-AI Collaboration Patterns
mainYou can orchestrate multiple AI agents to work on different zones or districts of a single world.
Competition Pattern: Assign agents to specific coordinate zones (e.g., West vs East) and provide them with distinct toolsets and architectural styles to build competing cities.
Collaborative World Building: Assign specific districts to different agents (e.g., Agent 1 handles Residential with
construct_house, Agent 2 handles Commercial withcreate_town, and Agent 3 handles Entertainment withcreate_maze).### Collaborative World Building **User Prompt:** *"Have multiple AIs work together to build different districts of the same city"* **District Assignments:** ```bash # AI 1: Residential District construct_house(house_style="cottage", location=[-1000, -1000, 0]) construct_house(house_style="modern", location=[-500, -1000, 0]) construct_house(house_style="cottage", location=[-1000, -500, 0]) # AI 2: Commercial District create_town(town_size="small", architectural_style="downtown", location=[0, 0, 0]) create_tower(height=15, base_size=5, tower_style="square", location=[200, 200, 0]) # AI 3: Entertainment District create_maze(rows=10, cols=10, location=[1000, 0, 0])Reference: Unreal Engine Coordinate System
mainUnderstanding the Unreal Engine coordinate system for positioning actors:
- X-axis (Red): Forward/Backward (positive = forward)
- Y-axis (Green): Left/Right (positive = right)
- Z-axis (Blue): Up/Down (positive = up)
- Units: Centimeters (100 = 1 meter)
Safe Positioning Guidelines
- Ground Level: Z = 0
- Above Ground: Z = 200+ (2 meters up)
- Horizontal Spacing: 300+ units between objects
- Large Objects: 500+ units spacing
Core Scene & World Building Workflow
mainThe Flopperam Unreal Engine MCP follows a three-step pattern for scene and world building to ensure stability and correctness:
- Observe: Use
scene_brieffor a high-level level overview,scene_queryto find specific actors, orsearch_assetsto find meshes and materials. - Execute: Use
scene_composefor batch actor placement/modification or use domain-specific tools (e.g.,landscape_edit,foliage_edit) for specialized systems. - Verify: Use
scene_querywith spatial filters to confirm placement, orpie_test_sceneto test runtime behavior.
Important Distinction:
- Scene tools work on actors (instances already placed in the level).
- Asset tools (like
search_assets) work on assets (reusable files in the Content Browser).
- Observe: Use
Compare Hosted Flop MCP vs. Open-Source Local MCP
mainThere are two ways to use the Unreal Engine MCP. Choose based on your requirements for tool depth and setup complexity:
Hosted Flop MCP (Recommended)
- Best for: Production use, advanced Blueprint authoring, and full feature sets.
- Capabilities: 50+ tools across 9 domains (Blueprint lifecycle, Materials, VFX, Animation, AI, etc.).
- Setup: Minimal. Requires an API key and the FlopAI Unreal plugin. No local Python dependencies.
- Server: Hosted at
https://agent.flopperam.com/mcp.
Open-Source Local MCP
- Best for: Community use and basic scene/actor manipulation.
- Capabilities: Basic toolset for scene manipulation, actor management, world building, and foundational Blueprint operations.
- Setup: Requires cloning the repo, Python 3.12+, and compiling the UnrealMCP plugin bundled in the repo.
- Server: Run locally from the
Python/folder.
Use Material Parameter Collections for global effects
mainUse Material Parameter Collections to manage global parameter sets that are accessible from any material. This is the recommended approach for implementing world-wide effects such as:
- Time-of-day transitions.
- Weather systems.
- Global color tinting.
How to use the Flopperam Unreal Engine MCP
mainThe Flopperam Unreal Engine MCP server controls a live Unreal Editor instance via WebSocket. All tools operate directly on the running editor. If you encounter connection errors, ensure the Unreal Editor is running and the FlopAI plugin is loaded.
Core Workflow
To interact with the editor effectively, follow this three-step pattern:
- Orient: Use tools like
bp_brief,scene_brief,search_assets, orproject_contextto understand the current state. - Execute: Use domain-specific tools (e.g.,
bp_graph,material_edit,niagara_edit) to perform tasks. - Verify: Re-examine changes using inspection tools (e.g.,
bp_inspect,actor_inspect) or run PIE (Play In Editor) tests to confirm runtime behavior.
Intent Classification Guidelines
Before calling a tool, determine the user's intent to avoid accidental modifications:
- Question / explanation: Answer from knowledge. Use read-only tools for specifics. Do NOT make changes.
- Inspection / analysis: Use read-only tools and report findings. Do NOT modify anything.
- Modification / creation: Proceed with the full observe → execute → verify workflow.
- Orient: Use tools like