Skip to main content
Glama

godot_detect_executable

Locate and configure the Godot 4.5+ executable for the MCP server to enable game development and execution workflows.

Instructions

Resolve the Godot 4.5+ executable that this MCP server will use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
godot_executableNoOptional explicit path to the Godot executable or .app bundle.

Implementation Reference

  • Implementation of the handler for `godot_detect_executable`. It calls `resolve_godot_executable` to locate and validate the engine version.
    def detect_executable(self, godot_executable: str | None = None) -> dict[str, Any]:
        executable, version = resolve_godot_executable(godot_executable)
        return {
            "executable": str(executable),
            "version": version,
            "minimum_supported_version": ".".join(str(value) for value in MINIMUM_GODOT_VERSION),
        }
  • Registration of the `godot_detect_executable` tool within the MCP server definition.
    ToolDefinition(
        name="godot_detect_executable",
        description="Resolve the Godot 4.5+ executable that this MCP server will use.",
        input_schema={
            "type": "object",
            "properties": {
                "godot_executable": {
                    "type": "string",
                    "description": "Optional explicit path to the Godot executable or .app bundle.",
                }
            },
            "additionalProperties": False,
        },
        handler=lambda args: self.controller.detect_executable(
            godot_executable=args.get("godot_executable")
        ),
    ),
  • Helper function that performs the discovery and validation logic for the Godot executable.
    def resolve_godot_executable(explicit: str | None = None) -> tuple[Path, str]:
        candidates: list[str | Path] = []
        if explicit:
            candidates.append(explicit)
        env_value = os.getenv(GODOT_EXECUTABLE_ENV)
        if env_value:
            candidates.append(env_value)
    
        for command_name in ("godot", "godot4", "godot-mono", "godot4-mono"):
            found = shutil.which(command_name)
            if found:
                candidates.append(found)
    
        if platform.system() == "Darwin":
            candidates.extend(_candidate_macos_executables())
    
        checked: list[str] = []
        for candidate in candidates:
            try:
                normalized = _normalize_executable_path(candidate)
                version = get_godot_version(normalized)
                return normalized.resolve(), version
            except (FileNotFoundError, GodotError, PermissionError):
                checked.append(str(candidate))
    
        extra = ""
        if checked:
            extra = f" Checked: {', '.join(checked)}."
        raise GodotError(
            "Could not find a usable Godot 4.5+ executable. "
            f"Pass `godot_executable` to the tool call or set {GODOT_EXECUTABLE_ENV}.{extra}"
        )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MhrnMhrn/godot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server