Class HttpBasedMcpServer<S extends McpServerInfo,T extends jakarta.servlet.http.HttpServlet>

java.lang.Object
com.github.thought2code.mcp.annotated.server.AbstractMcpServer<S>
com.github.thought2code.mcp.annotated.server.HttpBasedMcpServer<S,T>
Type Parameters:
S - the type of MCP server info
T - the type of MCP transport provider that will handle requests
All Implemented Interfaces:
McpServer<S>
Direct Known Subclasses:
McpSseServer, McpStreamableServer

public abstract class HttpBasedMcpServer<S extends McpServerInfo,T extends jakarta.servlet.http.HttpServlet> extends AbstractMcpServer<S>
Base class for HTTP-based MCP servers.
  • 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

    • HttpBasedMcpServer

      public HttpBasedMcpServer()
  • Method Details

    • run

      public void run()
      Runs the MCP server.

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