Kant's cosmopolitan ideas were meant to form part of a civil religion similar to the kind that James Madison, Thomas Jefferson, and the other framers of the American Constitution envisaged. His transcendental idealism, at least in morality, ultimately is a political idealism, in which attaining the greatest good is not something that will be accomplished in another world but is a task to be accomplished on this earth. Kant's political writings were an attempt to show how rational (or reasonable) ideas can be substituted for religious ones, and why indeed it is necessary for the good of mankind to reinterpret religious ideas to make them fit the needs of humanity.
(Manfred Kuehn, Kant: A Biography [Cambridge: Cambridge University Press, 2001], 384-5)
Note from KBJ: I no more think of myself as a citizen of the world than I think of myself as a citizen of North America or of the Northern Hemisphere. I'm a citizen of the United States (as well as some of its subdivisions, such as Texas and Fort Worth). By the way, one answers questions and solves problems. One does not answer problems.
Note 2 from KBJ: Kant denied moral status to nonhuman animals. Our duties to them, he argued, are actually duties to particular human beings. Animals, being nonrational, have no intrinsic moral significance. Kant's dog, in other words, counts for nothing, while some Chinese peasant counts for as much as Kant himself. So much for cosmopolitanism! It sounds more like parochialism or anthropocentrism to me.