Class HttpBasedConfigurableMcpServer<T extends jakarta.servlet.http.HttpServlet>

java.lang.Object
com.github.thought2code.mcp.annotated.server.configurable.AbstractConfigurableMcpServer
com.github.thought2code.mcp.annotated.server.configurable.HttpBasedConfigurableMcpServer<T>
Type Parameters:
T - the type of MCP transport provider that will be used to handle requests
All Implemented Interfaces:
ConfigurableMcpServer
Direct Known Subclasses:
ConfigurableMcpSseServer, ConfigurableMcpStreamableServer

public abstract class HttpBasedConfigurableMcpServer<T extends jakarta.servlet.http.HttpServlet> extends AbstractConfigurableMcpServer
Base class for configurable MCP servers that use HTTP as the transport protocol.
  • Field Details

    • transportProvider

      protected T extends jakarta.servlet.http.HttpServlet transportProvider
      The MCP transport provider that will be used to handle requests.
    • port

      protected int port
      The port on which the MCP server will listen for requests.
  • Constructor Details

    • HttpBasedConfigurableMcpServer

      protected HttpBasedConfigurableMcpServer(McpServerConfiguration configuration)
      Creates a new instance of HttpBasedConfigurableMcpServer with the specified configuration.
      Parameters:
      configuration - the configuration for the MCP server
  • Method Details

    • run

      public void run()
      Runs the MCP server.

      This method starts the MCP server using the Jetty HTTP server.