Skip to main content
Glama
ÖPNV MCP Server

ÖPNV MCP Server

by alpenkind

ÖPNV MCP Server

A Model Context Protocol (MCP) server for German public transport information using the v6.db.transport.rest API.

Features

  • Search stations and stops - Find train stations, bus stops, tram stops across Germany

  • Live departures/arrivals - Real-time information with delay tracking

  • Journey planning - Find connections with transfers, platform info, and tight connection warnings

  • Smart warnings - Highlights delays, cancellations, platform changes, and risky transfers

Supports all transport types: ICE, IC, RE, RB, S-Bahn, U-Bahn, Tram, Bus

Related MCP server: swiss-public-transport-mcp

Installation

npm install
npm run build

Usage

Add to your MCP client configuration. This server uses stdio transport.

Example configuration:

{
  "mcpServers": {
    "oepnv": {
      "command": "node",
      "args": ["/absolute/path/to/oepnv-mcp/dist/index.js"]
    }
  }
}

Restart your MCP client to activate the server.

Example Queries

  • "Find trains from München Hbf to Berlin"

  • "Show me departures from Alexanderplatz"

  • "When does the next S-Bahn leave from Marienplatz?"

  • "Plan a journey from Stuttgart to Hamburg tomorrow at 10:00"

Available Tools

search_station

Search for stations and stops by name.

Parameters:

  • query (string): Station name (e.g., "München Hbf", "Berlin Alexanderplatz")

get_departures

Get live departures from a station.

Parameters:

  • stationId (string): Station ID from search results

  • duration (number, optional): Time window in minutes (default: 90, max: 120)

get_arrivals

Get live arrivals at a station.

Parameters:

  • stationId (string): Station ID from search results

  • duration (number, optional): Time window in minutes (default: 90, max: 120)

search_journeys

Find journey connections between two stations.

Parameters:

  • originId (string): Origin station ID

  • destinationId (string): Destination station ID

  • departureTime (string, optional): Departure time in YYYY-MM-DDTHH:MM format

Development

# Run in development mode
npm run dev

# Build
npm run build

# Start production server
npm start

API

This server uses the v6.db.transport API (db-vendo-client as backend).

License

MIT

Available Tools

5 tools
get_arrivalsB

Get live arrivals for a station by ID from a station or stop (trains, buses, trams, U-Bahn, S-Bahn)

Inputs: stationId (required), duration.

get_departuresC

Get live departures for a station by ID from a station or stop (trains, buses, trams, U-Bahn, S-Bahn)

Inputs: stationId (required), duration.

get_disruptionsA

Get current disruptions, warnings, and service information for a station (delays, cancellations, construction work, etc.)

Inputs: stationId (required).

search_journeysA

Search for journeys between two stations. If the user doesn't specify a departure time, ask them when they want to travel (e.g., 'now', 'tomorrow at 10:00', 'next Monday 14:30').

Inputs: originId (required), destinationId (required), departureTime.

search_stationB

Search for train and bus stations in Germany by name

Inputs: query (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 5 tools

    Disambiguation4/5

    Tools are mostly distinct: arrivals vs departures clearly differentiated by direction, disruptions and station search are unique. Only slight potential confusion between arrivals and departures if context is unclear, but descriptions resolve it.

    Naming Consistency5/5

    All tool names follow a consistent `verb_noun` pattern: `get_arrivals`, `get_departures`, `get_disruptions`, `search_journeys`, `search_station`. No mixing of conventions or irregular verbs.

    Tool Count5/5

    Five tools is well-scoped for a public transport information server. Each tool covers a distinct user need (arrivals, departures, disruptions, journey planning, station lookup) without unnecessary duplication.

    Completeness4/5

    Core operations are covered: station search, live arrivals/departures, disruptions, and journey planning. A minor gap is the lack of a tool to retrieve details for a specific journey (e.g., intermediate stops), but the surface is largely complete for typical use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers