$ show Coding-Solo/godot-mcp
This is a Model Context Protocol (MCP) server that enables AI agents to interact with the Godot game engine. It provides tools to launch the Godot editor, run projects in debug mode, capture console output, manage scenes, add nodes, load sprites, export mesh libraries, and handle UID references for Godot 4.4+. The server is a single TypeScript process that communicates via stdio, spawning Godot processes for complex operations and using a bundled GDScript for scene manipulation. It includes path traversal protection, class name validation to prevent arbitrary script instantiation, and flexible parameter naming (supports both camelCase and snake_case). The project is well-structured, with clear error handling and debug logging, making it suitable for integration with AI coding assistants like Claude, Cline, and Cursor.
The LLM identified 3 files worth highlighting for reuse:
A standalone GDScript that executes various Godot operations (create scene, add node, load sprite, export mesh library, save scene, get UID, resave resources) via command-line arguments. It parses JSON parameters, validates class names against ClassDB to prevent arbitrary script instantiation, and provides detailed debug logging. The script is designed to be invoked from the command line with `--headless --script` and can be reused in any Godot project for scripted automation without modification.
The `validateClassName` method performs a strict regex check (`/^[A-Za-z_][A-Za-z0-9_]*$/`) on user-supplied class names to prevent arbitrary script instantiation. This is a reusable security pattern for any tool that accepts class names to instantiate objects, ensuring only built-in Godot classes or registered scripts can be used, and rejecting paths or file extensions.
The `normalizeParameters` and `convertCamelToSnakeCase` methods provide a flexible parameter naming convention that allows the API to accept both camelCase and snake_case keys, normalizing them to camelCase internally. This pattern is reusable in any service that wants to support multiple input formats from different clients, reducing friction and improving compatibility.