Class HttpMcpTransport

java.lang.Object
net.mcreator.io.mcp.transport.HttpMcpTransport
All Implemented Interfaces:
McpTransport

public class HttpMcpTransport extends Object implements McpTransport
  • Constructor Details

    • HttpMcpTransport

      public HttpMcpTransport(int port)
  • Method Details

    • start

      public void start(McpTransport.McpHandler handler) throws IOException
      Description copied from interface: McpTransport
      Starts the transport.
      Specified by:
      start in interface McpTransport
      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: McpTransport
      Stops the transport and releases any resources.
      Specified by:
      stop in interface McpTransport
    • sendMessage

      public void sendMessage(String sessionId, String message)
      Description copied from interface: McpTransport
      Sends a message to a specific session.
      Specified by:
      sendMessage in interface McpTransport
      Parameters:
      sessionId - The ID of the session to send the message to.
      message - The raw JSON-RPC message string.