Skip to content

Conversation

@nader-ziada
Copy link
Collaborator

This PR covers adding Dynamic MCP Server Reload

the first part is to add cluster state monitoring with debounced reload,
Implement automatic detection of cluster state changes (API groups, OpenShift status) with configurable polling and debounce windows. The cluster state watcher runs in the background, invalidates the discovery cache periodically, and triggers a reload callback when changes are detected after a debounce period.

the second part is to add drop-in configuration directory support with lexical ordering and implement SIGHUP signal handler for live config reloads. Configuration files are merged in order from defaults to main config to drop-ins, with a new --config-dir flag available for specifying the drop-in director

Implement automatic detection of cluster state changes (API groups, OpenShift status) with configurable polling and debounce windows. The cluster state watcher runs in the
background, invalidates the discovery cache periodically, and triggers a reload callback when changes are detected after a debounce period.

- Add clusterStateWatcher to monitor API groups and OpenShift status
- Implement debounced reload to avoid excessive reloads during changes
- Add WatchClusterState method to Manager with configurable intervals
- Integrate cluster state watching in kubeconfig and single cluster providers

Signed-off-by: Nader Ziada <nziada@redhat.com>
- Add drop-in configuration directory support with lexical ordering
- Implement SIGHUP signal handler for live config reloads
- Merge config files in order: defaults → main → drop-ins
- Add --config-dir flag for specifying drop-in directory

Signed-off-by: Nader Ziada <nziada@redhat.com>
@nader-ziada nader-ziada force-pushed the dynamic-server-reload branch from 5194e0c to f54d30e Compare November 24, 2025 13:23
@manusa
Copy link
Member

manusa commented Nov 25, 2025

This is looking great.
However, I'd like to add a few changes to the first commit to further decouple things from the mcp domain.

would you mind creating a separate PR with only the first commit and we can work on the second part later?

@nader-ziada
Copy link
Collaborator Author

This PR covers adding Dynamic MCP Server Reload

the first part is to add cluster state monitoring with debounced reload, Implement automatic detection of cluster state changes (API groups, OpenShift status) with configurable polling and debounce windows. The cluster state watcher runs in the background, invalidates the discovery cache periodically, and triggers a reload callback when changes are detected after a debounce period.

thanks for taking a look @manusa

created a new PR with the first commit only and will close this one #502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants