diff --git a/addons/gdai-mcp-plugin-godot/.gitignore b/addons/gdai-mcp-plugin-godot/.gitignore new file mode 100644 index 00000000..759f3ee1 --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/.gitignore @@ -0,0 +1,3 @@ +bin/ +gdai_mcp_plugin.gdextension* +*.py \ No newline at end of file diff --git a/addons/gdai-mcp-plugin-godot/CHANGELOG.md b/addons/gdai-mcp-plugin-godot/CHANGELOG.md new file mode 100644 index 00000000..ee5a39e2 --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/CHANGELOG.md @@ -0,0 +1,76 @@ +# Changelog + +> Get access to beta/dev versions exclusively on the [Discord server](/docs/update-guide). + +## 0.2.9 + +- Resolve windows defender issues + +## 0.2.8 + +- Auto check for updates on start +- Improved `update_property` tool for string literals +- Fixed errors/crash when save scene is called concurrently +- Updated `get_godot_errors` to limit max lines returned for errors/session errors/etc +- `simulate_input` tool now presses the actual key rather than just the action +- Added disabling tools in config file +- New implementation for `get_running_scene_screenshot` + +## 0.2.7 + +- Fix for Antigravity IDE on Windows ([Antigravity Windows Fix](/docs/installation#antigravity-windows-fix)) +- Fixed `get_godot_errors` to work when Editor has different language +- Added windows arm64 support +- Added configuration file to update plugin configuration +- Now AI can simulate inputs in your game! +- Added tools `get_input_map` and `simulate_input` +- Don't load plugin when exporting project from Godot cli + +## 0.2.6 + +- New implementation for `get_running_scene_screenshot` which supports more MCP clients + +## 0.2.5 + +- Added support for Linux arm64 +- Added `webp` image format for getting editor/running scene screenshots +- Fixed `get_running_scene_screenshot` freezing editor on some Windows devices + +## 0.2.4 + +- Updated to latest MCP specification version 2025-06-18 +- Added support for Godot 4.5 +- Added `duplicate_node` tool to duplicate a node in a scene +- Added `move_node` tool to move a node to a different parent + +## 0.2.3 + +- Added `uid_to_project_path` tool to convert uid:// to res:// +- Added `project_path_to_uid` tool to convert res:// to uid:// + +## 0.2.2 + +- Added `get_running_scene_screenshot` tool that lets AI visually see your running game +- Added `set_anchor_values` tool to set individual anchor side values +- Added `set_anchor_preset` tool to set anchors using presets +- Added `stop_running_scene` tool that stops the running scene + +## 0.2.1 + +- Fixed issue caused by newer dependency versions by pinning all dependencies to exact versions. +- Added `get_editor_screenshot` that lets AI visually see the entire Godot editor + +## 0.2.0 + +- Improved GDAI MCP error logging +- Added `clear_output_logs` tool to clear output logs in the editor. +- Fixed `edit_file` tool in some cases would not be able to edit end of file correctly. +- Both `edit_file` and `view_script` tools also open the script in the editor. +- Updated `play_scene` tool description to inform the user to test the game and confirm its as expected before continuing. +- Added `view_script` tool for viewing GDScript files and useful to check for errors in script. +- Added `gdai-mcp-default-prompt` a custom MCP prompt for with Godot Best practices and GDAI MCP best practices. + + +## 0.1.0 + +- Initial early access version diff --git a/addons/gdai-mcp-plugin-godot/LICENSE.md b/addons/gdai-mcp-plugin-godot/LICENSE.md new file mode 100644 index 00000000..68930755 --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/LICENSE.md @@ -0,0 +1,123 @@ +# License Agreement + +Copyright © Delano Lourenco, 2025 + +This license governs the use of the compiled binary form of the "GDAI MCP Plugin Godot" Godot plugin (the "Plugin"). +By downloading, installing, or using the Plugin, you agree to be bound by the terms of this License Agreement. + +--- + +## 1. Grant of License + +You are granted a non-exclusive, non-transferable, royalty-free license to use the Plugin solely for the development and distribution of games or applications that use the Godot Engine. This license includes the right to use the Plugin for commercial purposes. + +--- + +## 2. Restrictions + +- **No Redistribution** + You may not sell, sublicense, distribute, or otherwise make the Plugin available, in whole or in part, to any third party. + +- **No Modification or Derivatives** + You may not modify, reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code, structure, or organization of the Plugin. + +- **No Source Code Access** + The Plugin is distributed in binary form only. Source code is not provided and may not be requested, extracted, or reconstructed. + +- **No Hosting** + You may not upload the Plugin to any public repository, package registry, or file sharing service. + +--- + +## 3. Ownership + +All rights, title, and interest in and to the Plugin, including all intellectual property rights, are and shall remain the exclusive property of the Licensor. + +--- + +## 4. Disclaimer of Warranty + +The Plugin is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. + +--- + +## 5. Limitation of Liability + +In no event shall the Licensor be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from the use of or inability to use the Plugin. + +--- + +## 6. Termination + +This license is effective until terminated. It will terminate automatically without notice from the Licensor if you fail to comply with any provision of this license. Upon termination, you must destroy all copies of the Plugin in your possession or control. + +--- + +## 7. Governing Law + +This license shall be governed by and construed in accordance with the laws of India, without regard to its conflict of law provisions. + +--- + +## 8. Data Collection +The Licensor may collect anonymous usage data through PostHog to improve the Plugin and associated services. This data collection is designed to be non-intrusive and does not include personally identifiable information. + +- Website Analytics: Anonymous metrics such as page views, button clicks, session duration, user navigation patterns, etc may be collected to understand user engagement and optimize the website experience. +- Plugin Analytics: Anonymous metrics such as active user counts, tool call success and failure rates, feature usage frequency, error rate, etc may be collected to monitor performance, and guide future development. + +**For licensing inquiries, please contact:** 3ddelano (at symbol) gmail (period) com + + +--- + + +## godot-cpp LICENSE + +MIT License + +Copyright (c) 2017-present Godot Engine contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--- + + +## Godot Engine LICENSE + +Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). +Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/addons/gdai-mcp-plugin-godot/README.md b/addons/gdai-mcp-plugin-godot/README.md new file mode 100644 index 00000000..4850e5d6 --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/README.md @@ -0,0 +1,124 @@ +> gdai-mcp-plugin-godot + +# 🤖 GDAI MCP – MCP Server for Godot Game Engine + +**GDAI MCP Godot Plugin** allows AI to control the Godot Editor to create scenes, nodes, scripts. It can debug script errors, debugger and output logs. + +> 🔗 [Get the Plugin](https://gdaimcp.com/)   + +--- + +## 🚀 Feature Highlights + +Take your Godot workflow to the next level by automating your game development. + +- 🧱 **Create Scenes Programmatically** + Generates scenes, nodes, resources, scripts and more + +- 🛠️ **Add & Manipulate Nodes** + Modifies the scene tree adding/removing/updating nodes and their properties + +- 🐞 **Debugger Integration** + View debugger output, logs and scripts errors. + +- 📁 **File & Asset Search** + Searches for files and resources directly from the filesystem (`res://`) + +- 📐 **Property Updates** + Set and get node properties dynamically. + +- 🧩 **Project Understanding** + Has a deep understanding of your project, scenes and scripts. + +- 📝 **GDScript context** + Helps you write and debug GDScript + +--- + +## 🛠️ How It Works + +Use the GDAI MCP Plugin to control Godot from any MCP Client like Cursor, Windsurf, Claude, VSCode etc. + +1. **Install in Godot Project** + Add the GDAI MCP Plugin to your Godot project. + [Installation Guide](https://gdaimcp.com/docs/installation) + +2. **Add command in MCP Client** + Add the MCP server command to your MCP Client's config. + [MCP Client Config](https://gdaimcp.com/docs/installation#2-install-in-mcp-client) + +3. **Start Chatting** + Start chatting and see the MCP action! + +--- + +## 💻 Example + +**User:** Please fix my gdscript errors. +**Assistant:** I'd be happy to help fix your GDScript errors. Let me start by examining your current scene and looking for any errors in your script. + +Running tool: `get_open_script` +Running tool: `get_open_script_errors` +...conversation continues + +--- + +## 🤝 Compatible MCP Clients + +Use GDAI MCP with your favorite MCP client or IDE: + +- Cursor +- Claude Desktop +- VS Code (via GitHub Copilot, Cline, Roo Code, etc) +- WindSurf +- And more + +## 🤝 Compatible Godot version + +The plugin is compatible with `Godot 4.2+` + +--- + +## ❓ Frequently Asked Questions + +**What is GDAI MCP Godot Plugin?** +A plugin that allows any MCP Client to control Godot Engine Editor remotely, allowing it to create scenes, nodes, resources, scripts and more. + +**Can this make an entire game with one shot prompt?** +Yes and no. It depends on the quality of your prompt and the LLM used. Claude Desktop most of the times is able to one-shot simple games. + + +**Is Godot scripting experience required?** +No, but it's helpful. + +**Which clients are supported?** +Any MCP client either a program or even a script can connect to the MCP server. + +**Can I use this in commercial projects?** +Yes! You can use this plugin to make commercial games! + +**Can I use this in a public project?** +Yes! But make sure to not commit the plugin to the public repository of your game. + +**Is there documentation?** +Yes, detailed docs are available. + +--- + +## 🚀 Take Your Godot Workflow to the Next Level + +Unlock the full potential of AI through automated game development via the GDAI MCP Plugin. + +> [🔗 Get the plugin](https://gdaimcp.com/) + +--- + + +### 🗣️ Suggestions + +##### Have any question or feature requests? +Join the [Discord Server](https://discord.gg/FZY9TqW) or DM `@3ddelano` + +--- + +© 2025 Delano Lourenco. All rights reserved. \ No newline at end of file diff --git a/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd b/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd new file mode 100644 index 00000000..e704c49e --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd @@ -0,0 +1,63 @@ +# Copyright 2025-present Delano Lourenco +# License: See LICENSE.md +# Website: https://gdaimcp.com +@tool +extends EditorPlugin + + +func _enable_plugin() -> void: + if Engine.is_editor_hint(): + add_autoload_singleton("GDAIMCPRuntime", "res://addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd") + + +func _disable_plugin() -> void: + if Engine.is_editor_hint(): + remove_autoload_singleton("GDAIMCPRuntime") + + +func _enter_tree(): + var os = OS.get_name().to_lower() + var arch = Engine.get_architecture_name().to_lower() + + const ALLOWED_OS = ["macos", "windows", "linux"] + if os not in ALLOWED_OS: + _print_err("GDAI MCP plugin does not support this Operating System (%s)!" % os) + return + + const ALLOWED_ARCH = ["arm64", "x86_64"] + if arch not in ALLOWED_ARCH: + _print_err("GDAI MCP plugin does not support this CPU architecture (%s)!" % arch) + return + + var shared_lib_path = _get_shared_lib_path(os, arch) + if not FileAccess.file_exists(shared_lib_path) and not _is_debug(): + _print_err("Binary files for GDAI MCP plugin are missing, so the plugin wont be loaded. Please re-install the plugin from [url=https://gdaimcp.com]https://gdaimcp.com[/url] or disable the plugin in Project Settings.") + return + + +func _get_shared_lib_path(p_os, p_arch): + const BIN_PATH = "res://addons/gdai-mcp-plugin-godot/bin" + var shared_lib_path = "%s/%s/libgdai-mcp-plugin-godot.%s.template_release.%s.%s" % [BIN_PATH, p_os, p_os, _get_suffix(p_os, p_arch), _get_ext(p_os)] + return shared_lib_path.replace(".universal", "") + + +func _get_suffix(p_os, p_arch): + if p_os == "macos": + return "universal" + return p_arch + + +func _get_ext(p_os: String): + if p_os == "macos": + return "dylib" + if p_os == "linux": + return "so" + return "dll" + + +func _is_debug() -> bool: + return DirAccess.dir_exists_absolute(ProjectSettings.globalize_path("res://addons/gdai-mcp-testsuite")) + + +func _print_err(p_bbcode: String): + print_rich("[color=TOMATO][b]GDAIMCP::ERROR::[/b] " + p_bbcode + "[/color]") diff --git a/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd.uid b/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd.uid new file mode 100644 index 00000000..0737bbac --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/gdai_mcp_plugin.gd.uid @@ -0,0 +1 @@ +uid://lrvw7k62hw0m diff --git a/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd b/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd new file mode 100644 index 00000000..6299325d --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd @@ -0,0 +1,8 @@ +extends Node + + +func _enter_tree(): + const RUNTIME_SERVER = "GDAIRuntimeServer" + if ClassDB.class_exists(RUNTIME_SERVER) and ClassDB.can_instantiate(RUNTIME_SERVER): + var runtime_server = ClassDB.instantiate(RUNTIME_SERVER) + add_child(runtime_server) diff --git a/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd.uid b/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd.uid new file mode 100644 index 00000000..258c660e --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd.uid @@ -0,0 +1 @@ +uid://dcne7ryelpxmn diff --git a/addons/gdai-mcp-plugin-godot/plugin.cfg b/addons/gdai-mcp-plugin-godot/plugin.cfg new file mode 100644 index 00000000..60bf8edb --- /dev/null +++ b/addons/gdai-mcp-plugin-godot/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="GDAI MCP" +description="" +author="Delano Lourenco" +version="0.2.9" +script="gdai_mcp_plugin.gd" diff --git a/project.godot b/project.godot index 0d99a797..bfeabc1b 100644 --- a/project.godot +++ b/project.godot @@ -52,6 +52,7 @@ CyclopsAutoload="*res://addons/cyclops_level_builder/cyclops_global_scene.tscn" PoolingManager="*res://Scenes/Utils/pooling_manager.tscn" TBGAME="*res://3D/TrenchBroom/EntityScripts/tb_manager.gd" GlobalInputManager="*res://Scenes/Utils/GlobalInputManager.tscn" +GDAIMCPRuntime="*res://addons/gdai-mcp-plugin-godot/gdai_mcp_runtime.gd" [debug_draw_3d] @@ -192,7 +193,7 @@ movie_writer/movie_file="D:/Maddo/Recordings/Capture.avi" [editor_plugins] -enabled=PackedStringArray("res://addons/cyclops_level_builder/plugin.cfg", "res://addons/dialogic/plugin.cfg", "res://addons/func_godot/plugin.cfg", "res://addons/godot_test_scene/plugin.cfg", "res://addons/resources_spreadsheet_view/plugin.cfg", "res://addons/scene_palette/plugin.cfg", "res://addons/smoothing/plugin.cfg", "res://addons/tattomoosa.vision_cone_3d/plugin.cfg") +enabled=PackedStringArray("res://addons/cyclops_level_builder/plugin.cfg", "res://addons/dialogic/plugin.cfg", "res://addons/func_godot/plugin.cfg", "res://addons/gdai-mcp-plugin-godot/plugin.cfg", "res://addons/godot_test_scene/plugin.cfg", "res://addons/resources_spreadsheet_view/plugin.cfg", "res://addons/scene_palette/plugin.cfg", "res://addons/smoothing/plugin.cfg", "res://addons/tattomoosa.vision_cone_3d/plugin.cfg") [func_godot]