Recommiting glbs for LFS
Deploy Promiscuity Auth API / deploy (push) Successful in 1m59s
Deploy Promiscuity Character API / deploy (push) Successful in 1m16s
Deploy Promiscuity Inventory API / deploy (push) Has been cancelled
Deploy Promiscuity Locations API / deploy (push) Has been cancelled
Deploy Promiscuity Mail API / deploy (push) Has been cancelled
Deploy Promiscuity World API / deploy (push) Has been cancelled
Deploy Promiscuity Crafting API / deploy (push) Has been cancelled
k8s smoke test / test (push) Has been cancelled
Deploy Promiscuity Auth API / deploy (push) Successful in 1m59s
Deploy Promiscuity Character API / deploy (push) Successful in 1m16s
Deploy Promiscuity Inventory API / deploy (push) Has been cancelled
Deploy Promiscuity Locations API / deploy (push) Has been cancelled
Deploy Promiscuity Mail API / deploy (push) Has been cancelled
Deploy Promiscuity World API / deploy (push) Has been cancelled
Deploy Promiscuity Crafting API / deploy (push) Has been cancelled
k8s smoke test / test (push) Has been cancelled
This commit is contained in:
Vendored
BIN
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
uid://mcipi7y664aq
|
||||
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="Godot MCP"
|
||||
description="A plugin to enable communication between Godot Editor and Model Context Protocol (MCP) clients."
|
||||
author="Your Name"
|
||||
version="0.1.0"
|
||||
script="plugin.gd"
|
||||
@@ -0,0 +1,140 @@
|
||||
# Structure for addons/godot_mcp/plugin.gd
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
const SERVER_PORT = 6400
|
||||
var server: TCPServer = null
|
||||
var active_connections = []
|
||||
var command_handler
|
||||
|
||||
func _enter_tree():
|
||||
# Initialize the plugin
|
||||
print("Godot MCP Plugin activated")
|
||||
|
||||
# Create command handler
|
||||
command_handler = preload("res://addons/godot_mcp/command_handler.gd").new()
|
||||
command_handler.set_editor_plugin(self)
|
||||
|
||||
# Start the TCP server
|
||||
server = TCPServer.new()
|
||||
var error = server.listen(SERVER_PORT)
|
||||
if error != OK:
|
||||
push_error("Failed to start Godot MCP Server on port %d: %s" % [SERVER_PORT, error])
|
||||
return
|
||||
|
||||
print("Godot MCP Server listening on port %d" % SERVER_PORT)
|
||||
|
||||
# Add UI
|
||||
add_control_to_bottom_panel(
|
||||
preload("res://addons/godot_mcp/ui/mcp_panel.tscn").instantiate(),
|
||||
"MCP"
|
||||
)
|
||||
|
||||
func _exit_tree():
|
||||
# Clean up the plugin when disabled
|
||||
if server:
|
||||
server.stop()
|
||||
server = null
|
||||
|
||||
for connection in active_connections:
|
||||
if connection.get_status() == StreamPeerTCP.STATUS_CONNECTED:
|
||||
connection.disconnect_from_host()
|
||||
|
||||
active_connections.clear()
|
||||
|
||||
# Remove UI
|
||||
remove_control_from_bottom_panel(get_editor_interface().get_base_control().get_node("MCPPanel"))
|
||||
print("Godot MCP Plugin deactivated")
|
||||
|
||||
func _process(delta):
|
||||
# Check for new connections
|
||||
if server and server.is_connection_available():
|
||||
var connection = server.take_connection()
|
||||
if connection:
|
||||
active_connections.append(connection)
|
||||
print("New MCP connection established")
|
||||
|
||||
# Process existing connections
|
||||
var i = 0
|
||||
while i < active_connections.size():
|
||||
var connection = active_connections[i]
|
||||
|
||||
# Check connection status
|
||||
if connection.get_status() != StreamPeerTCP.STATUS_CONNECTED:
|
||||
active_connections.remove_at(i)
|
||||
print("MCP connection closed")
|
||||
continue
|
||||
|
||||
# Check for incoming messages
|
||||
if connection.get_available_bytes() > 0:
|
||||
var data = _read_message(connection)
|
||||
if data.size() > 0:
|
||||
# Process the command
|
||||
var response = _process_command(data)
|
||||
|
||||
# Send the response
|
||||
_send_message(connection, response)
|
||||
|
||||
i += 1
|
||||
|
||||
func _read_message(connection):
|
||||
# Read data from the connection
|
||||
var data = PackedByteArray()
|
||||
var bytes_available = connection.get_available_bytes()
|
||||
|
||||
if bytes_available > 0:
|
||||
data = connection.get_data(bytes_available)[1]
|
||||
|
||||
# Attempt to parse as JSON
|
||||
var json_string = data.get_string_from_utf8()
|
||||
var json = JSON.new()
|
||||
var error = json.parse(json_string)
|
||||
|
||||
if error == OK:
|
||||
return json.get_data()
|
||||
else:
|
||||
print("Failed to parse JSON: ", json.get_error_message())
|
||||
|
||||
return {}
|
||||
|
||||
func _send_message(connection, data):
|
||||
# Convert to JSON and send
|
||||
var json_string = JSON.stringify(data)
|
||||
connection.put_data(json_string.to_utf8_buffer())
|
||||
|
||||
|
||||
|
||||
func _process_command(data):
|
||||
# Process the command and return a response
|
||||
if data == null or typeof(data) != TYPE_DICTIONARY:
|
||||
return {
|
||||
"status": "error",
|
||||
"error": "Invalid command format. Expected a dictionary."
|
||||
}
|
||||
|
||||
if not data.has("type") or not data.has("params"):
|
||||
return {
|
||||
"status": "error",
|
||||
"error": "Invalid command format. Expected 'type' and 'params' fields."
|
||||
}
|
||||
|
||||
var command_type = data["type"]
|
||||
var params = data["params"]
|
||||
|
||||
if command_type == "ping":
|
||||
return {"status": "success", "result": {"message": "pong"}}
|
||||
|
||||
# Forward to command handler
|
||||
var result = command_handler.handle_command(command_type, params)
|
||||
|
||||
# Check if result is valid
|
||||
if result == null:
|
||||
return {
|
||||
"status": "error",
|
||||
"error": "Command handler returned null result"
|
||||
}
|
||||
|
||||
if result.has("error"):
|
||||
return {"status": "error", "error": result.error}
|
||||
else:
|
||||
return {"status": "success", "result": result}
|
||||
@@ -0,0 +1 @@
|
||||
uid://ddfhkiyge45tn
|
||||
@@ -0,0 +1,77 @@
|
||||
# addons/godot_mcp/ui/mcp_panel.gd
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
var status_label: Label
|
||||
var port_field: SpinBox
|
||||
var start_button: Button
|
||||
var stop_button: Button
|
||||
var log_display: TextEdit
|
||||
|
||||
func _ready():
|
||||
# Set up references to UI elements
|
||||
status_label = $VBoxContainer/StatusPanel/StatusLabel
|
||||
port_field = $VBoxContainer/ConfigPanel/PortField
|
||||
start_button = $VBoxContainer/ButtonPanel/StartButton
|
||||
stop_button = $VBoxContainer/ButtonPanel/StopButton
|
||||
log_display = $VBoxContainer/LogPanel/LogDisplay
|
||||
|
||||
# Initialize UI
|
||||
port_field.value = 6400 # Default port
|
||||
start_button.disabled = false
|
||||
stop_button.disabled = true
|
||||
|
||||
# Connect signals
|
||||
start_button.pressed.connect(_on_start_button_pressed)
|
||||
stop_button.pressed.connect(_on_stop_button_pressed)
|
||||
|
||||
# Set initial status
|
||||
update_status("Not running")
|
||||
add_log_message("Godot MCP Plugin initialized")
|
||||
|
||||
func update_status(status_text: String, is_error: bool = false):
|
||||
status_label.text = "Status: " + status_text
|
||||
if is_error:
|
||||
status_label.add_theme_color_override("font_color", Color(1, 0.3, 0.3))
|
||||
else:
|
||||
status_label.remove_theme_color_override("font_color")
|
||||
|
||||
func add_log_message(message: String):
|
||||
var timestamp = Time.get_datetime_string_from_system()
|
||||
log_display.text += "[" + timestamp + "] " + message + "\n"
|
||||
log_display.scroll_vertical = log_display.get_line_count()
|
||||
|
||||
func _on_start_button_pressed():
|
||||
# This function will be called from the plugin.gd script
|
||||
# when the server is actually started
|
||||
update_status("Running on port " + str(port_field.value))
|
||||
start_button.disabled = true
|
||||
stop_button.disabled = false
|
||||
add_log_message("MCP Server started on port " + str(port_field.value))
|
||||
|
||||
func _on_stop_button_pressed():
|
||||
# This function will be called from the plugin.gd script
|
||||
# when the server is actually stopped
|
||||
update_status("Stopped")
|
||||
start_button.disabled = false
|
||||
stop_button.disabled = true
|
||||
add_log_message("MCP Server stopped")
|
||||
|
||||
# Function to be called from plugin.gd when a client connects
|
||||
func on_client_connected():
|
||||
add_log_message("Client connected")
|
||||
update_status("Client connected")
|
||||
|
||||
# Function to be called from plugin.gd when a client disconnects
|
||||
func on_client_disconnected():
|
||||
add_log_message("Client disconnected")
|
||||
update_status("Running (no clients)")
|
||||
|
||||
# Function to be called from plugin.gd when a command is received
|
||||
func on_command_received(command_type, params):
|
||||
add_log_message("Command received: " + command_type)
|
||||
|
||||
# Function to be called from plugin.gd when a response is sent
|
||||
func on_response_sent(command_type, success):
|
||||
var status = "Success" if success else "Failed"
|
||||
add_log_message("Response sent for " + command_type + ": " + status)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bqabyd7ce60u0
|
||||
@@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dxvt86ck6b2a4"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/godot_mcp/ui/mcp_panel.gd" id="1_4g23r"]
|
||||
|
||||
[node name="MCPPanel" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_4g23r")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="StatusPanel" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="VBoxContainer/StatusPanel"]
|
||||
layout_mode = 2
|
||||
text = "Status: Not running"
|
||||
|
||||
[node name="ConfigPanel" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ConfigPanel"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PortLabel" type="Label" parent="VBoxContainer/ConfigPanel/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Port:"
|
||||
|
||||
[node name="PortField" type="SpinBox" parent="VBoxContainer/ConfigPanel"]
|
||||
layout_mode = 2
|
||||
min_value = 1024.0
|
||||
max_value = 65535.0
|
||||
value = 6400.0
|
||||
alignment = 1
|
||||
|
||||
[node name="ButtonPanel" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ButtonPanel"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="StartButton" type="Button" parent="VBoxContainer/ButtonPanel"]
|
||||
layout_mode = 2
|
||||
text = "Start Server"
|
||||
|
||||
[node name="StopButton" type="Button" parent="VBoxContainer/ButtonPanel"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Stop Server"
|
||||
|
||||
[node name="LogPanel" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="LogDisplay" type="TextEdit" parent="VBoxContainer/LogPanel"]
|
||||
layout_mode = 2
|
||||
editable = false
|
||||
wrap_mode = 1
|
||||
@@ -1 +1 @@
|
||||
uid://deh0tfs84csxo
|
||||
uid://deh0tfs84csxo
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://2juaclm8gc1n
|
||||
uid://2juaclm8gc1n
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cu72rjuvdnnx
|
||||
uid://cu72rjuvdnnx
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://wckg68rm05vd
|
||||
uid://wckg68rm05vd
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://dmpm4vrmag0ru
|
||||
uid://dmpm4vrmag0ru
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://b1ddeyowx86m3
|
||||
uid://b1ddeyowx86m3
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://usxgr64t746m
|
||||
uid://usxgr64t746m
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bk4wcnwns36qk
|
||||
uid://bk4wcnwns36qk
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cdfq5jjtnlcwg
|
||||
uid://cdfq5jjtnlcwg
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://60a3gi7u2kf
|
||||
uid://60a3gi7u2kf
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cp54123dwlv7j
|
||||
uid://cp54123dwlv7j
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://dii7jpdyaypc6
|
||||
uid://dii7jpdyaypc6
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://ct0c3akkhiaf
|
||||
uid://ct0c3akkhiaf
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://h3cmhcmf6wwy
|
||||
uid://h3cmhcmf6wwy
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bi3o8elbtqoni
|
||||
uid://bi3o8elbtqoni
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cvdyxro7g1dic
|
||||
uid://cvdyxro7g1dic
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bdx4su8bw3dmw
|
||||
uid://bdx4su8bw3dmw
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://ch7elftpoqayg
|
||||
uid://ch7elftpoqayg
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://c56hanl0enhx2
|
||||
uid://c56hanl0enhx2
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bdgbdmw2hh77q
|
||||
uid://bdgbdmw2hh77q
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://c4damqkvtgm4i
|
||||
uid://c4damqkvtgm4i
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cdooqj4aiumdm
|
||||
uid://cdooqj4aiumdm
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://cuplxuwag3dnn
|
||||
uid://cuplxuwag3dnn
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bpnki8vkbrrer
|
||||
uid://bpnki8vkbrrer
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://brbm3okyt3jwq
|
||||
uid://brbm3okyt3jwq
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://c4hxrek5kx6bn
|
||||
uid://c4hxrek5kx6bn
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://brellka4w2k2s
|
||||
uid://brellka4w2k2s
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bcnq5eix75v5b
|
||||
uid://bcnq5eix75v5b
|
||||
|
||||
Reference in New Issue
Block a user