Class CompositionRunner

java.lang.Object
neqsim.mcp.runners.CompositionRunner

public final class CompositionRunner extends Object
Multi-server composition layer that enables NeqSim MCP to coordinate with external MCP servers for cross-domain engineering workflows.

Manages a registry of external MCP server endpoints and provides orchestration for multi-server workflows. Each external server can be a cost estimation service, plant historian connector, CAD/3D system, document extraction service, or any MCP-compliant tool provider.

Since NeqSim MCP runs over STDIO, external server calls are modeled as registered endpoints that agents can discover and invoke. The actual cross-server communication is handled by the host application (Claude, Copilot, etc.) which has access to all connected MCP servers. This runner provides the composition metadata and workflow templates.

Version:
1.0
Author:
Even Solbraa
  • Field Details

  • Constructor Details

    • CompositionRunner

      private CompositionRunner()
      Private constructor — all methods are static.
  • Method Details

    • run

      public static String run(String json)
      Main entry point for composition operations.
      Parameters:
      json - JSON with action and parameters
      Returns:
      JSON with results
    • listServers

      private static String listServers()
      Lists all known external MCP servers.
      Returns:
      JSON with server registry
    • registerServer

      private static String registerServer(com.google.gson.JsonObject input)
      Registers a new external MCP server.
      Parameters:
      input - JSON with server details
      Returns:
      JSON confirmation
    • removeServer

      private static String removeServer(com.google.gson.JsonObject input)
      Removes an external server from the registry.
      Parameters:
      input - JSON with server name
      Returns:
      JSON confirmation
    • listWorkflows

      private static String listWorkflows()
      Lists available multi-server workflow templates.
      Returns:
      JSON with workflow catalog
    • getWorkflow

      private static String getWorkflow(com.google.gson.JsonObject input)
      Gets detailed workflow template by ID.
      Parameters:
      input - JSON with workflow ID
      Returns:
      JSON with full workflow definition
    • planComposition

      private static String planComposition(com.google.gson.JsonObject input)
      Plans a multi-server composition based on a task description.
      Parameters:
      input - JSON with task description
      Returns:
      JSON with recommended servers and workflow plan
    • describeCapabilities

      private static String describeCapabilities()
      Describes NeqSim MCP's composition capabilities and interfaces.
      Returns:
      JSON with capability manifest for composition
    • initializeDefaultServers

      private static void initializeDefaultServers()
      Initializes the default external server registry.
    • initializeWorkflowTemplates

      private static void initializeWorkflowTemplates()
      Initializes pre-built workflow templates.
    • addRecommendation

      private static void addRecommendation(com.google.gson.JsonArray arr, String server, String reason, String priority)
      Adds a recommendation entry to an array.
      Parameters:
      arr - the array
      server - the server name
      reason - the reason
      priority - the priority level
    • addStep

      private static void addStep(com.google.gson.JsonArray arr, int order, String server, String tool, String description)
      Adds a workflow step to an array.
      Parameters:
      arr - the array
      order - the step order
      server - the server
      tool - the tool
      description - the description
    • errorJson

      private static String errorJson(String code, String message, String remediation)
      Creates a standard error JSON response.
      Parameters:
      code - the error code
      message - the error message
      remediation - the fix
      Returns:
      the JSON string