Home
Login

MCP server for interacting with the Godot game engine. Provides tools for launching the editor, running projects, and capturing debug output.

MITJavaScript 0.5kCoding-Solo Last Updated: 2025-03-23

📚 Godot MCP Project Introduction

I. Project Overview

Godot MCP (Model Context Protocol Server), released by Coding-Solo, is a tool that bridges AI assistants with the Godot Engine. Through the MCP protocol, it can launch the Godot editor, run projects, capture debugging information, and deeply control project structure and scenes.

This mechanism provides a real feedback loop for AI assistants (such as Claude, Cline, Cursor), enabling them to actually manipulate projects, debug issues, and generate high-quality GDScript code.


II. Core Features and Characteristics

  1. Launch Editor and Run Project Supports the following via command line:

    • Launching the Godot editor for a specified path
    • Running the project in debug mode
    • Capturing and returning console output or error messages
  2. Project Structure Acquisition and Analysis

    • Obtaining project version, directory structure, and resource list
    • Deep diving into scene structure information, including node trees, properties, resource paths, etc.
  3. Scene and Node Management

    • Creating new scenes (specifying root node type)
    • Adding nodes to existing scenes and setting properties
    • Loading Sprite2D textures, exporting MeshLibrary for GridMap
    • Saving scenes and supporting the generation of scene variants
  4. Debugging and Version Management

    • Stopping a running project
    • Obtaining and displaying the Godot engine version
    • (For Godot 4.4+) Obtaining file UIDs and updating resource references
  5. Compatible with Multiple AI-Assisted Tools

    • Supports Cline and Cursor: Integrate AI assistant tools through MCP settings files and command-line integration

III. Architecture and Implementation Highlights

  • Single GDScript "Operation Script" All complex commands (such as creating nodes, exporting scenes, etc.) are managed by a single godot_operations.gd, avoiding the generation of individual temporary scripts, ensuring simplicity and efficiency, and reducing disk I/O and potential errors.

  • CLI and Script Combination Mechanism Simple commands are executed directly through the Godot CLI, while complex operations are handled through GDScript scripts. Both are transmitted via the MCP standard using JSON instructions, providing a unified structure that is easy to extend.

  • Standardized Response Structure All operations return a uniform format: status, result content, standard output/error, making it easier for AI to analyze, learn, and automatically generate modification suggestions.


IV. Usage Flow

  1. Installation and Build

    git clone https://github.com/Coding-Solo/godot-mcp.git
    cd godot-mcp
    npm install
    npm run build
    
  2. Configure AI Tools

    • Cline: Add the corresponding server configuration in cline_mcp_settings.json
    • Cursor: Add the node instruction through Settings → Features → MCP
  3. Run and Interact

    • AI command examples:

      • launch_editor: Launch the editor
      • run_project: Execute the project and get the output
      • create_scene / add_node: Create a scene/node
      • get_debug_output / stop_project: Debugging control commands
      • get_uid / update_project_uids: UID management

V. Project Highlights Summary

Advantage Description
🌟 High Automation AI assistants directly control the editor/project without manual intervention
🚫 No Temporary Files Uses a single GDScript entry point, lightweight and efficient
♻️ Supports Version & UID Compatible with Godot 4.4+ features, can manage resource UIDs
🛠️ Easy to Extend & Integrate MCP standard facilitates adding new features and is compatible with multiple AI tools

VI. Conclusion 🌈

Godot MCP is a powerful and practical tool that bridges AI assistants and the Godot Engine. AI can directly:

  • Launch the editor, run projects, and collect data;
  • Access project structure, scripts, scenes, and resources;
  • Dynamically modify scenes, nodes, and scripts;
  • Debug and generate GDScript code suggestions.

With a unified protocol and GDScript operation script, it provides a clear, standard, and extensible automation interface, making it a powerful tool for game developers to improve efficiency and intelligent development processes.