Home / Guides / Codex with Unreal

How to use OpenAI Codex with Unreal Engine

Short answer: in Unreal Engine 5.8, enable Epic's Unreal MCP and All Toolsets plugins, start the server, then add http://127.0.0.1:8000/mcp to Codex as a Streamable HTTP MCP server. You can do that in the ChatGPT desktop app's settings, with the Codex CLI, or with two lines in config.toml. Everything below comes from Epic's Unreal MCP docs and OpenAI's Codex docs, checked October 2026.

What you are connecting

Unreal MCP is an MCP server that runs inside Unreal Editor. MCP (Model Context Protocol) is a standard way to let an AI agent use tools in another app. With it, Codex can spawn actors, set up lighting, make material instances, work with Blueprints and run automation tests in your open project. Epic marks it Experimental in 5.8 and warns that many features are incomplete and may change.

OpenAI Codex is OpenAI's coding agent. It runs in the ChatGPT desktop app, a terminal CLI and an IDE extension, and all three share the same MCP settings. Set it up once and it works in each.

What you need

OpenAI Codex

OpenAI's coding agent for the desktop app, terminal, IDE and web. It can read your project, write code and use MCP servers.

Pricing: Freemium, from $8/mo (Go, desktop app only). Beginner rating: 3/5. Very capable, but you work in a terminal or IDE.

What we use to build our own game, a multiplayer archery FPS in Godot.

Unreal Engine

High end 3D engine with Blueprints visual scripting and C++.

Pricing: Free. Beginner rating: 2/5. Amazing visuals, but heavy and complex for a first game.

Free to download. Big and powerful, so expect a learning curve.

Step 1: turn on Unreal MCP

  1. In Unreal Editor open Edit, then Plugins. Enable Unreal MCP and All Toolsets, then restart the editor. Without All Toolsets the server has no tools to offer.
  2. Start the server. Open the console (backtick key) and type ModelContextProtocol.StartServer. Or turn on Auto Start Server under Edit, Editor Preferences, General, Model Context Protocol so it starts every time.
  3. The server listens on http://127.0.0.1:8000/mcp. If port 8000 is taken, use ModelContextProtocol.StartServer 8001 and change the port in the steps below.

Step 2: add the server to Codex

Pick one of these. You only need one, because the desktop app, CLI and IDE extension share the same config.

Option A: the ChatGPT desktop app

  1. Open Settings, then MCP servers, then Add server.
  2. Name it unreal-mcp, choose Streamable HTTP, and enter http://127.0.0.1:8000/mcp.
  3. Save, then select Restart. Type /mcp in the composer to see connected servers.

Option B: let Unreal write the config

In the Unreal console type ModelContextProtocol.GenerateClientConfig Codex. Epic says this writes the TOML config the Codex CLI uses. It is write once: the command will not overwrite an existing file, so if you change ports later, delete the old file by hand and run it again. Codex only reads a project's .codex/config.toml when you mark that project as trusted.

Option C: add it yourself

Open ~/.codex/config.toml (or .codex/config.toml in a trusted project) and add:

[mcp_servers.unreal-mcp]
url = "http://127.0.0.1:8000/mcp"

Step 3: check that it works

  1. Launch the editor first and make sure the server started. Then start Codex from your project folder.
  2. In the Codex CLI, run /mcp and look for unreal-mcp.
  3. Try Epic's test prompts: What actors do I have selected? or What are a few things you can do in Unreal?

Only seeing three tools named list_toolsets, describe_toolset and call_tool? That is Epic's Tool Search, on by default. Codex uses those three to find the real tools.

Things to try first

Tips that save time

Codex or Claude Code for Unreal?

Both connect to the same Unreal MCP server. Epic also publishes an official plugin with Unreal skills for Claude Code, so Claude Code gets a bit more Unreal specific help. Codex makes sense if you already pay for ChatGPT, or want to try the free desktop app first. See How to use Claude Code with Unreal Engine and Claude Code vs Codex vs Cursor for game dev.

Sources

Related

Comparing engines? Read Best game engines for beginners in 2026. Prefer Godot? See Build a Godot game with AI coding agents like Codex.

FAQ

Does Codex work with Unreal Engine officially?

Epic's Unreal MCP docs for Unreal Engine 5.8 list Codex as a supported client for the GenerateClientConfig command. Unreal MCP is marked Experimental. Epic's agent plugin with Unreal specific skills is built for Claude Code, and we did not find an Epic plugin for Codex (checked October 2026).

Can I do this on ChatGPT's free plan?

Maybe. OpenAI says ChatGPT Free and Go include limited Codex in the desktop app, subject to rollout, and the desktop app can add MCP servers. The Codex CLI and IDE extension need Plus ($20/mo) or higher. Check OpenAI's Codex pricing page before you rely on it.

Where does Unreal write the Codex config?

Epic's docs say the command writes the TOML config the Codex CLI uses, but they do not name the exact path. Codex reads ~/.codex/config.toml and, in trusted projects only, a project .codex/config.toml. If Codex does not see the server, add it yourself with the two lines shown in this guide.

Why does Codex only show three Unreal tools?

That is normal. Unreal MCP has Tool Search turned on by default, so it lists three helper tools (list_toolsets, describe_toolset and call_tool) instead of every tool. Codex uses those to find and call the real tools.

Can Codex edit Blueprints?

Not as text files, since Blueprint assets are stored in binary .uasset files. Through Unreal MCP it can use Epic's Blueprint toolset inside the running editor. Epic lists Blueprints among its toolsets on GitHub.

Get one new free AI game dev tool every week

One short email each week: a free or freemium tool a beginner can use, what it is good for, and where it fits in your game. No spam, unsubscribe any time.

Past issues