yahoo-transit-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yahoo-transit-mcp東京から大阪までの経路を教えて"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yahoo-transit-mcp
Yahoo!乗換案内 の非公式 MCP(Model Context Protocol)サーバーです。Claude Code / Claude Desktop などのMCPクライアントから、日本の電車の経路検索・終電・運行情報・駅時刻表を調べられるようになります。
Unofficial MCP server for Yahoo! Transit (transit.yahoo.co.jp), a Japanese transit directions service. Provides route search (incl. last/first train), realtime service disruption info, and station timetables as MCP tools. No authentication required. Japanese rail network only.
できること
ツール | 説明 |
| 経路検索。出発・到着時刻指定のほか、終電( |
| 運行情報(遅延・運転見合わせ)。8地方エリア別。路線名で絞り込むと平常運転かどうかも確認できる |
| 駅名から駅コードを検索。候補が1件なら路線・方面一覧も返す |
| 駅の発車時刻表。路線・方面・平日/土曜/日祝・時間帯で絞り込み |
認証・APIキー・環境変数は一切不要です(ログイン不要の公開ページのみを利用するため)。
Related MCP server: ns-bridge
クイックスタート
Node.js 18以上が必要です。
Claude Code
プロジェクトの .mcp.json に追加します:
{
"mcpServers": {
"transit": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:groundcobra009/yahoo-transit-mcp"]
}
}
}またはCLIで:
claude mcp add transit -- npx -y github:groundcobra009/yahoo-transit-mcpClaude Desktop
claude_desktop_config.json に追加します:
{
"mcpServers": {
"transit": {
"command": "npx",
"args": ["-y", "github:groundcobra009/yahoo-transit-mcp"]
}
}
}クローンして使う場合
git clone https://github.com/groundcobra009/yahoo-transit-mcp.git
cd yahoo-transit-mcp
npm ci && npm run build
# → MCPクライアントには command: "node", args: ["/path/to/yahoo-transit-mcp/dist/index.js"] で登録登録後、「明日の朝9時までに大阪駅に着きたい」「山手線は遅れてる?」「終電何時?」のように話しかけるだけで使えます。
出力例
search_route(from: "東京", to: "大阪") の実際の返り値(抜粋):
{
"routes": [
{
"no": 1,
"depart": "06:00",
"arrive": "08:40",
"duration": "2時間40分",
"fare": "13,870円",
"transfers": 1,
"badges": ["早"],
"legs": [
{
"from": "東京", "fromTime": "06:00",
"line": "JR新幹線のぞみ1号", "destination": "博多行",
"to": "新大阪", "toTime": "08:22",
"platform": { "departure": "14番線", "arrival": "21番線" },
"fare": "8,910円"
},
{
"from": "新大阪", "fromTime": "08:36",
"line": "JR直通快速107号",
"to": "大阪", "toTime": "08:40",
"platform": { "departure": "3番線" }
}
]
}
]
}スモークテスト(npm run smoke)で4ツールすべてを実データ検証できます:
動作原理
公式APIは存在しないため、このサーバーは公開ページに埋め込まれた構造化データを読み取ります。
Yahoo!乗換案内はNext.jsで構築されており、サーバーサイドレンダリングされた各ページには、画面表示用の全データが <script id="__NEXT_DATA__"> タグ内のJSONとして同梱されています(Reactのハイドレーション用・Next.jsの標準動作)。このサーバーはブラウザと同じようにページをGETし、このJSONだけを抽出してパースします。
Yahooのバックエンドエンドポイントを直接叩きません(リバースエンジニアリング・トークン取得なし)
CSSセレクタに依存しないため、見た目のリニューアル程度では壊れません
ページ構造が大きく変わって解析できなくなった場合は、
MarkupChangedErrorがツール結果として明示的に返ります(黙って誤った経路を返すことはありません)
ツールリファレンス
search_route — 経路検索
パラメータ | 型 | 説明 |
| string(必須) | 出発・到着の駅名または地名 |
| string[] | 経由駅(最大3つ) |
| string |
|
| enum |
|
| enum |
|
| enum |
|
| boolean | 新幹線 / 有料特急 / 飛行機 / 高速バスの利用可否(既定: true) |
駅名が曖昧な場合は候補リスト(didYouMean)を返します。
get_train_status — 運行情報
パラメータ | 型 | 説明 |
| enum |
|
| string | 路線名の部分一致フィルタ(例: |
| boolean |
|
search_station — 駅検索
パラメータ | 型 | 説明 |
| string(必須) | 駅名(例: |
get_timetable — 駅時刻表
パラメータ | 型 | 説明 |
| string(必須) | 駅名または駅コード |
| string | 路線名・方面の部分一致。曖昧なら候補一覧がエラーとして返るので絞り込んで再実行 |
| enum |
|
| number | 返す時間帯(0〜27時台) |
アクセスマナー(実装で強制)
相手サーバーに負荷をかけないため、以下をコードで強制しています:
全リクエストの直列化+1.5秒以上の間隔(
src/fetch.ts)URL単位の15分キャッシュ
10秒タイムアウト・リトライは通信エラー時の1回のみ
対話的な利用を想定したツールです。ポーリング・一括クロール・大量取得には使わないでください。
開発
npm ci # 依存インストール
npm run build # TypeScriptビルド(dist/)
npm run lint # 型チェック(tsc --noEmit)
npm run smoke # 実サイトに対する動作確認(約6リクエスト・直列)
npx tsx scripts/try-route.ts 東京 大阪 2026-07-10 09:00 arrival # 単発の経路検索CIでは lint / build のみ実行します。smoke は実サイトへアクセスするため、リリース前の手動ゲートとしてローカルで実行してください。
免責事項
本プロジェクトは個人による非公式ツールであり、LINEヤフー株式会社とは一切関係ありません(非公認・非提携)。「Yahoo!」「Yahoo!乗換案内」はサービスの識別のためにのみ言及しており、商標は各権利者に帰属します
公開ウェブページの解析に基づくため、サイト側の変更により予告なく動作しなくなる可能性があります
取得した情報の正確性は保証されません。実際の運行は公式情報を確認してください
本ソフトウェアの利用は自己責任です。利用者は対象サービスの利用規約を自身で確認し、過度なアクセス・商用利用・取得データの再配布を行わないでください
ライセンス
MIT © keitaro (groundcobra009)
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server that provides real-time delay information for JR East train lines, accessible via MCP clients like Claude Desktop through the 'getDelays' tool.4MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to interact with the Netherlands Railways (NS) API for route planning, pricing, and real-time departure information. It provides tools for searching stations, planning trips with connections, and viewing real-time departure boards.31MIT
- AlicenseAqualityDmaintenanceMCP server for searching Japanese train routes using Yahoo! Transit data, enabling station-to-station route planning with optional via stations, time specifications, and fare options.14526MIT
- Alicense-qualityDmaintenanceAn MCP server for real-time Italian railway data, enabling natural language queries about train schedules, delays, departures, arrivals, and live tracking via the Viaggiatreno API.5MIT
Related MCP Connectors
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
Official remote MCP server for SUZURI.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/groundcobra009/yahoo-transit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server