Back to MCP directory
publicPublicdnsLocal runtime

unrealengine5-mcp

这是一个用于Unreal Engine 5.6+的MCP工具,支持通过自然语言控制编辑器操作、创建蓝图、构建节点图、开发游戏能力系统(GAS)以及执行Python脚本,包含RAG驱动的API文档搜索功能。

article

README

🚀 Unreal Engine MCP

MCP 工具可实现对 Unreal Engine 5.6+ 的自然语言控制。专为大型项目设计,支持专业的蓝图工作流程。可通过 MCP 客户端构建节点图、创建游戏玩法能力并自动化编辑器任务。还包含由检索增强生成(RAG)驱动的 Python 脚本编写功能,可查阅 Unreal Python API 文档。

Unreal Engine Python Status

🚀 快速开始

要求

| 组件 | 版本 | |-----------|---------| | Unreal Engine | 5.6+ | | Python | 3.11 | | Claude DesktopCursor | 最新版本 |

⚠️ 重要提示

建议使用 uv 包管理器,若未安装,系统将自动安装。

1. 克隆仓库

git clone https://github.com/gimmeDG/UnrealEngine5-mcp.git
cd UnrealEngine5-mcp

2. 设置 Unreal Engine 插件

  1. Plugins/UnrealEngineMCP 文件夹复制到你的 Unreal 项目的 Plugins/ 目录下。
  2. 在 Unreal 编辑器中打开你的项目。
  3. 启用插件:编辑 → 插件 → 搜索 "UnrealEngineMCP" → 启用
  4. 重启 Unreal 编辑器。

3. 配置 MCP 客户端

Claude Desktop

Windows - 编辑 %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "UnrealEngineMCP": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\path\\to\\unreal-engine-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

macOS - 编辑 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "UnrealEngineMCP": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/unreal-engine-mcp",
        "run",
        "main.py"
      ]
    }
  }
}

Cursor

设置 → MCP → 添加服务器,使用相同的配置:

{
  "UnrealEngineMCP": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/unreal-engine-mcp",
      "run",
      "main.py"
    ]
  }
}

4. (可选)环境设置

cp .env.example .env
# 若需要更改默认设置,请编辑 .env

默认配置可直接使用。服务器将:

  • 自动创建虚拟环境。
  • 安装所有依赖项。
  • 在首次运行时生成 BM25 索引。

✨ 主要特性

| 类别 | 描述 | |----------|-------------| | 蓝图工具 | 创建蓝图、添加组件、构建节点图、管理变量、连接引脚 | | GAS(游戏玩法能力系统) | 创建游戏玩法能力、游戏玩法效果、能力任务,并进行完整的图形构建 | | 编辑器工具 | 生成演员、创建材质、操作变换、搜索资产 | | RAG 搜索 | 使用 BM25 搜索 Unreal Python API 文档 | | Python 执行 | 在 Unreal 中执行由 RAG 驱动的 Python 代码,并进行文档查找 | | PCG 工具 | 创建 PCG 图、添加节点、连接边(早期阶段 - 开发中) |

🎬 演示

Homing Cluster Grenade

寻的集束手榴弹 - Lyra 手榴弹 + MCP 生成的蓝图(GA,技能系统)

📚 详细文档

可用工具

编辑器工具(21 个工具)

| 类别 | 工具 | |----------|-------| | 演员 | spawn_actorspawn_blueprint_actordelete_actorlist_level_actorsset_actor_transformget_actor_propertiesset_actor_property | | 材质 | create_materialapply_material_to_actorget_actor_material_info | | 搜索 | search_actorssearch_assetslist_folder_assetslist_gameplay_tags | | 世界分区 | get_world_partition_infosearch_actors_in_regionload_actor_by_guidset_region_loadedlist_level_instancesget_level_instance_actors | | 实用工具 | get_connection_status |

蓝图工具(47 个工具)

| 类别 | 工具 | |----------|-------| | 核心 | create_blueprintcompile_blueprintanalyze_blueprintcreate_child_blueprintlist_graphs | | 组件 | add_component_to_blueprintset_component_propertyset_physics_propertiesdelete_component_from_blueprintapply_material_to_blueprintget_blueprint_material_infoset_mesh_material_color | | 变量 | add_blueprint_variableadd_blueprint_variable_nodeget_blueprint_variablesdelete_blueprint_variable | | 节点图 | add_blueprint_event_nodeadd_custom_event_nodeadd_blueprint_function_nodeadd_blueprint_flow_control_nodeadd_function_overrideadd_blueprint_input_action_nodeadd_component_getter_nodeadd_property_get_set_nodeadd_blueprint_self_referenceadd_blueprint_generic_nodelist_blueprint_nodesconnect_blueprint_nodesconnect_nodesset_pin_default_valueget_pin_valueset_node_propertydisconnect_blueprint_nodesdelete_blueprint_nodeadd_pindelete_pinadd_comment_box | | GAS | create_gameplay_effectcreate_gameplay_abilityadd_ability_task_nodeexplore_gas_contextlist_attribute_setsget_attribute_set_infobuild_ability_graph | | 反射 | search_functionsget_class_functionsget_class_properties |

RAG 工具(2 个工具)

| 工具 | 描述 | |------|-------------| | search_unreal_api | 使用 BM25 搜索 Unreal Python API 文档 | | execute_unreal_python | 在 Unreal Engine 中执行 Python 代码,并进行安全验证 |

PCG 工具(13 个工具) - 早期阶段

⚠️ 重要提示

PCG 工具已具备功能,但仍在优化中。

| 类别 | 工具 | |----------|-------| | | create_pcg_graphanalyze_pcg_graphset_pcg_graph_to_component | | 节点 | add_pcg_sampler_nodeadd_pcg_filter_nodeadd_pcg_transform_nodeadd_pcg_spawner_nodeadd_pcg_attribute_nodeadd_pcg_flow_control_nodeadd_pcg_generic_nodelist_pcg_nodesconnect_pcg_nodesdisconnect_pcg_nodesdelete_pcg_node |

🔧 技术细节

┌─────────────────────────────────────────────────────────────┐
│              Claude Desktop / Cursor (Client)                │
│            LLM reasoning & tool invocation                   │
└──────────────────────────┬──────────────────────────────────┘
                           │ MCP Protocol (stdio)
┌──────────────────────────┴──────────────────────────────────┐
│                    Python MCP Server                         │
│  ┌────────────────────────────────────────────────────────┐ │
│  │ Tools                                                  │ │
│  │  • editor_tool    - Actor/asset manipulation           │ │
│  │  • blueprint_tool - Blueprint/GAS node graphs          │ │
│  │  • pcg_tool       - PCG graph construction             │ │
│  │  • rag_tool       - API search & Python execution      │ │
│  └────────────────────────────────────────────────────────┘ │
└──────────────────────────┬──────────────────────────────────┘
                           │ TCP
┌──────────────────────────┴──────────────────────────────────┐
│                 Unreal Engine C++ Plugin                     │
│  ┌────────────────────────────────────────────────────────┐ │
│  │ Command Handlers                                       │ │
│  │  • EditorCommands    - Level actor operations          │ │
│  │  • BlueprintCommands - BP asset & node graph editing   │ │
│  │  • PCGCommands       - PCG graph manipulation          │ │
│  │  • PythonExecutor    - Python script execution         │ │
│  └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

RAG System (BM25):
  • Provides Unreal Python API documentation search
  • Used by execute_unreal_python on failure for error recovery
  • No external API keys required

📄 许可证

本项目采用 MIT 许可证。

💬 反馈

发现了 bug 或有建议?提交一个问题

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client