The celebration of Mass began with the Last Supper and was continued by the early disciples of Jesus. This "breaking of the bread" is found in various New Testament letters, but also an ancient document called the Didache.
The Didache is an early collection of writings that most scholars date to the 1st century. Some have even claimed that it can be dated to 48 AD, based on evidence that it may have been written before the Council of Jerusalem.
The Didache details various aspects of the early celebration of Mass, such as the requirement to receive holy communion.
It is clear from this passage that the confession of sins was an essential part of participating in Mass and receiving holy communion.
The Catholic Church has maintained this position, explaining that it is only grave sin that prohibits us from reception of communion.
Venial sins do not need to be confessed before communion.
The early Christians knew that before we can be united to God in holy communion, we must first reconcile ourselves to him.