If you want to stay on the same page and update the class of the clicked item, then you need to prevent the browser from following the hyperlink:
$('li.main-menu__item').click(function(e){
$('li.main-menu__item').removeClass("active");
$(this).addClass(" active");
e.preventDefault();
});
Demo[
^]
If you want to follow the hyperlink to load a new page, then you'll need to change the active item in the HTML you return from the new page. Either edit the static HTML page, or use server-side code to generate the menu.