Is there a way to dynamically add/remove constraints? (Use case: simulate grasping behavior of suction cups)
You cannot change the model structure at runtime since MuJoCo uses compiled models. However all constraints have data fields which can be used to enable and disable them at runtime. Equality constraints have mjModel.eq_active. Joint limits have mjModel.jnt_limited etc. There are also global disable flags in mjModel.opt.disableflags that can disable all constraints in a given category.