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 infoT- 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 Summary
FieldsModifier and TypeFieldDescriptionprotected intThe port on which the MCP server will listen for requests.protected TThe MCP transport provider that will be used to handle requests. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.thought2code.mcp.annotated.server.AbstractMcpServer
warmup
-
Field Details
-
transportProvider
The MCP transport provider that will be used to handle requests. -
port
protected int portThe 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.
-