Package org.machanism.machai.mcp.maven
Class HttpStreamableMcpServerMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.mcp.maven.AbstractMCPServerMojo
org.machanism.machai.mcp.maven.HttpStreamableMcpServerMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="streamable",
aggregator=true)
public class HttpStreamableMcpServerMojo
extends AbstractMCPServerMojo
Maven plugin Mojo for starting a streamable HTTP MCP server.
This Mojo initializes and starts an HttpStreamableMcpServer using
project information and configuration parameters. It is intended to be used
as an aggregator goal in multi-module Maven builds.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.machanism.machai.mcp.maven.AbstractMCPServerMojo
AbstractMCPServerMojo.ConfigurationLoadingException -
Field Summary
Fields inherited from class org.machanism.machai.mcp.maven.AbstractMCPServerMojo
basedir, logger, params, port, projectFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpStreamableMcpServercreateServer(String projectName, String projectVersion) Creates the server instance for this transport.voidexecute()Executes the Mojo, starting the streamable HTTP MCP server.Methods inherited from class org.machanism.machai.mcp.maven.AbstractMCPServerMojo
applyParameters, getConfigurator, loadConfiguratorMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
HttpStreamableMcpServerMojo
public HttpStreamableMcpServerMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionExecutes the Mojo, starting the streamable HTTP MCP server.Applies environment parameters, initializes the server with project name and version, sets the project directory and port, and starts the server. If the server fails to start, a
MojoExecutionExceptionis thrown.- Throws:
org.apache.maven.plugin.MojoExecutionException- if the server fails to start or configuration is invalid
-
createServer
Creates the server instance for this transport.- Parameters:
projectName- Maven project nameprojectVersion- Maven project version- Returns:
- a streamable MCP server
-