Many years ago, on one of my first trips of Jerusalem, I visited an American friend who had recently joined the US Foreign Service and was assigned as some sort of junior consular officer in the US Consulate in East Jerusalem. He explained at the time that as the junior consular officer present, he was the one on call to take possession from the Israeli authorities of any self-proclaimed messiahs or prophets who showed up in town or at the airport without visible means of support and with American nationality. Apparently this was a frequent enough occurrence for there to be a designated consular officer assigned the task, and other foreign consulates presumably had analogous officials. Apparently it's a pretty frequent occurrence in the holy city for someone to show up at immigration and announce that they are Jesus Christ or King David or the Jewish Messiah. (Though I assume they needed some other documentation to get through the immigration at the airport, assuming they didn't just descend from the heavens without the help of El Al.) The Israelis, at least back then, turned them over to their respective consulates (if they couldn't support themselves anyway) and let them figure out what to do with them.
I don't know what the consular arrangements may be nowadays, but this article called "The Jerusalem Syndrome" in Wired talks to an Israeli psychiatrist who interacts with many of the chosen messengers, so obviously they're still showing up in Jerusalem.