Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions shell-ui/src/mcp/MCPRegistrar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useNavigate } from 'react-router';

declare const __webpack_public_path__: string;
import { ErrorBoundary } from 'react-error-boundary';
import { queryClient as shellQueryClient } from '../FederatedApp';
import { useAuth } from '../auth/AuthProvider';
import {
FederatedModuleInfo,
Expand Down Expand Up @@ -60,6 +61,7 @@ export const _InternalMCPRegistrar = ({
get getToken() { return getTokenRef.current; },
get userData() { return userDataRef.current; },
selfConfiguration,
queryClient: shellQueryClient,
};
// Prefer the new createTools factory (supports navigate + dynamic context);
// fall back to the legacy static tools array for modules not yet migrated.
Expand Down
9 changes: 9 additions & 0 deletions shell-ui/src/mcp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* app-specific context derived from selfConfiguration.
*/

import type { QueryClient } from 'react-query';
import type { UserData } from '../auth/AuthProvider';
export type { UserData };

Expand All @@ -22,6 +23,14 @@ export type ToolContext = {
* Micro-frontends cast this to their own known config shape to extract endpoints etc.
*/
selfConfiguration: Record<string, unknown>;
/**
* The shell-ui–owned QueryClient, shared across every federated app via
* <QueryClientProvider contextSharing> (see FederatedApp.tsx). Tools use
* this to keep the chat-side UI panels in sync with their mutations —
* `invalidateQueries`, `setQueryData` for optimistic updates, or
* `refetchQueries` — picking the strategy that fits the operation.
*/
queryClient: QueryClient;
};

/**
Expand Down
Loading