Class HttpMcpTransport
java.lang.Object
net.mcreator.io.mcp.transport.HttpMcpTransport
- All Implemented Interfaces:
McpTransport
-
Nested Class Summary
Nested classes/interfaces inherited from interface McpTransport
McpTransport.McpHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(String sessionId, String message) Sends a message to a specific session.voidstart(McpTransport.McpHandler handler) Starts the transport.voidstop()Stops the transport and releases any resources.
-
Constructor Details
-
HttpMcpTransport
public HttpMcpTransport(int port)
-
-
Method Details
-
start
Description copied from interface:McpTransportStarts the transport.- Specified by:
startin interfaceMcpTransport- Parameters:
handler- The handler to call when a new message is received.- Throws:
IOException- If the transport fails to start.
-
stop
public void stop()Description copied from interface:McpTransportStops the transport and releases any resources.- Specified by:
stopin interfaceMcpTransport
-
sendMessage
Description copied from interface:McpTransportSends a message to a specific session.- Specified by:
sendMessagein interfaceMcpTransport- Parameters:
sessionId- The ID of the session to send the message to.message- The raw JSON-RPC message string.
-