This paper combines several new constructions in mathematics and physics. Mathematically, we study framed flat PGL(K, ℂ)-connections on a large class of 3-manifolds M with boundary. We introduce a moduli space ℒ K (M) of framed flat connections on the boundary ∂M that extend to M. Our goal is to understand an open part of ℒ K (M) as a Lagrangian subvariety in the symplectic moduli space $$ {\mathcal{X}}_K^{\mathrm{un}}\left(\partial M\right) $$ of framed flat connections on the boundary — and more so, as a “K2-Lagrangian,” meaning that the K2-avatar of the symplectic form restricts to zero. We construct an open part of ℒ K (M) from elementary data associated with the hypersimplicial K-decomposition of an ideal triangulation of M, in a way that generalizes (and combines) both Thurston’s gluing equations in 3d hyperbolic geometry and the cluster coordinates for framed flat PGL(K, ℂ)-connections on surfaces. By using a canonical map from the complex of configurations of decorated flags to the Bloch complex, we prove that any generic component of ℒ K (M) is K2-isotropic as long as ∂M satisfies certain topological constraints (theorem 4.2). In some cases this easily implies that ℒ K (M) is K2-Lagrangian. For general M, we extend a classic result of Neumann and Zagier on symplectic properties of PGL(2) gluing equations to reduce the K2-Lagrangian property to a combinatorial statement. Physically, we translate the K-decomposition of an ideal triangulation of M and its symplectic properties to produce an explicit construction of 3d $$ \mathcal{N}=2 $$ superconformal field theories T K [M] resulting (conjecturally) from the compactification of K M5-branes on M. This extends known constructions for K = 2. Just as for K = 2, the theories T K [M] are described as IR fixed points of abelian Chern-Simons-matter theories. Changes of triangulation (2-3 moves) lead to abelian mirror symmetries that are all generated by the elementary duality between N f = 1 SQED and the XYZ model. In the large K limit, we find evidence that the degrees of freedom of T K [M] grow cubically in K.