The event, won last season by Super League's Bradford Bulls, will be held on Saturday, August 16, which is the day after the Saints entertain Castleford Tigers in a Super League Round 23 match.
Speaking on the decision to participate, Saints' Chief Executive, Sean McGuire, said: "We were delighted to receive the invitation. It's a great opportunity for the club to project itself on the national stage and compete against quality opposition from the Rugby Union's Zurich Premiership teams.
"Although the timing isn't ideal from our perspective, coming as it does the day after a tough Super League match, we are confident that the players will relish the challenge and the opportunity to display their talents at Twickenham."
The Saints will be competing against the top names from the Zurich Premiership including the neighbours, the Sale Sharks, and guest sides to be confirmed.
St Helens were defeated 41-39 by Sale Sharks in a 'Cross-code' Challenge Match at their Knowsley Road home earlier this year but will be determined to win the 'Battle of the codes' this August.
Rugby League sides have been successful in the history of the Middlesex Sevens with Wigan RL winning the competition at their first attempt in 1996, becoming the first non-Rugby Union winners of the event.
Bradford Bulls won the event last year, beating Wasps 42-14 in the Final after disposing of Leeds (24-5), Gloucester (42-12) and the Army (31-5). Wigan RL lost to Newcastle Falcons 31-5 in the 'Plate' semi-finals.