Phosphate-solubilizing bacteria (PSB) play a vital role in sustainable agriculture by enhancing plant growth and improving crop yield. In intensive cucumber (
Cucumis sativus
L.) cultivation systems, soil degradation commonly occurs, making the optimization of phosphorus availability a key strategy for increasing production. However, studies examining the growth-promoting effects of PSB in cucumber remain limited. In this study, we isolated a novel PSB strain, Y31, from cucumber rhizosphere soil and identified it as
Bacillus subtilis
. Strain Y31 demonstrated the ability to solubilize calcium phytate and calcium phosphate, secrete multiple enzymes, produce siderophores, and exhibit antagonistic activity against pathogenic fungi. Inoculation with Y31 significantly promoted cucumber growth, increasing greenhouse yield by 35.30%. Notably, Y31 application increased soil available phosphorus and altered the abundance of soil fungal community. It reduced the relative abundance of
Botryotrichum
and
Chrysosporium
, while promoting the relative abundance of the
Penicillium
genus. Genome sequencing of
B. subtilis
Y31 revealed the presence of genes involved in phosphorus cycling, carbohydrate-active enzymes, and the biosynthesis of 10 secondary metabolites. Together, these findings indicated that
B. subtilis
Y31 enhanced cucumber growth and yield by improving phosphorus availability, modulating microbial community structure, and carrying gene clusters linked to phosphorus solubilization and plant growth promotion. Therefore, this study provided a basis for the efficient utilization of phosphorus resources and supported the development of sustainable agricultural practices.