Any two or more municipalities may unite in undertaking any one or more of the works mentioned in this article as a local or general improvement. One or more municipalities may unite with a county in the undertaking of any such improvement. Whenever such work is contemplated a proposed agreement shall be prepared setting forth the work or works to be undertaken, the plans and specifications therefor, the proportion of the cost thereof to be borne by each and any other provisions deemed necessary to be inserted therein.