As the industrialization process accelerates, metal structural components are increasingly being utilized in production. However, with time, these metal components are prone to developing cracks, which if left undetected can lead to serious consequences. Therefore it is very important to detect the cracks existing in the parts timely and accurately. However, detecting cracks in metal poses a challenge due to the small size of the crack targets and the presence of significant background interference in the images. Existing detection algorithms often fail to achieve satisfactory results in this regard. To address this issue, this paper proposes an improved RT-DETR object detection algorithm to enhance the effect of metal crack detection. The model introduces an additional prediction feature layer to fully exploit the positional information contained in low-level feature maps, which is then complementarily fused into high-level feature maps. Furthermore, the CA(Coordinate Attention) mechanism is integrated into the backbone network and the auxiliary loss function of the model is adjusted. Experimental results demonstrate that the improved RT-DETR algorithm, the mAP (mean average precision) reaches 72.2%, compared with the original algorithm to improve of 6.8%, and the detection speed is 74.6 FPS (Frames Per Second), which realizes a better detection effect in the metal crack detection.