1 Corinthians 11:23-29: "23 For I received from the Lord what I also delivered to you, that the Lord Jesus on the night when he was betrayed took bread, 24 and when he had given thanks, he broke it, and said, 'This is my body which is for you. Do this in remembrance of me.' 25 In the same way also he took the cup, after supper, saying, 'This cup is the new covenant in my blood. Do this, as often as you drink it, in remembrance of me.' 26 For as often as you eat this bread and drink the cup, you proclaim the Lord's death until he comes.
"27 Whoever, therefore, eats the bread or drinks the cup of the Lord in an unworthy manner will be guilty concerning the body and blood of the Lord. 28 Let a person examine himself, then, and so eat of the bread and drink of the cup. 29 For anyone who eats and drinks without discerning the body eats and drinks judgement on himself."
Luke 22:17-20: "17 And he took a cup, and when he had given thanks he said, 'Take this, and divide it among yourselves. 18 For I tell you that from now on I will not drink of the fruit of the vine until the kingdom of God comes.' 19 And he took bread, and when he had given thanks, he broke it and gave it to them, saying, 'This is my body, which is given for you. Do this in remembrance of me.' 20 And likewise the cup after they had eaten, saying, 'This cup that is poured out for you is the new covenant in my blood.'"
Mark 14:22-25: "22 And as they were eating, he took bread, and after blessing it broke it and gave it to them, and said, 'Take; this is my body.' 23 And he took a cup, and when he had given thanks he gave it to them, and they all drank of it. 24 And he said to them, 'This is my blood of the covenant, which is poured out for many. 25 Truly, I say to you, I will not drink again of the fruit of the vine until that day when I drink it new in the kingdom of God.'"
Matthew 26:26-28: "26 Now as they were eating, Jesus took bread, and after blessing it broke it and gave it to the disciples, and said, 'Take, eat; this is my body.' 27 And he took a cup, and when he had given thanks he gave it to them, saying, 'Drink of it, all of you, 28 for this is my blood of the covenant, which is poured out for many for the forgiveness of sins.'"
Psalm 130: "1 Out of the depths I cry to you, O LORD! 2 O Lord, hear my voice! Let your ears be attentive to the voice of my pleas for mercy!
"3 If you, O LORD, should mark iniquities, O Lord, who could stand? 4 But with you there is forgiveness, that you may be feared.
"5 I wait for the LORD, my soul waits, and in his word I hope; 6 my soul waits for the Lord more than watchmen for the morning, more than watchmen for the morning.
"7 O Israel, hope in the LORD! For with the LORD there is steadfast love, and with him is plentiful redemption. 8 And he will redeem Israel from all his iniquities."
+++
The passages from 1 Corinthians 11:23-29, Luke 22:17-20, Mark 14:22-25, and Matthew 26:26-28 are all fairly similar and are the basis for the hymn. In the hymn text itself, they show up most clearly in the first verse, the end of the fifth verse ("The covenant of hope and grace"), and the refrain ("Lord, may Thy body and Thy blood / Be for my soul the highest good!").
Psalm 130 is more difficult to see. Verse 7 seems to appear in the lines "Thy heart is filled with fervent yearning / That sinners may salvation see" in the second verse.
The lines "Yet Thou Thy lamb wilt banish never, / For Thou my faithful shepherd art" in the third verse use the sheep and shepherd imagery that occurs in a number of places in the Bible, notably John 10.