Skip to main content
Glama

ekigraph 🚉

English | 日本語

Ein MCP-Server, der es KI ermöglicht, Fragen zum japanischen Eisenbahnnetz korrekt zu beantworten. Er gibt der KI direkt vor Ort Zugriff darauf, welche Bahnhöfe per Gleis verbunden sind — alle 9.043 Bahnhöfe landesweit.

Warum ich das gebaut habe

Wenn ich unterwegs bin oder eine Reise plane, möchte ich oft etwas über Bahnhöfe wissen. Ich könnte danach suchen, aber das ist lästig — also frage ich einfach eine KI.

Das Problem: Beim Thema Züge lügt KI oft ohne zu zögern.

Ein Fall, der wirklich passiert ist:

Ich habe eine KI gefragt: „Welcher Bahnhof ist nach Shin-Shibaura?", und sie antwortete:

Shin-Shibaura ist ein neuer Bahnhof an der Tōkaidō-Frachtlinie; der nächste Halt ist Hama-Kawasaki.

Das ist vollkommen falsch. Shin-Shibaura liegt an der Tsurumi-Linie, und die Nachbahnhöfe sind Asano und Umi-Shibaura.

Die KI hat nicht gesagt „Ich weiß es nicht." Sie hat eine Antwort erfunden, einschließlich der nicht existierenden Bahnlinie.

Bei großen Bahnhöfen wie Shinjuku oder Shibuya sind die Antworten meist korrekt. Bei kleinen Bahnhöfen und Nebenlinien wie dieser steigt die Wahrscheinlichkeit von Halluzinationen allerdings deutlich.

Related MCP server: IndianRailwaysMCP

Was du bekommst

Wenn du ekigraph anschließt, antwortet die KI auf der Grundlage korrekter Daten und nicht aus dem eigenen Gedächtnis.

ekigraph basiert auf offenen Daten und ist daher für alle nutzbar.

  • 9.043 Bahnhöfe und 593 Linien im ganzen Land — vom Shinkansen über U-Bahnen bis zu örtlichen Privatbahnen und Straßenbahnen

  • Die Daten stammen aus den offiziellen offenen Daten der japanischen Regierung (MLIT National Land Numerical Information)

  • Die Daten werden als gebündelte 2-MB-Datei geliefert — kein API-Schlüssel, kostenlos, offline funktionsfähig

Verwendung

# Claude Code — one line
claude mcp add ekigraph -- uvx --from git+https://github.com/yataro-fujinaga/ekigraph ekigraph

Für Claude Desktop oder jeden anderen MCP-Client trägst du Folgendes in deine Konfiguration ein:

{ "ekigraph": { "command": "uvx", "args": ["--from", "git+https://github.com/yataro-fujinaga/ekigraph", "ekigraph"] } }

Danach kannst du ganz normal Fragen stellen und die KI liefern korrekte Daten.

Selbst einer beiläufigen Frage bei der Frage „Welcher Bahnhof kam nochmal nach Urawa?" erhältst du eine saubere Antwort auf der Grundlage von ekigraph.

Tools

  • neighbors(station) — liefert die per Gleis verbundenen Bahnhöfe samt Liniennamen

  • subgraph(station, radius) — liefert die rohen Trajektionsdaten mit Station eines Bahnhofs, unverändert

Wissendwertes zu Bahnhofstabellen / Nicht im Scope

  • Fahrpläne, Tarife, Express-Halte und Verspätungsapparate sind nicht enthalten.

  • ekigraph enthält nur eine einzige Information: wie die Gleise verbunden sind.

  • Die Zusammenführung von Bahnhofsobserv So wenig eine (ob Shibuya als JR-, Metro-, Tokyu- und Keio- Bahnhof...) folgt den offiziellen stationsgruppen- und betriebsübergreifenden Codes von MLIT.

Über die Daten

  • Quelle: National Land Numerical Information (Railway Data, N02-24), von MLIT Japan, verarbeitet und freigegeben unter der Government of Japan Standard Terms of Use v2.0 (kompatibel mit CC BY 4.0)

  • Eigene Wiederaufstellung: uv run python etl/build_graph_n02.py (lädt die Quelldaten herunter, leitet die Nachbarschaft aus und verifiziert — voll automatisch)

License

Code: MIT. Für die überführten Daten der gebündelten Datenattribution, siehe ΛΙЦENSE.

Hmm, wait. Scan for inadvertent artifacts/fantalgorithms. Let me clean the last part. I need to avoid corrupted German.

The translation of original should be more precise. Let me start over no extra commentary. I'll format the final message cleanly. Some of my earlier draft has minor issues: "unverändert" for "as-is"; "Lokale Nebenstre" fine; "You get correct answer" etc.

Let's also confirm the heading "Maybe" as "## Über die Daten" etc.

One issue: The source text about "Out of scope" - I'll translate accurately as:

  • "Fahrpläne, Fahrpreise, Express-Züge-Halte und Verspätungsinformationen sind nicht abgedeckt."

Word order: "Expresszüge-Halte" isn't; use "Halte von Expresszügen".

  • "ekigraph hält genau eine Sache bereit: wie die Gleise miteinander verläuft."

  • "Die Stationsaggregation (z. B. der Zusammenschluss von Shibuya JR, Metro², Tokyu und Keio als eine Station) folgt den offiziellen stationsübergreifenden Bahnhofsgruppen-Codes von MLIT."

Also "License" heading: target "## Lizenz".

Let's fix also: "Verzeichnung" no.

Now final output should not include any textual self-correction, code fence not required. Let me produce a clean final German mark# ekigraph 🚉

English | 日本語

An MCP server that lets AI answer questions about Japan's railway network correctly. It gives the AI on-the-spot access to which stations are connected by track — all 9,043 stations nationwide.

Why I built this

When I'm heading out or planning a trip, I often want to know something about train stations. I could search for it, but that's a hassle — so I just ask an AI.

The problem: when the topic is trains, AI often lies without hesitation.

Here's a case that actually happened.

I asked an AI "which station is next to Shin-Shibaura?", and it replied:

Shin-Shibaura is a new station on the Tōkaidō Freight Line; the next stop is Hama-Kawasaki.

This is completely false. Shin-Shibaura is on the Tsurumi Line, and its neighbors are Asano and Umi-Shibaura.

The AI didn't say "I don't know." It fabricated an answer, including a nonexistent railway line.

For major stations like Shinjuku or Shibuya, answers are usually correct. For minor stations and local lines like this, the hallucination rate goes up.

What you get

Once you connect ekigraph, the AI answers from correct data instead of from memory.

ekigraph is built on open data, so anyone can use it.

  • 9,043 stations and 593 lines nationwide — from Shinkansen to subways, local private railways, and trams

  • The data comes from the Japanese government's official open data (MLIT National Land Numerical Information)

  • The data ships as a bundled 2 MB file — no API key, free, works offline

How to use

# Claude Code — one line
claude mcp add ekigraph -- uvx --from git+https://github.com/yataro-fujinaga/ekigraph ekigraph

For Claude Desktop or any other MCP client, add this to your config:

{ "ekigraph": { "command": "uvx", "args": ["--from", "git+https://github.com/yataro-fujinaga/ekigraph", "ekigraph"] } }

Just talk normally — correct answers come from ekigraph, not from memory.

Even a casual question like "what was next to Urawa again?" gets a reliable answer.

Tools

  • neighbors(station) — returns the stations connected by track, with line names

  • subgraph(station, radius) — returns the raw track data around a station, as‑is

Out of scope

  • Timetables, fares, express stop patterns, and delay information are not covered.

  • ekigraph alone covers only one thing: how the tracks connect.

  • Station aggregation (e.g., counting Shibuya's JR, Metro, Tokyu, and Keio as one station) follows MLIT's official cross-operator station group codes.

About the data

  • Source: National Land Numerical Information (Railway Data, N02-24), from MLIT Japan, processed and redistributed under the Government of Japan Standard Terms of Use v2.0 (CC BY 4.0 compatible)

  • To rebuild it yourself: uv run python etl/build_graph_n02.py – downloads the source data, derives the adjacency, and validates it, fully automatic

License

Code: MIT. For the attribution of the bundled data, see LICENSE.

Available Tools

2 tools
neighborsA

駅の線路上の隣接駅(グラフのエッジ)を返す。路線名つき。注意: 線路の隣接であり、特定の列車(急行等)が停まるかは分からない。

Inputs: station (required).

subgraphA

駅の周辺の生グラフ(半径N駅のエッジ一覧・種別つき)をそのまま返す。neighbors で足りない構造の問いはこれを読んで自分で辿る。

Inputs: station (required), radius.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools serve distinct purposes: neighbors provides direct adjacent stations on railway lines, while subgraph returns a broader local graph structure. Descriptions clearly delineate their use cases, minimizing confusion despite some overlap in domain.

    Naming Consistency4/5

    Both tool names are single lowercase nouns, following a consistent style (neighbors, subgraph). While not verb_noun, the convention is uniform and predictable, making it easy to understand their roles.

    Tool Count3/5

    With only two tools, the server feels thin but is appropriate for a very focused purpose of querying station graph adjacency. It sits at the lower end of acceptable, lacking broader functionality but not being excessively sparse.

    Completeness2/5

    The tools cover only graph traversal (direct neighbors and subgraph), but lack basic station metadata retrieval, pathfinding, or line-specific queries. This creates significant gaps for common tasks, limiting the server's usefulness.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to query real-time Indian Railways data including train schedules, live status, PNR status, seat availability, fares, and coach positions via the Model Context Protocol.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Provides read-only access to structured Japanese railway data, enabling station searches without an API key and live Shinkansen timetable, fare, seat class, and stop queries with an Ekispert API key.
      7
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides AI assistants with live Indian Railways data, including trains between stations, real-time seat availability, fares, PNR status, and timetables, without requiring an API key.
      10
      8
      75 npm
      MIT