The experienced back-row has signed a two-year deal with Richard Cockerill’s side after a five-year spell in Wales.
Former Glasgow Warriors man Barclay, capped 64 times by his country, lifted the Pro12 title with Scarlets last season but is looking forward to heading home next year.
The 31-year-old, who will skipper Scotland against New Zealand on Saturday, said: “Edinburgh as a club, and as a city, has a huge amount of potential and I can see what they are trying to do, so I’m looking forward to being a part of it.
“Scotland is home, so it’ll be great to come back and play at one of my home clubs.”
Edinburgh head coach Cockerill said: “We’re delighted that a player of John’s calibre has chosen to join Edinburgh.
“He’s a terrific player, with a proven track record and his leadership values will only add to the strong culture we’re building at this club. John is committed to taking Edinburgh forward and his ambition to create a winning environment will benefit our squad immensely.”
Watch the Heineken Champions Cup Final live on RugbyPass throughout Asia and Australia.