feat(MK8S-196): expose shared QueryClient to MCP tools via ToolContext#4925
Draft
JBWatenbergScality wants to merge 1 commit into
Draft
feat(MK8S-196): expose shared QueryClient to MCP tools via ToolContext#4925JBWatenbergScality wants to merge 1 commit into
JBWatenbergScality wants to merge 1 commit into
Conversation
Federated apps' MCP tools need to refresh chat-side panels after a mutation but the existing wrapper had no handle on react-query state. Inject shell-ui's shared QueryClient (the one wrapped in QueryClientProvider with contextSharing) into every tool's ToolContext so each tool can call invalidateQueries / setQueryData / refetchQueries against the same client the panels read from. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Hello jbwatenbergscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queryClient: QueryClienttoToolContextso federated apps' MCP tools can keep chat-side panels in sync after mutations.MCPRegistrarfrom the shell-ui-ownedqueryClientexported byFederatedApp.tsx.Follow-up to merged PR #4820 (branch was kept alive). Pairs with:
Why
The previous wrapper-side approach (zenko-ui's
withQueryCacheInvalidation) calledinvalidateQueries()with no arguments after every non-readonly tool, blowing the entire cache — including auth queries — and leaving the UI empty. Injecting the QueryClient lets each tool target only the keys it actually affects.Test plan
🤖 Generated with Claude Code