Class McpReadOnlyToolReconciler
java.lang.Object
com.xebialabs.xlrelease.mcp.config.McpReadOnlyToolReconciler
Keeps the MCP server's advertised
tools/list in sync with the "read-only mode" feature setting,
cluster-wide and without a restart.-
Constructor Summary
ConstructorsConstructorDescriptionMcpReadOnlyToolReconciler(io.modelcontextprotocol.server.McpSyncServer server, List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> allSpecs, ExecutorService reconcileExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidonMcpFeatureCreate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationCreatedEvent event) voidonMcpFeatureUpdate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationUpdatedEvent event) voidBring the advertised tool set in line with the current read-only flag: idempotent (only adds a missing tool or removes a present one), and only notifies clients when something actually changed.voidstart()
-
Constructor Details
-
McpReadOnlyToolReconciler
public McpReadOnlyToolReconciler(io.modelcontextprotocol.server.McpSyncServer server, List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> allSpecs, ExecutorService reconcileExecutor)
-
-
Method Details
-
start
@PostConstruct public void start() -
onMcpFeatureCreate
public void onMcpFeatureCreate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationCreatedEvent event) -
onMcpFeatureUpdate
public void onMcpFeatureUpdate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationUpdatedEvent event) -
reconcile
public void reconcile()Bring the advertised tool set in line with the current read-only flag: idempotent (only adds a missing tool or removes a present one), and only notifies clients when something actually changed. Fired on any configuration change — the diff is a no-op when the change was unrelated. Public (not just package-private) so other MCP-adjacent components can re-run the diff after they change the advertised tool set themselves — e.g.McpToolsetOsgiBridgeafter an OSGi bundle contributes a mutating tool.
-