SuperAPIAI Directory

timetable-api-node

github.com · AI developer platforms

Real-time Lviv (Ukraine) public transport: stop arrivals, live vehicle positions, route geometry and nearby stop discovery.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsAPI

About this tool

Purpose

timetable-api-node is the Node.js version of the lad.lviv.ua API, providing timetable data services for public transport in Lviv (Ukraine). Built on Express, it exposes a read-only REST API and a read-only MCP (Model Context Protocol) endpoint for LLM clients and ordinary HTTP clients to query real-time and static information about public transport such as buses and trams.

Main capabilities

  • Real-time stop arrivals: Query real-time arrival information for a specified stop, with short caching (5–10 seconds).
  • Real-time vehicle positions: Query real-time vehicle positions by route, or query the real-time position and upcoming arrivals of a single vehicle by vehicle ID.
  • Route static data: Retrieve route shapes, stop lists, departure timetables (categorized by weekday, Saturday, Sunday), etc.
  • Nearby stop discovery: Find nearby stops based on latitude and longitude, with a radius parameter (50–3000 meters, default 1000 meters).
  • Transfer planning: Provide direct routes and one-transfer trip options via MCP tools, sorted by number of stops and walking distance.
  • Vehicle lookup by license plate: Find a vehicle ID by license plate number (ignoring case, spaces, and hyphens).
  • MCP resources: In addition to tools, it also exposes MCP resources (such as timetable://route/{name}), with completion support.

Usage

  • Environment requirements: Node.js 26 (see .nvmrc).
  • Data import: Run make import to download static GTFS data and write it to two stores:database/Timetable(LokiJS, containing stops, routes, shapes, first-stop timetables) and database/gtfs(SQLite, containing trips and calendars). Both are gitignored, so a freshly cloned repository must import data first.make import-slim only re-imports the lightweight tables into SQLite.
  • Running: The code is TypeScript and runs directly through Node's built-in type stripping, with no build step required.npm run build only generates mcp/stdio.js(the published bin), because Node does not strip types inside node_modules.
  • MCP endpoint:/mcp, using Streamable HTTP transport, stateless, and tools/call can be invoked without first calling initialize. Requests must set Content-Type: application/json and Accept: application/json, text/event-stream.
  • REST endpoints: Including /stops、/stops.json、/stops/:code、/stops/:code/timetable、/stops/:code/static、/stops/nearby、/routes、/routes/static/:name、/routes/realtime/:name、/vehicle/:vehicleId、/vehicle/by-plate/:plate、/vehicles/nearby , etc.
  • Deployment: The production environment runs on Cloud Run (europe-north1), proxied through Cloudflare. The Dockerfile imports GTFS data at build time.make deploy can be manually built and deployed.
  • npm package:make publish is published to npm and the MCP Registry, containing only the timetable-mcp stdio proxy.

Applicable scenarios

  • Developing applications or websites for Lviv public transport that need real-time arrivals, vehicle positions, and route data.
  • Letting LLM clients (such as Claude, Cursor) query public transport information via the MCP protocol.
  • Scenarios requiring nearby stop discovery or simple transfer planning.

Limitations

  • All tools and endpoints are read-only and do not provide any operations that modify data.
  • Publicly read-only, no authentication required.
  • POST /mcp is rate-limited by IP to 60 requests/minute (in memory, reset on restart), returning HTTP 429 when exceeded.
  • Stop overrides (stopOverrides) are stored only in browser localStorage and are visible only to the browser that made the edits.
  • The upstream route list sometimes lags behind reality, and GET /stops applies stored overrides to correct it.
  • Transfer options are limited to at most one transfer; if both lists are empty, it means two or more transfers are required.
  • Some fields (such as speed, license_plate, next_stop) are null when the data source does not provide them.
  • The production environment uses New Relic APM, which is disabled by default and requires setting NEW_RELIC_LICENSE_KEY to enable.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools