District heating networks with decentralized heat production are ideally suited to include a high share of renewable energy sources for heat production in urban areas with limited space. A new concept is a prosumer-based district heating network in which some or even all buildings are equipped with decentralized building-level heat storages and heat generation plants. To exploit the full potential of the interconnected heating network, buildings with surplus heat are intended to transfer heat to buildings with heating demands to prevent the activation of the central heating plant. This work presents an initial feasibility study on using a model predictive control strategy to manage bidirectional heat transfer between buildings in a district heating network. We formulate this problem as an optimal control problem, incorporating binary decision variables for each potential heat transfer connection. This results in a mixed-integer nonlinear optimization problem that is hard to solve. The problem is solved with a fast gradient-based optimization algorithm in combination with a combinatorial integral approximation strategy. A case study concerning a residential heating network with building-level solar thermal collectors and storage tanks is carried out. The optimized operation is compared to the real operation obtained from one month of measurements. The results show that the optimized strategy with bidirectional heat transfer can exploit the total heat generated in the whole network. The central heating provider is only required when the heat produced or stored by all the buildings is insufficient to meet the total heat demand within the network. In the case study, this leads to a reduction of almost 75% of the required thermal energy from the central heat provider.