feat(mcp): add import button to import MCP servers from apps

- Add import_mcp_from_apps command that reuses existing import logic
- Add Import button in MCP panel header (consistent with Skills)
- Fix import count to only return truly new servers (not already in DB)
- Update translations for import success/no-import messages (zh/en/ja)
This commit is contained in:
Jason
2026-01-03 10:04:46 +08:00
parent 6460c1d5dd
commit 86e802bd4b
10 changed files with 93 additions and 13 deletions
+13
View File
@@ -59,3 +59,16 @@ export function useDeleteMcpServer() {
},
});
}
/**
* 从所有应用导入 MCP 服务器
*/
export function useImportMcpFromApps() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: () => mcpApi.importFromApps(),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["mcp", "all"] });
},
});
}