Taken together, the efforts show a president who is deeply concerned by what he perceives as threats to China’s security and eager to showcase his vision of an all-powerful Communist Party.

Mr. Xi, who rose to power in 2012, often speaks about the need to protect the party against domestic and foreign enemies, and he has worked to strengthen the military and national security forces. He has presided over a withering campaign against critics: imprisoning scores of human rights lawyers, activists and journalists who have pushed for greater freedoms.

The security measures for the party congress show that Mr. Xi will not hesitate to use a “heavy hand on those who dare to exist with differing views,” said Frances Eve, a researcher for Chinese Human Rights Defenders, an advocacy group.

“Left unchecked,” Ms. Eve said, “Xi’s vision of totalitarian control would see civil society eliminated and freedom of opinion and expression strangled.”