There are many undulating terrains in the wild environment. In order to realize the adaptive and stable walking of quadruped robots on unknown sloped terrain, a slope-adaptability model predictive control (SAMPC) algorithm is proposed in this work. In the absence of external vision sensors, the orientation and inclination of the slope are estimated based on the joint position sensors and inertial measurement units (IMU). In an effort to increase the stability margin, the adaptive algorithm adjusts the attitude angle and the touch-down point of the swing leg. To reduce the slipping risk, a nonlinear control law is designed to determine the friction factor of the friction cone constraint from the inclination of the slope. We validate the effectiveness of the framework through a series of simulations. The automatic smooth transition from the flat to the unknown slope is achieved, and the robot is capable of walking in all directions on the slope. Notably, with reference to the climbing modal of blue sheep, the robot successfully climbed a 42.4° slope, proving the ultimate ability of the proposed framework.