Yasir, who has taken 149 wickets in 26 Tests, has most recently been playing for Kent in the County Championship and joins fellow Pakistan international Misbah-ul-Haq in facing Afghanistan in a 50 overs per side match.
Lord's owners MCC will be captained by former New Zealand skipper Brendon McCullum.
Their team also features West Indies great Shivnarine Chanderpaul and Sri Lanka star Kumar Sangakkara.
McCullum is currently playing for Lord's-based Middlesex in English county cricket's Twenty20 Blast.
Also Read
Afghanistan, recently awarded Test status, can include spinner Rashid Khan and all-rounder Mohammad Nabi in their side, with both players having featured for Sunrisers Hyderabad in this year's Indian Premier League.
"Yasir joins the MCC team as the final piece in the jigsaw for this match and we are delighted he is able to play in this historic fixture," said MCC head of cricket John Stephenson in a club statement.
Although its more than 40 years since Marylebone Cricket Club (MCC) ceased to run English cricket, it retains worldwide responsibility for the sport's rules, known as Laws.
Disclaimer: No Business Standard Journalist was involved in creation of this content