Sponsored by Deepsite.site

Model Context Protocol for Unreal Engine

Created By
chongdashu9 months ago
Enable AI assistant clients like Cursor, Windsurf and Claude Desktop to control Unreal Engine through natural language using the Model Context Protocol (MCP).
Content

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:

CategoryCapabilities
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 ClientConfiguration File LocationNotes
Claude Desktop~/.config/claude-desktop/mcp.jsonOn Windows: %USERPROFILE%\.config\claude-desktop\mcp.json
Cursor.cursor/mcp.jsonLocated in your project root directory
Windsurf~/.config/windsurf/mcp.jsonOn 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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"