Class McpServerSPILoader

java.lang.Object
org.mcpjava.server.spi.McpServerSPILoader

public final class McpServerSPILoader extends Object
Provides access to the McpServerSPI implementation.

Static constructor methods use getSPI() to obtain the McpServerSPI to create the object.

Users should use static constructor methods, for example TextContent.of(String), rather than this interface.

  • Method Details

    • getSPI

      public static McpServerSPI getSPI()
      Returns McpServerSPI, loading it if necessary.

      The implementation is loaded using Java's ServiceLoader mechanism and the classloader of McpServerSPI.

      Returns:
      the McpServerSPI instance
      Throws:
      IllegalStateException - if no SPI implementation is found