After receiving a PhD in Mathematical Physics at the University of Milan, Magli developed his academic career at the Politecnico of Milan, where he became full professor of Mathematical Physics in 2005. Since 2009 he teaches the unique official course on Archaeoastronomy ever established in an Italian University.

In the field of relativistic astrophysics, Magli has worked on the so-called Cosmic Censorship conjecture. He was the first to find the general exact solution of the Einstein field equations for spherically symmetric spacetimes with tangential stresses and, together with R. Giambo', F. Giannoni and P. Piccione, to investigate the nature of the final state for these gravitational collapse models.

In the field of Archaeoastronomy, Magli has investigated the foundations of the discipline and its relationship with "exact" sciences, insisting in particular on the possibility for Archaeoastronomy to make "predictions" - to be tested against facts - as any other scientific discipline can do. These ideas have been applied in particular to the relationship between topography, astronomy and dynastic history in the Egyptian pyramid's fields. In this context Magli proposed an inverse chronology between the two main pyramids of Giza as a consequence of the astronomical data, a theory which - thanks to Juan Belmonte of the IAC - developed in the idea, sustained today by both authors, that the project of the two was conceived together by Khufu in order to actualize his Akhet, symbolic horizon.

Using Archaeoastronomy arguments Magli has also proposed an explanation for the site of the Abusir pyramid's field, as well as a possible location where the missing pyramid of the 6th dynasty king Userkare might have been located. Magli has also investigated the meaning of the Inca citadel of Machu Picchu, proposing that it was a pilgrimage center conceived in pair with that of the Island of the Sun on the Titicaca Lake.

Magli has also worked together with Robert Hannah on the role of the sun in the original project of the Pantheon. His researches have been frequently reported in press and media releases, and have been the subjects of two CNN documentaries of the "Revealer" series. Magli is one of the co-authors to the thematic study "Heritage sites of astronomy and archaeoastronomy in the context of the Unesco World Heritage convention".

Gravitational collapse with non—vanishing tangential stresses II. A laboratory for cosmic censorship experiments-
Class. Quantum Gravity 15, 10, (1998) p. 3215–3228.[1]

New solutions of Einstein equations in spherical symmetry: the Cosmic Censor to the court. Commun. Math. Phys. 235 (2003)
3, 545-563 [2]

Archaeoastronomy and Archaeo-Topography as Tools in the Search for a Missing Egyptian Pyramid.
PalArch’s Journal of Archaeology of Egypt/Egyptology, 2010; 7(5) [3]

Astronomy, topography and dynastic history in the alignments of the Pyramids' fields of the Old Kingdom.
Mediterranean Archaeology and Archaeometry 10, 2 (2010) 59-74

At the other end of the sun's path. A new interpretation of Machu Picchu
Nexus Network Journal - Architecture And Mathematics 12, (2010) 321-341 [4]

The role of the sun in the Pantheon design and meaning
Numen - Archive for the History of Religion, Volume 58, Number 4, (2011), pp. 486–513 [5]

*Mysteries and discoveries of archaeoastronomy*.
Springer-Verlag NY, 2009 *"Mysteries and Discoveries of Archaeoastronomy - From Giza to Easter Island | Springer". springer.com. Retrieved 2015-06-25.

*Archaeoastronomy: Introduction to the Science of Stars and Stones* (2016); Springer International Publishing
eBook ISBN 978-3-319-22882-2 DOI 10.1007/978-3-319-22882-2