Class MCPServerTools

java.lang.Object
org.machanism.machai.mcp.maven.tools.MCPServerTools
All Implemented Interfaces:
org.machanism.machai.ai.tools.FunctionTools

public class MCPServerTools extends Object implements org.machanism.machai.ai.tools.FunctionTools
Provides utility functions for managing the MCP server lifecycle. Implements FunctionTools to expose server control operations as callable functions.
  • Constructor Details

    • MCPServerTools

      public MCPServerTools()
  • Method Details

    • stopMcpServer

      public String stopMcpServer(int exitCode)
      Stops the MCP server by initiating a delayed shutdown.

      This method logs the shutdown event, waits for a predefined delay, and then exits the JVM with the specified exit code.

      Parameters:
      exitCode - the exit code to use when shutting down the server (default is 0)
      Returns:
      a message indicating that the shutdown has been initiated