Class CompositionRunner
java.lang.Object
neqsim.mcp.runners.CompositionRunner
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classRepresents an external MCP server.(package private) static classA single step in a workflow.(package private) static classA workflow template. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.gson.Gsonprivate static final ConcurrentHashMap<String, CompositionRunner.ExternalServer> Registry of known external MCP servers and their capabilities.private static final Map<String, CompositionRunner.WorkflowTemplate> Pre-built workflow templates for common multi-server patterns. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor — all methods are static. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddRecommendation(com.google.gson.JsonArray arr, String server, String reason, String priority) Adds a recommendation entry to an array.private static voidAdds a workflow step to an array.private static StringDescribes NeqSim MCP's composition capabilities and interfaces.private static StringCreates a standard error JSON response.private static StringgetWorkflow(com.google.gson.JsonObject input) Gets detailed workflow template by ID.private static voidInitializes the default external server registry.private static voidInitializes pre-built workflow templates.private static StringLists all known external MCP servers.private static StringLists available multi-server workflow templates.private static StringplanComposition(com.google.gson.JsonObject input) Plans a multi-server composition based on a task description.private static StringregisterServer(com.google.gson.JsonObject input) Registers a new external MCP server.private static StringremoveServer(com.google.gson.JsonObject input) Removes an external server from the registry.static StringMain entry point for composition operations.
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON -
SERVERS
Registry of known external MCP servers and their capabilities. -
TEMPLATES
Pre-built workflow templates for common multi-server patterns.
-
-
Constructor Details
-
CompositionRunner
private CompositionRunner()Private constructor — all methods are static.
-
-
Method Details
-
run
-
listServers
Lists all known external MCP servers.- Returns:
- JSON with server registry
-
registerServer
Registers a new external MCP server.- Parameters:
input- JSON with server details- Returns:
- JSON confirmation
-
removeServer
Removes an external server from the registry.- Parameters:
input- JSON with server name- Returns:
- JSON confirmation
-
listWorkflows
Lists available multi-server workflow templates.- Returns:
- JSON with workflow catalog
-
getWorkflow
Gets detailed workflow template by ID.- Parameters:
input- JSON with workflow ID- Returns:
- JSON with full workflow definition
-
planComposition
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
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
-
addStep
-
errorJson
-