Mesh subdivision algorithms are usually specified informally using graphical schemes defining local mesh refinements. These algorithms are then implemented efficiently in an imperative framework. The implementation is cumbersome and implies some tricky indices management. Smith et al. (2004) asks the question of the declarative programming of such algorithms in an index-free way. In this paper, we positively answer this question by presenting a rewriting framework where mesh refinements are described by simple rules. This framework is based on a notion of topological chain rewriting. Topological chains generalize the notion of labeled graph to higher dimensional objects. This framework has been implemented in the domain specific language MGS. The same generic approach has been used to implement Loop as well as Butterfly, Catmull-Clark and Kobbelt subdivision schemes.