From Emperor of Japan: Meiji and His World, 1852–1912, by Donald Keene (Columbia U. Press, 2005), Kindle pp. 164-165:
During Meiji’s stay in Tōkyō, negotiations were opened with the foreign diplomats living in Yokohama on a number of matters: the end of their policy of neutrality in the conflict between the government and the rebels; the destruction of the rebels in Hakodate; the disposition of the Japanese Christians; and the issuance of paper money. The negotiations did not go smoothly. The foreign representatives, headed by the redoubtable Sir Harry Parkes, refused to consider any request that seemed to threaten the sacred right to trade—in Hakodate and anywhere else.
On January 2 a foreign trade center was opened in Tōkyō at Tsukiji, which was also made available to foreigners for residence. Samurai were forbidden to enter the settlement without written permission. This restriction on the passage of samurai into the concessions was probably intended to allay the foreigners’ fear of sworded samurai, but it had the effect of lowering their prestige. Before long, the samurai were given the task of protecting foreign ships, something none of them could have foreseen. Ōnuma Chinzan wrote a poem on their plight:
A little Yang-chou—that’s the new Shimabara;
Our browbeaten Japanese warriors guard the barbarian ships.
“Please don’t come here wearing your swords—
Please come instead with a hundred thousand coins.”
In the winter of 1868, at the same time that daimyo mansions in Tsukiji were demolished to provide living space for the foreigners, a new licensed quarter, named after the old Shimabara in Kyōto, was opened nearby. The last two lines of the poem indicate that for the prostitutes of the new Shimabara, money counted more than a customer’s rank. This surely was no less humiliating for the samurai than the duty of protecting foreigners, despite their jōi [Expel the Barbarians] convictions of a few years earlier.
On January 5 and 6 the emperor received the ministers from foreign countries, evidence of his hope for increased and better relations between Japan and the rest of the world. In Western diplomatic practice, there was nothing remarkable about the emperor’s receiving foreign diplomats and providing refreshments for them, but it was unprecedented in Japan. It is all the more astonishing when one recalls that Kōmei, who considered that the presence of foreigners on the sacred soil of Japan was an unspeakable offense to the gods, had died less than two years earlier. The young emperor was willing not only to meet foreigners but was affable to them.