I have a short quote as part of the title of an essay I am writing, and was wondering how I'd cite a quotation in the title of my essay in MLA format?
You don't include citations in the title of an article.
Enclose the quoted phrase in quote marks, so it's clear that they are someone else's words, and then give the source in the introduction.
"Taking Arms Against a Sea of Troubles": Swiss Foreign Relations, 1683-1715
Shakespeare's character Hamlet considered one of his options to be "taking arms against a sea of troubles" (Shakespeare, p. 123). A similar choice was faced by the leaders of Switzerland in the late 17th century. [...]
Then include a reference to Shakespeare's work in your bibliography or list of references, as with any other source.
If the quote and its source are common knowledge, so that's it's more a proverb than a quote, then it's probably not necessary to discuss the source, unless it gives useful context.
If this is an essay for a course, then if in further doubt, consult your instructor.