  Let $G$ be a connected quasi-split reductive group over $\mathbb{R}$, and
more generally, a quasi-split $K$-group over $\mathbb{R}$. Arthur had obtained
the formal formula for the spectral side of the stable local trace formula, by
using formal substitute of Langlands parameters. In this paper, we construct
the spectral side of the stable trace formula and endoscopy trace formula
directly for quasi-split $K$-groups over $\mathbb{R}$, by incorporating the
works of Shelstad. In particular we give the explicit expression for the
spectral side of the stable local trace formula, in terms of Langlands
parameters.
