Build a Godot game with AI coding agents (Codex + MCP)
This is the workflow the StarterLoot team recommends for beginners who want to build a real Godot game with an AI coding agent. Every command below comes from the official Codex docs or the MCP server's README. Tools change fast, so check those pages if something looks different.
What is Godot?
Godot
Free, open source 2D and 3D game engine with its own easy scripting language, GDScript.
Pricing: Free (unverified). Beginner rating: 5/5. Small download, no fees or royalties, and a huge beginner community.
Free, open source, and light enough to run on most laptops.
Godot games are made of scenes (a player, a level, a menu) built from nodes, and the logic is written in GDScript, a simple language that looks a lot like Python.
What does an MCP server do, in plain words?
An AI coding agent like OpenAI Codex can read and write files, but on its own it cannot see your game running. MCP (Model Context Protocol) is a standard way to give an AI agent extra tools. A Godot MCP server is a small helper program that gives the agent Godot tools, like "run the project" and "show me the errors". That closes the loop: the agent writes code, runs the game, reads what broke, and fixes it.
The tools
OpenAI Codex
OpenAI's coding agent for the terminal, IDE and web. It can read your project, write code and use MCP servers.
Pricing: Freemium, from $8/mo. Beginner rating: 3/5. Very capable, but you work in a terminal or IDE.
Godot MCP
Open source MCP server that lets AI agents launch the Godot editor, run projects, read debug output and edit scenes.
Pricing: Free (unverified). Beginner rating: 3/5. One command to add, but you need Node.js and an MCP capable AI tool.
Our default pick: one command to add, and it can run your project and read debug output.
Godot AI
Open source Godot plugin and MCP server that lets AI assistants build scenes, edit nodes and scripts in a live editor.
Pricing: Free (unverified). Beginner rating: 3/5. Dock based setup is friendly, but needs Godot 4.7+ and uv.
An alternative that runs as a plugin inside a live Godot 4.7+ editor.
Setup, step by step
1. Install Godot
Download it from godotengine.org and create an empty project in its own folder.
2. Install Codex
The Codex README lists this npm command (you need Node.js installed):
npm install -g @openai/codex The Codex docs also offer a standalone installer for macOS and Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh Then open your project folder in a terminal, run codex, and choose Sign in with ChatGPT the first time. Codex is included in ChatGPT plans, including Free, with usage limits.
3. Add the Godot MCP server
Godot MCP needs Godot installed and Node.js 18 or newer. Its README gives the server command as npx @coding-solo/godot-mcp, and the Codex docs show the general form codex mcp add <server-name> -- <stdio server-command>. Put together:
codex mcp add godot -- npx @coding-solo/godot-mcp If Godot is not found automatically, the README says to set GODOT_PATH to your Godot executable. Codex passes environment variables with --env:
codex mcp add godot --env GODOT_PATH=/path/to/godot -- npx @coding-solo/godot-mcp Check it worked with:
codex mcp list Prefer a config file? Codex stores MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project) as a [mcp_servers.name] table with a command and optional args:
[mcp_servers.godot]
command = "npx"
args = ["@coding-solo/godot-mcp"] Alternative: Godot AI
Godot AI needs Godot 4.7 or newer and uv. Per its README: download a release from GitHub, put the add-on in your-project/addons/godot_ai/, enable it in Project, Project Settings, Plugins, Godot AI, then press Configure next to Codex in the Godot AI dock. Its README notes it records usage telemetry, so read that section if it matters to you.
Your first project loop
- Start tiny. Ask Codex: "Create a 2D scene with a player square that moves with the arrow keys, and set it as the main scene."
- Let it run the game. Ask: "Run the project and check the debug output for errors."
- Fix what broke. Ask it to fix any errors it found, then run again.
- Play it yourself. Open the project in Godot and press Play. You are the judge of whether it feels right.
- Add one feature at a time. A coin to collect, then a score, then a goal. Repeat the loop.
Tips
- Use git and commit after every working step, so you can undo a bad change.
- Ask Codex to explain the code it wrote. You will learn GDScript much faster.
- Be specific about the Godot version you use, since Godot 3 and Godot 4 code differ.
- Make art and sound with other tools in our library, like PixelLab and MyEdit.
Limits to know
- The agent cannot judge fun. It can tell if the game runs, not if it is good.
- MCP servers are community projects. Features and setup can change between versions.
- AI can write code that runs but is messy. Ask it to clean up and keep scenes simple.
- Paid plans give more Codex usage. The free tier is fine for trying this out.
Related
Read Best game engines for beginners in 2026 or see every coding and game logic tool.
FAQ
Do I need to know how to code?
It helps to learn a little GDScript, but Codex writes most of the code. Asking it to explain each change is the best way to learn.
Is this free?
Godot, Godot MCP and Godot AI are free and open source. Codex is included in ChatGPT plans, including a Free plan with limits.
Which Godot MCP server should I use?
Godot MCP is the easiest to add with one command. Godot AI goes deeper inside a live editor but needs Godot 4.7 or newer.
Can I use a different AI agent?
Yes. Both MCP servers work with other MCP capable clients. Their READMEs list setup for several tools.