This paper presents a new cell-centered numerical method for ideal magnetohydrodynamics (MHD) that can be used in Lagrangian or Eulerian discretization. A two-dimensional Riemann solver based on the HLLC-type MHD method is established, which can be viewed as an extension from the HLLC-2D in hydrodynamics. The main feature of the algorithm is to introduce a nodal contact velocity and ensure the compatibility between edge fluxes and the nodal flow intrinsically. It transforms naturally from Lagrangian setting to the Eulerian setting in terms of grid nodal velocity, and gains benefits of the Lagrangian nature of the scheme. In the Lagrangian approach, the finite volume scheme itself can keep the magnetic field divergence-free strictly, while in the Eulerian case, a special constrained transport (CT) algorithm is constructed from the discontinuous fluxes on cell interfaces to ensure solenoidal nature again. Numerical tests are presented to demonstrate the performance of this new solver and compare the difference between the Lagrangian and Eulerian methods.