It may be the loneliest mayoral campaign in memory.

Anthony D. Weiner, whose once promising career in government imploded over his lewd private life online, is seeking to lead a city of eight million where close to half the voters are opposed to his running and the leadership of his own political party has written him off.

He has virtually no campaign infrastructure, no labor unions leaping to his side, no army of on-the-ground foot soldiers eager to evangelize on his behalf.

But, curiously enough, he says it may be better that way.

The improbable campaign that Mr. Weiner, a Democrat, unveiled on Wednesday hinges on his image as a shunned outsider whose political solitude has unburdened him from coddling New York’s powerful special interests and freed him to speak uncomfortable truths, according to those close to him.

A scrappy political street fighter, never known for forging alliances or sharing the limelight, Mr. Weiner said in an interview that “to some degree, this is my most natural footing.”