Navigation
API > API/Plugins > API/Plugins/ModelContextProtocol
MCP (Anthropic's Model Context Protocol) tool server. Serves MCP tools over HTTP per the https://modelcontextprotocol.io/ spec.
| Name | FModelContextProtocolServer |
| Type | class |
| Header File | /Engine/Plugins/Experimental/ModelContextProtocol/Source/ModelContextProtocol/Public/ModelContextProtocolServer.h |
| Include Path | #include "ModelContextProtocolServer.h" |
Syntax
class FModelContextProtocolServer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| ModelContextProtocolServer.h | |||
| ModelContextProtocolServer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FModelContextProtocolServer() |
ModelContextProtocolServer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveServerPort | uint32 | ModelContextProtocolServer.h | ||
| AliveGuard | TSharedPtr< bool > | Prevent use-after-free: async tool completion lambdas capture a TWeakPtr to this; Reset() in destructor invalidates all weak references. | ModelContextProtocolServer.h | |
| bToolsListChangedBroadcastScheduled | bool | Set by ScheduleToolsListChangedBroadcast; drained on the next Tick. | ModelContextProtocolServer.h | |
| DeleteMcpRoute | FHttpRouteHandle | ModelContextProtocolServer.h | ||
| HttpRouter | TSharedPtr< IHttpRouter > | ModelContextProtocolServer.h | ||
| LastResourceDescriptorList | FModelContextProtocolResourceDescriptorList | ModelContextProtocolServer.h | ||
| MainMcpRoute | FHttpRouteHandle | ModelContextProtocolServer.h | ||
| Sessions | TArray< TSharedPtr< FModelContextProtocolSession > > | ModelContextProtocolServer.h | ||
| SseMcpRoute | FHttpRouteHandle | ModelContextProtocolServer.h | ||
| TickerHandle | FTSTicker::FDelegateHandle | ModelContextProtocolServer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint32 GetServerPort() |
Returns the port the server is currently listening on, or 0 if not running. | ModelContextProtocolServer.h | |
bool IsServerRunning() |
Returns true if the HTTP MCP server is currently running. | ModelContextProtocolServer.h | |
void ScheduleToolsListChangedBroadcast() |
Schedules a notifications/tools/list_changed broadcast to all initialized sessions with active SSE streams on the next Tick. | ModelContextProtocolServer.h | |
void StartServer
(
uint32 Port, |
Starts the HTTP MCP server on the specified port and URL path. | ModelContextProtocolServer.h | |
void StopServer() |
Stops the HTTP MCP server. | ModelContextProtocolServer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FModelContextProtocolServer & operator=
(
const FModelContextProtocolServer& |
ModelContextProtocolServer.h |
See Also
-
UModelContextProtocolSettings