This work investigates Industry 4.0 technologies by developing a new key performance indicator that can determine the energy consumption of machine tools for a more sustainable supply chain. To achieve this, we integrated the machine tool indicator into a cyber–physical system for easy and real-time capturing of data. We also developed software that can turn these data into relevant information (using Python): Using this software, we were able to view machine tool activities and energy consumption in real time, which allowed us to determine the activities with greater energy burdens. As such, we were able to improve the application of Industry 4.0 in machine tools by allowing informed real-time decisions that can reduce energy consumption. In this research, a new Key Performance Indicator (KPI) was been developed and calculated in real time. This KPI can be monitored, can measure the sustainability of machining processes in a green supply chain (GSC) using Nakajima’s six big losses from the perspective of energy consumption, and is able to detect what the biggest energy loss is. This research was implemented in a cyber–physical system typical of Industry 4.0 to demonstrate its applicability in real processes. Other productivity KPIs were implemented in order to compare efficiency and sustainability, highlighting the importance of paying attention to both terms at the same time, given that the improvement of one does not imply the improvement of the other, as our results show.