JustAMCPRuntime

Inherits: Object

Engine singleton that hosts the JustAMCP runtime server.

Description

JustAMCPRuntime runs the local MCP endpoint and routes incoming commands to built-in tools, resources, prompts, or custom command callables. It is independent of the active SceneTree, so it can keep serving editor automation while scenes are opened, closed, or changed.

JustAMCPRuntime.port = 7777
JustAMCPRuntime.enabled = true

JustAMCPRuntime.register_custom_command("double", func(value):
    return value * 2
)

var result = JustAMCPRuntime.execute_command("run_custom_command", {
    "name": "double",
    "args": [21],
})
print(result["result"])

Properties

bool

enabled

false

int

port

7777

Methods

Dictionary

execute_command(command: String, params: Dictionary)

void

poll()

void

register_custom_command(name: String, callable: Callable)

void

unregister_custom_command(name: String)


Signals

client_connected() 🔗

Emitted when a new MCP client connects to the runtime server.


client_disconnected() 🔗

Emitted when an MCP client disconnects or the runtime closes its connection.


command_received(command: String, params: Dictionary) 🔗

Emitted after the runtime parses an incoming MCP command. The signal exposes the command name and decoded parameter dictionary before dispatch.


Property Descriptions

bool enabled = false 🔗

  • void set_enabled(value: bool)

  • bool is_enabled()

When true, the runtime server is active and can accept MCP traffic. Setting it to false stops serving runtime requests.


int port = 7777 🔗

  • void set_port(value: int)

  • int get_port()

TCP port used by the JustAMCP runtime server. Change this before enabling the runtime when a project needs a non-default port.


Method Descriptions

Dictionary execute_command(command: String, params: Dictionary) 🔗

Executes a runtime command with params and returns the command result dictionary. Commands include built-in runtime operations, tool dispatch, resources, prompts, and run_custom_command.


void poll() 🔗

Processes pending network activity for the runtime server, including new connections, inbound MCP payloads, and queued asynchronous work.


void register_custom_command(name: String, callable: Callable) 🔗

Registers callable under name so MCP clients can invoke it with execute_command("run_custom_command", {"name": name, "args": [...]}). Registering the same name replaces the previous callable.


void unregister_custom_command(name: String) 🔗

Removes the custom command registered as name. Calls to run_custom_command with that name will return an error after removal.