To get started, first ensure that the plugin is installed, by visiting the Plugin Window. Then, enable the plugin if it’s not already done.
All blueprints nodes explained in the following manual can be found in MCP Server category.
InGame MCP Server main class is NOT a Singleton. To CREATE a new instance use Create MCPServer anywhere in your blueprin. As it name means, this function will create the MCP Server instance and you will need to store it in a variable of the MCP server type. After that, you can retrieve this instance where you want using your variable.
Once you have this instance, you can configure it using the Configure Server function. This function needs :
Port as integer: this is the port on which the MCP Server will start listening. There is no port by default, you will need to define one. You just need to be sure that this port is not already used (or will not be) on the computer.
Server Name as String: this is the server send when a MCP connect to the server for the first time. This is the name of the server for the MCP Client. You can set it to what you want, it doesn't have a lot of importance.
Server Host as String: defines the network interface the MCP server binds to. Use localhost for local-only access, 0.0.0.0 for all network interfaces, or a specific IP address to restrict the server to one interface.
After that, you can start the server using the Begin Server function.
This is better if the server is properly stopped. You can use the Stop Server function (in the EndPlay event for instance) to do this job. If you forgot, don't worry, the server is stopped at the end of the game of when the blueprint containing it is destroyed.
At this step, you should be able to connect to your MCP Server with a MCP client but you can't interact with the game, because your server don't have any tools to do so.
You can add instructions and a handler for the authentification before or after the server is started with Set Instructions and Set Auth Handler functions.
Set Instructions: sets the MCP server instructions returned to clients during initialization. Useful to provide contextual informations about the server, gameplay conventions, etc... .If the server is already running, the instructions are applied immediately. Otherwise, they are stored and applied when the server starts.
Use this function to define the high-level behavior and context that should be visible to connected MCP clients.
Set Auth Handler: registers an authentication callback that is executed for every incoming connection attempt. The callback receives the Bearer token extracted from the Authorization header, as well as the MCP session ID when available. Return true to allow the connection, or false to reject it with HTTP 401.
This handler can be assigned before or after Begin Server. If the server is already running, the new authentication logic is applied immediately. Otherwise, the logic is stored and applied when the Begin Server is called.
Use this function to protect the MCP server with a Bearer token, restrict access to trusted clients, or implement custom connection rules.
For the Set Auth Handler, you will need to bind a function to it, such as on the picture.
Now you MCP Server have instructions to guide the MCP Client and a authentification logic, now we will see how to register some tools into your MCP server.