This paper presents a modified strain gradient theory (MSGT) based on third-order shear deformation theory and the Ritz method to explore the bending, buckling, and free vibration analyses in metal foam microbeams for the first time. The model captures the micro-structural and shear deformation effects without needing shear correction factors. The MSGT is employed, incorporating three material length scale parameters (MLSPs) to account for the size effect. The study investigates three different types of porosity, including uniform porosity distribution, symmetric porosity distribution, and asymmetric porosity distribution. The governing equation is derived from Lagrange's equation, while the Ritz method employing Chebyshev polynomials is implemented to solve the problems. Unlike the MSGT combined Navier method, which applies to beams with simply-supported boundary conditions, the present model and Ritz method can be applied to metal foam microbeams with arbitrary boundary conditions. The study comprehensively examines the influence of small size, shear deformation, slenderness, porosity ratio, and boundary conditions on the mechanical behavior of metal foam microbeams. The findings indicate that the size effect manifests notably in metal foam beams at the micro-scale (h/l <= 5), and the influence of shear deformation is paramount for stubby beams (L/h <= 15). Notably, this research presents new results for the MSGT model, serving as a benchmark for future studies. In addition, the present approach is a potential solution for analyzing the bending, vibration, and buckling behaviors of advanced material beams, plates, and shells. It is also helpful in designing micro-structured devices.