Depends on specific airplane/equipment and airline SOP...
In the 744, for example, in VNAV mode the restrictions are programmed into the FMS automatically. If given a "Descend via STAR" or "Climb via SID" clearance to an altitude or flight level, the cleared altitude MAY be set in the MCP if the crew verifies all restrictions are in fact programmed and show in the CDU. As indicated by others above, many airline SOPs require that the intervening restrictions be set in the MCP until the associated fix is passed.
In a non-FMS airplane like the 747 Classic, the CLEARED altitude is usually set in the MCP, and the vertical speed adjusted to make the intervening restrictions.
I'm a fan of placing the CLEARED altitude in the MCP and monitoring performance as required for the intervening restrictions. There may be exceptions to this general rule, but I have no specific examples.