Cover image
Try Now
4 天前

使用模型上下文协议(MCP),启用Cursor,Windsurf和Claude Desktop等AI助手客户,以通过自然语言控制虚幻引擎。

3 years

Works with Finder

23

Github Watches

44

Github Forks

448

Github Stars

Model Context Protocol for Unreal Engine

unreal-mcp

License: MIT Unreal Engine Python Status

This project enables AI assistant clients like Cursor, Windsurf and Claude Desktop to control Unreal Engine through natural language using the Model Context Protocol (MCP).

⚠️ Experimental Status

This project is currently in an EXPERIMENTAL state. The API, functionality, and implementation details are subject to significant changes. While we encourage testing and feedback, please be aware that:

  • Breaking changes may occur without notice
  • Features may be incomplete or unstable
  • Documentation may be outdated or missing
  • Production use is not recommended at this time

🌟 Overview

The Unreal MCP integration provides comprehensive tools for controlling Unreal Engine through natural language:

Category Capabilities
Actor Management • Create and delete actors (cubes, spheres, lights, cameras, etc.)
• Set actor transforms (position, rotation, scale)
• Query actor properties and find actors by name
• List all actors in the current level
Blueprint Development • Create new Blueprint classes with custom components
• Add and configure components (mesh, camera, light, etc.)
• Set component properties and physics settings
• Compile Blueprints and spawn Blueprint actors
• Create input mappings for player controls
Blueprint Node Graph • Add event nodes (BeginPlay, Tick, etc.)
• Create function call nodes and connect them
• Add variables with custom types and default values
• Create component and self references
• Find and manage nodes in the graph
Editor Control • Focus viewport on specific actors or locations
• Control viewport camera orientation and distance

All these capabilities are accessible through natural language commands via AI assistants, making it easy to automate and control Unreal Engine workflows.

🧩 Components

Sample Project (MCPGameProject) MCPGameProject

  • Based off the Blank Project, but with the UnrealMCP plugin added.

Plugin (UnrealMCP) MCPGameProject/Plugins/UnrealMCP

  • Native TCP server for MCP communication
  • Integrates with Unreal Editor subsystems
  • Implements actor manipulation tools
  • Handles command execution and response handling

Python MCP Server Python/unreal_mcp_server.py

  • Implemented in unreal_mcp_server.py
  • Manages TCP socket connections to the C++ plugin (port 55557)
  • Handles command serialization and response parsing
  • Provides error handling and connection management
  • Loads and registers tool modules from the tools directory
  • Uses the FastMCP library to implement the Model Context Protocol

📂 Directory Structure

  • MCPGameProject/ - Example Unreal project

    • Plugins/UnrealMCP/ - C++ plugin source
      • Source/UnrealMCP/ - Plugin source code
      • UnrealMCP.uplugin - Plugin definition
  • Python/ - Python server and tools

    • tools/ - Tool modules for actor, editor, and blueprint operations
    • scripts/ - Example scripts and demos
  • Docs/ - Comprehensive documentation

🚀 Quick Start Guide

Prerequisites

  • Unreal Engine 5.5+
  • Python 3.12+
  • MCP Client (e.g., Claude Desktop, Cursor, Windsurf)

Sample project

For getting started quickly, feel free to use the starter project in MCPGameProject. This is a UE 5.5 Blank Starter Project with the UnrealMCP.uplugin already configured.

  1. Prepare the project
    • Right-click your .uproject file
    • Generate Visual Studio project files
  2. Build the project (including the plugin)
    • Open solution (.sln)
    • Choose Development Editor as your target.
    • Build

Plugin

Otherwise, if you want to use the plugin in your existing project:

  1. Copy the plugin to your project

    • Copy MCPGameProject/Plugins/UnrealMCP to your project's Plugins folder
  2. Enable the plugin

    • Edit > Plugins
    • Find "UnrealMCP" in Editor category
    • Enable the plugin
    • Restart editor when prompted
  3. Build the plugin

    • Right-click your .uproject file
    • Generate Visual Studio project files
    • Open solution (`.sln)
    • Build with your target platform and output settings

Python Server Setup

See Python/README.md for detailed Python setup instructions, including:

  • Setting up your Python environment
  • Running the MCP server
  • Using direct or server-based connections

Configuring your MCP Client

Use the following JSON for your mcp configuration based on your MCP client.

{
  "mcpServers": {
    "unrealMCP": {
      "command": "uv",
      "args": [
        "--directory",
        "<path/to/the/folder/PYTHON>",
        "run",
        "unreal_mcp_server.py"
      ]
    }
  }
}

An example is found in mcp.json

MCP Configuration Locations

Depending on which MCP client you're using, the configuration file location will differ:

MCP Client Configuration File Location Notes
Claude Desktop ~/.config/claude-desktop/mcp.json On Windows: %USERPROFILE%\.config\claude-desktop\mcp.json
Cursor .cursor/mcp.json Located in your project root directory
Windsurf ~/.config/windsurf/mcp.json On Windows: %USERPROFILE%\.config\windsurf\mcp.json

Each client uses the same JSON format as shown in the example above. Simply place the configuration in the appropriate location for your MCP client.

License

MIT

Questions

For questions, you can reach me on X/Twitter: @chongdashu

相关推荐

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • Beria Joey
  • 你的职业规划师,不走弯路就问我。Sponsor:小红书“ ItsJoe就出行 ”

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • awslabs
  • AWS MCP服务器 - 将AWS最佳实践直接带入您的开发工作流程的专门MCP服务器

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • GLips
  • MCP服务器向像光标这样的AI编码代理提供FIGMA布局信息

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

    Reviews

    3 (1)
    Avatar
    user_rpIEvgcM
    2025-04-17

    Unreal-MCP by chongdashu is an impressive tool for developers who appreciate robust MCP applications. The GitHub link offers easy access to the source code, which is incredibly well-documented. What stands out is the seamless integration and the welcoming onboarding experience making it easy for new users to get started. Highly recommend checking out unreal-mcp if you’re in search of reliable MCP solutions!