mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-09 20:18:50 +01:00
✨ feat: Add MCP Reinitialization to MCPPanel
- Refactored tool caching to include user-specific tools in various service files. - Refactored MCPManager class for clarity - Added a new endpoint for reinitializing MCP servers, allowing for dynamic updates of server configurations. - Enhanced the MCPPanel component to support server reinitialization with user feedback.
This commit is contained in:
parent
aec1777a90
commit
b6c8aabcac
14 changed files with 508 additions and 196 deletions
|
|
@ -132,6 +132,8 @@ export const resendVerificationEmail = () => '/api/user/verify/resend';
|
|||
|
||||
export const plugins = () => '/api/plugins';
|
||||
|
||||
export const mcpReinitialize = (serverName: string) => `/api/mcp/${serverName}/reinitialize`;
|
||||
|
||||
export const config = () => '/api/config';
|
||||
|
||||
export const prompts = () => '/api/prompts';
|
||||
|
|
|
|||
|
|
@ -141,6 +141,10 @@ export const updateUserPlugins = (payload: t.TUpdateUserPlugins) => {
|
|||
return request.post(endpoints.userPlugins(), payload);
|
||||
};
|
||||
|
||||
export const reinitializeMCPServer = (serverName: string) => {
|
||||
return request.post(endpoints.mcpReinitialize(serverName));
|
||||
};
|
||||
|
||||
/* Config */
|
||||
|
||||
export const getStartupConfig = (): Promise<
|
||||
|
|
|
|||
|
|
@ -316,6 +316,20 @@ export const useUpdateUserPluginsMutation = (
|
|||
});
|
||||
};
|
||||
|
||||
export const useReinitializeMCPServerMutation = (): UseMutationResult<
|
||||
{ success: boolean; message: string; serverName: string },
|
||||
unknown,
|
||||
string,
|
||||
unknown
|
||||
> => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation((serverName: string) => dataService.reinitializeMCPServer(serverName), {
|
||||
onSuccess: () => {
|
||||
queryClient.refetchQueries([QueryKeys.tools]);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetCustomConfigSpeechQuery = (
|
||||
config?: UseQueryOptions<t.TCustomConfigSpeechResponse>,
|
||||
): QueryObserverResult<t.TCustomConfigSpeechResponse> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue