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)
Available Tools
4 toolsget_timetable駅の時刻表A
指定駅・路線・方面の発車時刻表を取得する。路線・方面が曖昧な場合は候補一覧をエラーとして返すので、それを見て絞り込んで再実行する。
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | 路線名の部分一致(例: 山手線、東海道新幹線) | |
| hourTo | No | この時台以前のみ返す | |
| dayType | No | weekday=平日 / saturday=土曜 / holiday=日祝 | weekday |
| station | Yes | 駅名 または 駅コード(search_stationで取得) | |
| hourFrom | No | この時台以降のみ返す | |
| direction | No | 方面の部分一致(例: 品川・渋谷方面 なら 品川) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals a non-obvious behavior: ambiguous line/direction leads to an error containing a candidate list, prompting the user to refine. It does not mention rate limits or return format, but for a read-only timetable lookup, the disclosed ambiguity handling adds meaningful insight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, consisting of two sentences. The first sentence states the core purpose, and the second explains the error-handling behavior. There is no redundant or extraneous information, and the structure is front-loaded with the main action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and no annotations, so the description must provide sufficient context. It covers the core function and the key ambiguity error behavior. The schema itself references search_station for station codes, which mitigates the need for the description to do so. Overall, it is fairly complete for a straightforward retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for all six parameters, including examples and enums. The description adds no additional parameter-specific semantics beyond restating station/line/direction as the main selectors. Since the schema already documents parameters thoroughly, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves departure timetables for a specified station, line, and direction. This is distinct from the sibling tools (search_station, search_route, get_train_status). The verb '取得する' and resource '発車時刻表' are specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool: obtaining timetables with optional line/direction filtering. It also instructs the user to refine and retry when ambiguous line/direction causes an error. However, it does not explicitly mention when not to use this tool or compare it to alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_train_status運行情報(遅延・運転見合わせ)A
鉄道の運行情報(遅延・運転見合わせ等)をエリア別に取得する。line で特定路線に絞り込める(平常運転かどうかも分かる)。
| Name | Required | Description | Default |
|---|---|---|---|
| area | No | エリア名 | 関東 |
| line | No | 路線名の部分一致フィルタ(例: 山手線) | |
| onlyTroubled | No | false にすると平常運転の路線名一覧も返す |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the core read behavior and the ability to see normal operation, but it does not mention that onlyTroubled defaults to true (so by default only troubled lines are returned) or describe the output format. The parenthetical about normal operation could be ambiguous without schema details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with no filler. It front-loads the main purpose (area-based operation status retrieval) and then adds the line-filter detail, making every sentence earn its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is relatively simple, but with no output schema and no annotations, the description should clarify default behavior (e.g., onlyTroubled defaulting to true) and indicate what the response contains. It also does not position itself among siblings. These gaps make it adequate but incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description mentions the 'line' filter and normal status, but it largely restates what the schema already says (e.g., area-based retrieval, line filter). It adds little beyond the schema parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb '取得する' (retrieve) with a clear resource '鉄道の運行情報(遅延・運転見合わせ等)' and a clear scope 'エリア別'. It also mentions line filtering and normal-operation detection, which clearly distinguishes it from sibling tools like search_station, search_route, and get_timetable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: use this tool to get railway operation status by area, optionally filtered by line. However, it does not explicitly state when not to use it or mention alternatives (e.g., use get_timetable for schedules), so it misses full guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_route経路検索(Yahoo!乗換案内)A
出発地から目的地までの電車経路を検索する。時刻・所要時間・運賃・乗換回数・各区間の路線と番線を返す。終電は mode=last_train、始発は mode=first_train。
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | 到着駅・地名 | |
| via | No | 経由駅(最大3つ) | |
| date | No | 日付 YYYY-MM-DD(省略時は今日) | |
| from | Yes | 出発駅・地名(例: 東京、渋谷) | |
| mode | No | departure=出発時刻指定 / arrival=到着時刻指定 / first_train=始発 / last_train=終電 | departure |
| sort | No | 並び順: time=到着が早い / fare=料金が安い / transfers=乗換が少ない | time |
| time | No | 時刻 HH:MM(省略時は現在時刻) | |
| ticket | No | 運賃表示: ic=ICカード優先 / normal=きっぷ | ic |
| useExpress | No | 有料特急を使うか | |
| useAirplane | No | 飛行機を使うか | |
| useHighwayBus | No | 高速バスを使うか | |
| useShinkansen | No | 新幹線を使うか |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It does state the output data (time, duration, fare, transfers, routes), and explains the mode parameter's effect. However, it does not explicitly confirm the operation is read-only (though '検索' implies it), nor does it describe error handling, whether multiple route options are returned, or pagination. These omissions leave some behavioral aspects unclear, but the core behavior is adequately conveyed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences, front-loaded with the core action and output summary. Every sentence contributes essential information: the first describes purpose and return data, the second clarifies mode usage. There is no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 12 parameters and no output schema, the description provides a strong foundation by listing the key return fields and special mode options. It does not mention the boolean filters (useExpress, useAirplane, etc.) or sorting variants, but these are well-described in the schema. For an agent to correctly invoke the tool, the combination of schema and description is sufficient, though more context on default behavior (e.g., current time defaults) would round it out.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds little beyond this, except a natural-language restatement of the mode parameter's special values (first/last train). No additional parameter meanings or format details are introduced, so it neither improves nor degrades the schema information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states '出発地から目的地までの電車経路を検索する' (search train routes from departure to destination), a specific verb and resource. It further distinguishes itself from siblings by detailing the outputs: '時刻・所要時間・運賃・乗換回数・各区間の路線と番線を返す' (returns time, duration, fare, transfers, route and platform), clearly separating it from station search or timetable tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly defines the tool's context (route search between two points) and adds specific guidance for special modes: '終電は mode=last_train、始発は mode=first_train' (last train via mode=last_train, first train via mode=first_train). However, it does not explicitly name alternative tools or exclusion criteria, so it falls short of a 5. The context is clear enough for an agent to know when to select it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_station駅検索(駅コード・路線一覧)A
駅名から駅コードを検索する。候補が1件に絞れた場合はその駅の路線・方面一覧(時刻表取得用のgroupId)も返す。get_timetable の前段として使う。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 駅名(例: 新宿) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that station codes are returned, and additional route/direction info with groupId is only returned when the candidate narrows to one. However, it does not explain behavior for multiple or zero matches.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no redundancy, front-loaded with the primary purpose and followed by the conditional behavior and usage context. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with no output schema, the description covers the purpose, conditional behavior, and usage context. It could be improved by describing the response format for multiple candidates, but it is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already fully describes the query parameter with an example ('駅名(例: 新宿)'), and the description does not add significant new information about parameter syntax or format. Per the rubric, high schema coverage (100%) yields a baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: searching for station codes from station names. It also specifies the conditional return of route/direction lists with groupId, distinguishing it from sibling tools like search_route and get_timetable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states that this tool is used as a pre-stage for get_timetable, providing clear usage context. It does not explicitly exclude alternatives like search_route, but the role is obvious enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v0.1.0- First observed
get_timetable - First observed
get_train_status - First observed
search_route - First observed
search_station
TDQS
Each tool has a clear, distinct purpose: station search, route planning, train status, and timetable lookup. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern: search_station, search_route, get_train_status, get_timetable. The naming is uniform and predictable.
With 4 tools, the server is well-scoped for a transit domain, covering the essential user needs without unnecessary bloat or missing core functionality.
The tool set covers station lookup, route planning with fares and times, real-time status, and timetable retrieval. This forms a complete workflow for transit information, with no obvious gaps.
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 Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
Official remote MCP server for SUZURI.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides real-time delay information for JR East train lines, accessible via MCP clients like Claude Desktop through the 'getDelays' tool.5MIT
- 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.13726MIT
- AlicenseNot gradedqualityDmaintenanceAn 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.6MIT
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