In the Kipnis Marchioro Presutti model a positive energy \(\zeta _i\) is associated with each vertex i of a finite graph with a boundary. When a Poisson clock rings at an edge ij with energies \(\zeta _i,\zeta _j\) , those values are substituted by \(U(\zeta _i+\zeta _j)\) and \((1-U)(\zeta _i+\zeta _j)\) , respectively, where U is a uniform random variable in (0, 1). A value \(T_j\ge 0\) is fixed at each boundary vertex j. The dynamics is defined in such way that the resulting Markov process \(\zeta (t)\) , satisfies that \(\zeta _j(t)\) is exponential with mean \(T_j\) , for each boundary vertex j, for all t. We show that the invariant measure is the distribution of a vector \(\zeta \) with coordinates \(\zeta _i=T_iX_i\) , where \(X_i\) are iid exponential(1) random variables, the law of T is the invariant measure for an opinion random averaging/gossip model with the same boundary conditions of \(\zeta \) , and the vectors X and T are independent. The result confirms a conjecture based on the large deviations of the model. When the graph is one-dimensional, we bound the correlations of the invariant measure and perform the hydrostatic limit. We show that the empirical measure of a configuration chosen with the invariant measure converges to the linear interpolation of the boundary values.