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) voidBrings the advertised tool set in line with the read-only flag.voidstart()voidStarts tracking tools contributed at runtime (e.g.voidStops tracking withdrawn tools (bundle stopped or updated) so a later toggle won't re-add them.
-
Constructor Details
-
McpReadOnlyToolReconciler
public McpReadOnlyToolReconciler(io.modelcontextprotocol.server.McpSyncServer server, List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> allSpecs, ExecutorService reconcileExecutor)
-
-
Method Details
-
track
public void track(List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> specs) Starts tracking tools contributed at runtime (e.g. by an OSGi bundle) and re-applies the read-only filter to them. Without this, only tools present at startup are known, so a read-only toggle finds nothing to hide/show for bundle tools and never firestools/list_changed. -
untrack
Stops tracking withdrawn tools (bundle stopped or updated) so a later toggle won't re-add them. -
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()Brings the advertised tool set in line with the read-only flag. Idempotent and only notifies clients on a real change; mutating tools are hidden in read-only mode. Operates over the tracked tool set, so runtime tools count only once they have been registered viatrack(java.util.List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification>).
-