
Unreal Engine MCP Python Bridge
STDIOUnreal Engine Python API bridge for AI agents via MCP protocol
Unreal Engine Python API bridge for AI agents via MCP protocol
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.
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.
Plugins
folder.Plugins
folder so that there is a new containing folder with all the project contents underneath..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.unreal_mcp_client.py
from the 'MCPClient' folder to a location of your choice.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
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]" ] } } }
UnrealMCPBridge
plugin, and restart.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.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.