  We reinterpret the generalised Lie derivative of M-theory $E_6$ generalised
geometry as hamiltonian flow on a graded symplectic supermanifold. The
hamiltonian acts as the nilpotent derivative of the tensor hierarchy of
exceptional field theory. This construction is an M-theory analogue of the
Courant algebroid and reveals the $L_\infty$-algebra underlying the tensor
hierarchy.
  The AKSZ construction identifies that same hamiltonian with the lagrangian of
a 7-dimensional generalisation of Chern-Simons theory that reduces to the
M5-brane Wess-Zumino term on 5-brane boundaries. The exercise repeats for the
type IIB $E_5$ generalised geometry and we discuss the relation to the
D3-brane.
