Cover image
Try Now
2025-04-10

一个虚幻的引擎插件,该插件实现了MCP服务器,允许MCP客户端访问UE编辑器Python API。

3 years

Works with Finder

1

Github Watches

0

Github Forks

3

Github Stars

Unreal Engine MCP Python Bridge Plugin

This is a plugin for Unreal Engine (UE) that creates a server implementation of Model Context Protocol (MCP). This allows MCP clients, like Anthropic's Claude, to access the full UE Python API.

Use Cases

  • Developing tools and workflows in Python with an agent like Claude.
  • Intelligent and dynamic automation of such workflows.
  • General collaborative development with an agent.

Prerequisites

  • Visual Studio 2019 or higher (if building from code).
  • An AI Agent. Below, we assume Claude will be used. But any AI Agent that implements MCP should suffice.
  • Unreal Engine 5 with the Python Editor Script Plugin enabled.
  • Note the Unreal Engine Python API.

Installing from Fab

The easiest way to install the MCP Python Bridge plugin is from the Fab store listing. Once you purchase the plugin, it will appear in your Library in the Epic Games Launcher. Click "Install to Engine" and choose the appropriate version of Unreal Engine.

Installing from GitHub

  1. Create a new Unreal Engine C++ project.
  2. Under the project root directory, find the Plugins folder.
  3. Clone this repo into the Plugins folder so that there is a new containing folder with all the project contents underneath.
  4. Right-click your UE project file (ends with .uproject) and select "Generate Visual Studio project files". If you don't immediately see that option, first select "Show more options" and it should appear.
  5. Open your new Visual Studio project and build.
  6. Copy unreal_mcp_client.py from the 'MCPClient' folder to a location of your choice.
  7. Find your claude_desktop_config.json configuration file. Mac location: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows location: [path_to_your_user_account]\AppData\Claude\claude_desktop_config.json
  8. Add the unreal-engine server section to your config file and update the path location excluding the square brackets, below. Mac path format: /[path_from_step_4]/unreal_mcp_client.py Windows path format: C:\\[path_from_step_4]\\unreal_mcp_client.py
{
  "mcpServers": {
    "unreal-engine": {
      "command": "python",
      "args": [
        "[mac_or_windows_format_path_to_unreal_mcp_client.py]"
      ]
    } 
  }
}
  1. Start Unreal Engine and load your new project.
  2. Enable the new UnrealMCPBridge plugin, and restart.
  3. There should be a new toolbar button that says, "Start MCP Bridge" when you hover with your mouse.
  4. Click the MCP Bridge button. A pop-up will state, "MCP Python bridge running." The Output Log will note a new socket server listening on 127.0.0.1:9000.
  5. Launch Claude as an administrator.
  6. Click the "Attach from MCP" plug-icon. Under "Choose an integration" are two test Prompts: create_castle and create_town. You can edit their implementations in unreal_server_init.py under the Content folder of the plugin. Be sure to restart Unreal Engine after any changes.
  7. Alternatively, ask Claude to build in your project using the UE Python API.
  8. A list of currently implemented tools can be found by clicking the hammer-icon to the left of the plug-icon.

Developing New Tools and Prompts

Examine at unreal_mcp_client.py and you'll see how MCP defines tools and prompts using Python decorators above functions. As an example:

@mcp.tool()
def get_project_dir() -> str:
    """Get the top level project directory"""
    result = send_command("get_project_dir")
    if result.get("status") == "success":
        response = result.get("result")
        return response
    else:
        return json.dumps(result)

This sends the get_project_dir command to Unreal Engine for execution and returns the project level directory for the current project. Under the Content folder of the plugin, you will see the server-side implementation of this tool command:

@staticmethod
def get_project_dir():
    """Get the top level project directory"""
    try:
        project_dir = unreal.Paths.project_dir()
        return json.dumps({
            "status": "success",
            "result" : f"{project_dir}"
        })
    except Exception as e:
        return json.dumps({ "status": "error", "message": str(e) })

Follow this pattern to create new tools the appear in the Claude desktop interface under the hammer-icon.

Implementing new prompts is a matter of adding them to unreal_mcp_client.py. As an example, here is the create_castle prompt from unreal_mcp_client.py:

@mcp.prompt()
def create_castle() -> str:
    """Create a castle"""
    return f"""
Please create a castle in the current Unreal Engine project.
0. Refer to the Unreal Engine Python API when creating new python code: https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/?application_version=5.5
1. Clear all the StaticMeshActors in the scene.
2. Get the project directory and the content directory.
3. Find basic shapes to use for building structures.
4. Create a castle using these basic shapes.
"""

Be sure to maintain triple-quotes so the entire prompt is returned. A good way to iterate over creating prompts is simply iterating each step number with Claude until you get satisfactory results. Then combine them all into a numbered step-by-step prompt as shown.

You must restart Claude for any changes to unreal_mcp_client.py to take effect. Note for Windows, you might need to end the Claude process in the Task Manager to truly restart Claude.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • 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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • 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.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

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

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

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

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

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

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

  • modelcontextprotocol
  • 模型上下文协议服务器

    Reviews

    4 (1)
    Avatar
    user_qZNnUe77
    2025-04-17

    UnrealMCPBridge by appleweed is an exceptional tool for anyone working with Unreal Engine and MCP applications. It's incredibly user-friendly and integrates seamlessly, significantly enhancing workflow efficiency. Highly recommended for developers looking to streamline their process. Check it out at https://github.com/appleweed/UnrealMCPBridge!