In this paper, we study the capacity flexibility problem of a maintenance service provider, who is running a repair shop and is responsible for the availability of numerous specialized systems which contain a critical component that is prone to failure. Upon a critical component failure, the component is sent to the repair shop and the service provider is responsible for the repair as well as the down-time costs resulting from the system unavailability. In order to decrease the down-time costs, the repair shop keeps an inventory for the critical components, such that a failed critical component can be replaced with a spare one immediately, if it is available. The component inventory stock level and the repair shop capacity level decisions have to be taken jointly by the service provider. The shop floor manager resorts to two different capacity modes in order to make use of capacity flexibility. First one is the single-level capacity mode, in which the capacity level is fixed and is the only capacity related decision. The best results in this mode serve as a reference to the two-level capacity mode, in which there are low (permanent) and high (permanent plus contingent) capacity levels. In this mode, the permanent capacity is always available in the shop, whereas the deployment of the contingent capacity is decided at the start of each period based on the number of components waiting to be repaired in the shop. The relevant capacity decisions of this mode are the permanent and contingent capacity levels, the period length and the states (in terms of number of failed components waiting) where the contingent capacity is deployed. We develop quantitative models based on queuing theory that integrate the inventory level decision with the capacity related decisions for the repair shop, in each of the two capacity modes, in order to minimize the total cost rate of the service provider. Our numerical results suggest that two-level capacity mode can bring substantial savings compared to the best fixed capacity mode and these savings are mostly resulting from lower repair shop capacity usage. Moreover, we find that the system, in most cases, chooses the shortest period length possible, indicating the overarching importance of a fast response to the system state. The system switches to the high capacity mode if the spare part stock is just one or two, then it uses a quite high contingent capacity level, in order to avoid out of stock. If contingent capacity costs are high, system chooses a high level of permanent capacity to prevent frequent capacity switches.