We study the totally asymmetric exclusion process on the positive integers with a single particle source at the origin. Liggett (1975) has shown that the long term behaviour of this process has a phase transition: If the particle production rate at the source and the original density are below a critical value, the stationary measure is a product measure, otherwise the stationary measure is spatially correlated. Following the approach of Derrida et al. (1993) it was shown by Grosskinsky (2004) that these correlations can be described by means of a matrix product representation. In this paper we derive a large deviation principle with explicit rate function for the particle density in a macroscopic box based on this representation. The novel and rigorous technique we develop for this problem combines spectral theoretical and combinatorial ideas and is potentially applicable to other models described by matrix products.