In InGame Mcp Server, you can register tools, resources and notifications in two ways, One by One or Bulk Registration
One By One Registration
These fonctions allows you to register one tool, one resource and one notification per function call
Register Tool: Each tool is defined by a name, a description, an optional callback, and an array of typed parameters. Parameters are automatically converted to JSON Schema and returned to MCP clients during tools/list.
ToolName : Unique name identifying the tool. Used by MCP clients to call it.
Description : Human-readable description sent to the LLM. Helps the model decide when to use the tool.
Callback : Function executed when the tool is called. Leave unbound to register the tool without logic.
Parameters : Array of FMCPToolParameter describing expected inputs (name, type, description, required).
ExecuteInGameThread : If true, the callback runs on the game thread. Recommended when accessing Unreal actors.
Annotations : Optional semantic hints for MCP 2025-03-26 clients (read-only, destructive, idempotent, open-world).
Use this method when tools are defined at design time and their logic is known in advance.
Register Resource: A resource is identified by a URI template and returns content when accessed. It is typically used to expose dynamic game data, such as player state, world information, or configuration values.
ResourceTemplate: Struct containing the URI template, name, MIME type, and description of the resource.
Callback : Function executed when the resource is accessed. Receives the full URI, extracted URI parameters as JSON, and the session ID. Returns the resource content as a string.
Extracted variables are passed to the callback as a JSON object: {"id": "player_01"}.
Use this method when resources are defined and their logic is known in advance.
Register Notification: A notification is a one-way message: the client sends it without expecting a response. This is typically used by clients to signal state changes or events to the server, such as acknowledging an action or sending telemetry.
NotificationInfo: Struct containing the notification method name (e.g. "game/playerReady").
Callback : Function executed when the notification is received. Receives the method name, parameters as a JSON string, and the session ID of the sender.
Use this method when you want the game to react to an incoming notification from a connected MCP client.
Bulk Registration
These fonctions allows you to register one more tools, one or more resources and one or more notification per function call, or even all of this in only one function call.
RegisterToolsFromJsonFile: Registers one or more tools from a JSON file on disk. The JSON file can be either a root array of tool definitions, or a root object containing a "tools" key. Tools registered this way are immediately visible to MCP clients via tools/list, even if no callback has been bound yet.
FilePath : Absolute or project-relative path to the JSON file.
ExecuteInGameThread : Applies to all tools registered from this file.
This method is recommended when tools are defined by a designer, a data table, or an external configuration file, and the implementation is bound separately in Blueprint.
RegisterResourcesFromJsonFile: Registers one or more resources from a JSON file on disk. The JSON file can be a root array of resource definitions, or a root object containing a "resources" key. Resources are registered and immediately available in resources/templates/list, even without a bound callback.
FilePath : Absolute or project-relative path to the JSON file.
This method is recommended when resources are defined externally or by non-programmer team members, with the implementation bound separately in Blueprint.
RegisterNotificationsFromJsonFile: Registers one or more notification handlers from a JSON file on disk. The JSON file can be a root array of notification definitions, or a root object containing a "notifications" key. Notifications are registered immediately, even without a bound callback.
FilePath : Absolute or project-relative path to the JSON file.
This method is recommended when resources are defined externally or by non-programmer team members, with the implementation bound separately in Blueprint.
RegisterAllFromJsonFile: Registers tools, resources, and notifications from a single JSON file on disk. This function is the most convenient way to scaffold a complete MCP server definition from external data. The JSON root must be an object, and it can contain any combination of the following keys, "tools", "resources", "notifications". Each section is optional. If present, its entries are registered immediately and become visible to connected MCP clients.
FilePath : Absolute or project-relative path to the JSON file.
ToolsExecuteInGameThread : If true, all tools loaded from the file will execute their callbacks on the game thread once bound. This only applies to tools.
Use this function when you want to define the full MCP surface of your server in a single external file.