java.lang.Object
com.mulesoft.connectors.mcp.internal.server.connection.McpSessionDecorator
com.mulesoft.connectors.mcp.internal.server.connection.MuleServerSession
All Implemented Interfaces:
io.modelcontextprotocol.spec.McpSession, Serializable

public class MuleServerSession extends McpSessionDecorator implements Serializable
See Also:
  • Constructor Details

    • MuleServerSession

      public MuleServerSession(io.modelcontextprotocol.spec.McpServerSession delegate, io.modelcontextprotocol.spec.McpServerTransport transport)
  • Method Details

    • handle

      public reactor.core.publisher.Mono<Void> handle(io.modelcontextprotocol.spec.McpSchema.JSONRPCMessage message)
    • restoreFrom

      public MuleServerSession restoreFrom(io.modelcontextprotocol.spec.McpServerSession newDelegate, io.modelcontextprotocol.spec.McpServerTransport transport)
      This method is part of the workaround for issues {@link https://github.com/modelcontextprotocol/java-sdk/issues/273} and {@link https://github.com/modelcontextprotocol/java-sdk/issues/274}.

      TODO: Future maintainers of this connector should be on the watch-out for resolution, contributing a fix or (in worst case scenario)

      Parameters:
      newDelegate - the brand-new session instance associated with the present request
      transport - the brand-new transport instance associated with the present request
      Returns:
      a new MuleServerSession with a session that is valid for the present requset
    • getId

      public String getId()
    • getTransport

      public io.modelcontextprotocol.spec.McpServerTransport getTransport()
    • onInitialize

      public void onInitialize(Runnable onInitialize)