What it is
Rail data is global, fragmented and uneven; an itinerary that hides that is worse than none. Junction plans on Transitous, falls back to Switzerland’s opendata transport service when Transitous fails or finds no rail itinerary, and annotates every result with the things a traveller actually gets hurt by: tight changes, station switches, feed seams, non-rail bridges, last trains, likely reservations. Times are station-local, always.
Plans and multi-leg chains render to PDF (A4, by day), Markdown or calendar files, stored in R2 behind 7-day signed links. The same Worker serves four kinds of caller — the /app web UI, REST at /v1/*, a single-file Node CLI, and agents over streamable-HTTP MCP with seven tools (geocode, plan, chain, render, coverage, horizon, verify_leg) — and verify_leg reports the state of each operator source as it is, including “not configured” and “unavailable,” because a coverage map that flatters itself is useless.
Code
src/index.ts — the KV cache wrapper (exact):
function kvCache(kv: KVNamespace): Cache {
return {
get: (k) => kv.get(k),
// KV refuses an expirationTtl under 60 s.
put: (k, v, ttl) => kv.put(k, v, { expirationTtl: Math.max(60, ttl) }),
};
}
Achievements
- At Phase 3 per its README, deployed from
mainthrough Cloudflare Workers Builds, with its own Muse connector built and verified live (geocoding Nice-Ville as the smoke test). - Four surfaces, one core — the 83 KB single-file
junction.mjsis the engine and the CLI, so behaviour can’t drift between them. - Honest-status verification: source-by-source states (Swiss timetable working; SNCF source not configured; ViaggiaTreno unavailable behind a 403 on 2026-11-08) are recorded in the README rather than smoothed over.
Lessons
- Say where the feed is missing. In travel data, the most valuable output is often the boundary of what can be known.
- One engine, many doors. Wrapping a single core for humans, scripts and agents costs less than three implementations and never disagrees with itself.
Visit: junction.svennyberg.workers.dev — behind Cloudflare Access. Access is granted on request: the sign-in page asks who you are and what you’d like to do, and I approve requests personally, a day at a time. Internal details available on request, by correspondence.
Status: Active · TypeScript, Cloudflare Workers, KV, R2, MCP, Transitous/MOTIS