The OP's question has been discussed here. I agree with the claim in the (linked) paper that the philosophy of mathematics can contribute to mathematics to the degree that it affects the practice of mathematics. Mathematicians are pragmatists in the sense that they see the foundational questions classically considered in the philosophy of mathematics as unfruitful and are therefore abandon these questions. In fact, the roots of pragmatism stretch back to the investigation of C.S. Peirce of the clarity of ideas. (His investigation was perhaps spurred by the non-formal quality of clarity in mathematics.)
One can find, in the work of Hadamard and Poincare, a description of the mental processes of mathematicians, as well as a claim that mathematics is discovered by thinking really hard until one is stuck and then letting the subconscious take over. Even if this is true, it doesn't really settle anything and sounds borderline superstitious.
Along another line, Polya has presented heuristics of the way mathematicians solve problems. Particularly, in his work on induction and analogy in mathematics, points out the important role of mathematical analogy, where such analogies are characterized by carefully respecting the parts of the two things compared. Analogy between theories is viewed by some leading mathematicians as a driving force for the development of mathematics.
Still, there are many questions that are not addressed by the above lines. I'll give one below:
One working definition of mathematics I have heard is "The manipulation of stable mental objects" (Manin). This suggests that we need to consider more carefully what these "mental models" are. In some areas of philosophy, the existence of mental images like this have been disregarded because of a belief that language is identical with thought. Please see the question here for a strong indication of where philosophy could add to mathematical practice.
It seems that the mathematical literature is a recording of a network of formal systems (or perhaps language games) that is (at least locally) consistent, but what it seems mathematicians do is form their own mental models of patches of this logical landscape and work very intuitively with the models formed. The mathematicians who do this the most effectively can predict and prove results that continue the development of the literature.
(I could only include two hyperlinks...if my reputation increases enough I can come back and add more.)