godot-mcp
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 1209744fad78
- Files read
- 10
Godot MCP lets an AI coding agent launch the Godot game engine, run projects, read debug output, and create or edit scene files. Because its tools accept arbitrary paths (including standalone scene files and Windows network shares) and allow attaching scripts via node properties, a prompt-injected agent can trigger arbitrary code execution.
What it can reach
- Files
- Scans directories to find and inspect Godot projects anywhere on disk, and creates or modifies scene, mesh library, and resource files in specified project folders.
- Shell commands
- Executes the Godot binary to launch the editor, run game projects, and run bundled GDScript operations, which run project scripts and native extensions with the user's permissions.
- System
- Reads environment variables such as GODOT_PATH, DEBUG, PATH, HOME, USER, and TEMP, and starts and stops local Godot child processes.
Findings
-
HighArbitrary script loading via unvalidated node properties in add_node
src/scripts/godot_operations.gd:521
Although the server validates nodeType and rootNodeType to stop an agent from instantiating arbitrary scripts by path, handleAddNode passes the properties object straight to godot_operations.gd without checking keys or values. Any string property starting with res:// is passed to load() and assigned via new_node.set(), allowing a prompt-injected agent to pass a script or resource path on the script property. If that resource contains a @tool script (for example from a third-party addon or untrusted asset in the project), its code runs immediately during add_node, and any non-tool script is saved into the scene to run later.
Fix: Block setting the script property (or any Script resource) in add_node unless explicitly intended, and validate resource paths and allowed resource types before calling load().
-
HighUnconfined scene path and CLI flag injection in run_project
Unlike the scene-editing tools, which join paths under projectPath, handleRunProject appends args.scene directly to the Godot command line after checking only that it does not contain '..'. A prompt-injected agent can point projectPath at a benign project while setting scene to an absolute path (such as a downloaded .tscn file in Downloads or /tmp) or a Windows UNC share, causing Godot to load and execute embedded GDScript from outside the project. Because leading dashes are not rejected, an agent can also pass Godot command-line flags such as --dump-extension-api or -e via scene.
Fix: Reject scene arguments starting with '-' or containing absolute/UNC paths, resolve the scene path inside projectPath, and verify that the resolved file stays within projectPath.
-
HighIncomplete path validation allows Windows UNC network shares and unrestricted host paths
validatePath only checks whether a path is empty or contains '..', and the server provides no setting to restrict tools to an approved workspace directory. On Windows, UNC paths such as \\attacker.com\share\game pass validatePath; if a prompt-injected agent passes a UNC path to run_project, launch_editor, get_project_info, or list_projects, Windows connects over SMB to the remote server (exposing Net-NTLMv2 password hashes) and Godot can execute an attacker-hosted project and native DLLs directly over the network with nothing previously on disk.
Fix: Reject UNC paths (starting with \\ or //) and support a configurable allowed workspace root verified with fs.realpathSync and path.relative on every path parameter.
-
LowGodot debug mode is hardcoded on and returns host environment variables to the agent
GODOT_DEBUG_MODE is hardcoded to true (and constructor config.godotDebugMode is ignored), so every headless Godot operation runs with --debug-godot even when DEBUG is not enabled. In debug mode, create_scene prints the user's PATH, HOME, USER, TEMP, and GODOT_PATH environment variables along with full filesystem paths to stdout, which is returned directly in the MCP tool output to the AI agent, and writes temporary test files into the project root.
Fix: Default GODOT_DEBUG_MODE to false unless explicitly enabled by configuration or environment variable, and avoid printing environment variables into tool stdout.
