Does it mean phonological rule? Or can we say phonological mechanism refers to the phonological rules in our mind?
I assume that you encountered this expression in a textbook. It is not a technical term, it means "whatever device your theory uses". Some theories have constraints, some theories have rules, some have rules and constraint, and then there are lots of different types of rules or constraints, and probably other types of computations that don't fall under either category. If I say "We need a mechanism to turn /k/ into [ʁ] in Tigrinya", I'm being more theory-neutral. If I say "We need a sonority-spreading rule to turn /k/ into [ʁ] in Tigrinya", I am committing to a specific kind of analysis.
Whether or not rules / constraints are in your mind or are just theoretical devices used to describe data is a completely separate question.