An exceptional ball carrier and a key component in Connacht's defensive line, McSharry has started 16 games so far this season, bringing his total tally to 30 senior caps to date.
He has established himself as a dangerous runner and his attacking prowess came to the fore this season with tries against the European champions Leinster and Aviva Premiership champions Harlequins.
The 23-year-old earned his first O2 Ireland Wolfhounds cap in January when he was named in the side to play England Saxons at the Sportsground. A week later, he received a call up to the Ireland Six Nations training squad.
"I'm obviously delighted to sign for a further two years with Connacht. These are exciting times for the province with the squad that's being built and the players coming through, not to mention new coach Pat Lam coming on board," said McSharry.
"On a personal level, it's been a big year for me getting my first Wolfhounds cap and being part of the senior Six Nations squad.
"I am still improving as a player and I feel Connacht is the best place for me to continue that progress, getting the chance to play in big games consistently and being part of a squad that is really developing and going places.
"I would like to thank the departing Eric (Elwood), Billy (Millard) and Mike (Forshaw) for all the work they have put in with me over the last two years and I wish them all the best with their futures."
Connacht Chief Executive Tom Sears commented: "Dave has proven himself to be one of the best young players in the country and it is another really positive sign for Connacht that he sees his future with us.
"His performances this season have attracted great interest, not least with the national selectors, and we have every confidence that he can continue to develop and be a key part of an exciting Connacht side that has great ambition.
"With our own hugely talented players committing like Dave and those who have signed new contracts recently, top new signings like Craig Clarke, Aly Muldowney and Fionn Carr coming in and with a few additional players we expect to bring in before the start of next season, we are delighted with the way the squad is taking shape.
"We think next season will be an exciting one for everyone involved with Connacht Rugby and we fully expect to keep improving and start challenging the sides currently ahead of us."