Class McpReadOnlyToolReconciler

java.lang.Object
com.xebialabs.xlrelease.mcp.config.McpReadOnlyToolReconciler

public class McpReadOnlyToolReconciler extends Object
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

    Constructors
    Constructor
    Description
    McpReadOnlyToolReconciler(io.modelcontextprotocol.server.McpSyncServer server, List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> allSpecs, ExecutorService reconcileExecutor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onMcpFeatureCreate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationCreatedEvent event)
     
    void
    onMcpFeatureUpdate(com.xebialabs.xlrelease.domain.distributed.events.DistributedConfigurationUpdatedEvent event)
     
    void
    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.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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. McpToolsetOsgiBridge after an OSGi bundle contributes a mutating tool.