Short answer - no, the mRNA vaccines specifically don't only work for a short period of time. Natural infection and all vaccines of different types against SARS-CoV-2 all produce similar durations of immunity.
Generally speaking we can expect the immunity from a vaccine to last approximately long as the immunity following a natural infection, though there are some exceptions to this, where vaccination (not via mRNA) results in shorter protection than natural infection for pertussis1 . In the case of infection with SARS-CoV-2, the natural immunity induced by the infection results in protective levels of antibodies for about 6 months to a year and similar time-frames for vaccines of any sort against SARS-CoV-2.
I found a relatively recent paper in PNAS2 (highly respected journal), that states (emphasis mine):
Peak antibody levels elicited by messenger RNA (mRNA) vaccines mRNA-1273 and BNT1262b2 exceeded that of natural infection and are expected to typically yield more durable protection against breakthrough infections (median 29.6 mo; 5 to 95% quantiles 10.9 mo to 7.9 y) than natural infection (median 21.5 mo; 5 to 95% quantiles 3.5 mo to 7.1 y). Relative to mRNA-1273 and BNT1262b2, viral vector vaccines ChAdOx1 and Ad26.COV2.S exhibit similar peak anti-S IgG antibody responses to that from natural infection and are projected to yield lower, shorter-term protection against breakthrough infection (median 22.4 mo and 5 to 95% quantiles 4.3 mo to 7.2 y; and median 20.5 mo and 5 to 95% quantiles 2.6 mo to 7.0 y; respectively).
From this you can see that the durations of protection are similar in length between the various vaccine types and similar to natural infection.
The Conversation has a nice layman's explanation of how this all works and why infection and vaccinations don't typically produce different durations of immunity,
1:Leung T, Campbell PT, Hughes BD, Frascoli F, McCaw JM. Infection-acquired versus vaccine-acquired immunity in an SIRWS model. Infect Dis Model. 2018 Jun 15;3:118-135. doi: 10.1016/j.idm.2018.06.002. PMID: 30839933; PMCID: PMC6326260.
2:Townsend JP, Hassler HB, Sah P, Galvani AP, Dornburg A. The durability of natural infection and vaccine-induced immunity against future infection by SARS-CoV-2. Proc Natl Acad Sci U S A. 2022 Aug 2;119(31):e2204336119. doi: 10.1073/pnas.2204336119. Epub 2022 Jul 15. PMID: 35858382; PMCID: PMC9351502.