Matsumae (松前) is a small town in Hokkaido.
From Hakodate, take the train to Kikonai. (It takes anywhere from 40-65 minutes depending on the train you take.) A bus leaves that station bound for Matsumae. (It takes about 90 minutes to get to Matsumae Castle and the fare is 1210 yen.)
Note: Matsumae Castle (Matsumae-jo) is not the last stop so be alert when you enter the town. As you drive along the coast, you can see the castle to your right. It will be behind a big building that is easy to identify as a hospital. When you can see it, ring the bell to get off. Then walk for about 10 minutes up the hill towards it.
Note: There is a lack of signs in romaji (Roman alphabet). If you are lost and cannot speak Japanese, your best bet is to consult teenagers as they will be learning English in school.
When you go to the castle, you can get a free English map of the area. It is less detailed than the Japanese map.
The area is dotted with temples, shrines, and graveyards.
During the Bon period in August there is a parade and beard growing contest!
You can check the bus return times at the castle (just ask the attendant behind the glass at the entrance for help if you don't read kanji). There is a bus every two hours. The stop is straight back down the hill on the road beside the sea. There is a shelter with washrooms at the stop. The bus returns to Kikonai a few minutes before the train departs for Hakodate.