@flo-thereal/interrail-mcp-server
v2.1.0
Published
MCP server for Interrail/Eurail timetable search, pass pricing, and reservation checks
Maintainers
Readme
Interrail MCP Server
An MCP server for planning Interrail/Eurail trips with AI assistants. It wraps the same timetable backend used by interrail.com/timetable and adds pass pricing, reservation checks, and currency conversion.
Disclaimer: This is an unofficial client for the Eurail timetable API. It is not affiliated with or endorsed by Eurail/Interrail. Use at your own discretion.
Features
- Live timetable search across Europe via the official Interrail timetable backend
- Reservation intelligence — knows which trains (TGV, Eurostar, Nightjet, Frecciarossa, ...) need seat reservations with an Interrail pass and what they cost
- Pass pricing for all 2026-season pass types, with youth/senior discounts
- Currency conversion for 14+ European currencies with live rates and 1-hour caching
- Robust by design — 30s timeouts with friendly errors, fully tested offline (89 tests, ~99% line coverage), plus a weekly live-API probe in CI
Tools
| Tool | Description |
|------|-------------|
| search_stations | Search European stations and get UIC IDs |
| find_journeys | Find train connections between two stations |
| check_pass_validity | Check reservation requirements and estimated costs per leg |
| get_pass_pricing | Look up Interrail pass prices by age and class |
| convert_currency | Convert amounts between European currencies |
See TOOLS_SPEC.md for detailed schemas and behavior.
Install
npm install -g @flo-thereal/interrail-mcp-serverOr run without installing:
npx -y @flo-thereal/interrail-mcp-serverRequires Node.js 20+.
MCP configuration
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"interrail": {
"command": "npx",
"args": ["-y", "@flo-thereal/interrail-mcp-server"]
}
}
}Claude Code
Add to .mcp.json:
{
"mcpServers": {
"interrail": {
"command": "npx",
"args": ["-y", "@flo-thereal/interrail-mcp-server"]
}
}
}OpenCode
Add to opencode.json:
{
"mcp": {
"interrail": {
"type": "local",
"command": ["npx", "-y", "@flo-thereal/interrail-mcp-server"],
"enabled": true
}
}
}Example prompts
Once connected, just ask your AI assistant things like:
- "Find trains from Paris to Stuttgart next Tuesday morning and tell me if I need seat reservations with my Interrail pass."
- "I'm 26 — how much is a 7-day Interrail pass, and is 1st class worth it?"
- "Plan a night-train leg from Vienna to Venice and estimate the couchette supplement."
- "Convert 2,400 CZK to EUR."
Typical workflow
search_stations— resolve city/station names to UIC IDsfind_journeys— get connection options with times and train namescheck_pass_validity— see which legs need reservations and estimated costsget_pass_pricing— compare pass options for your age/classconvert_currency— budget in local currencies
Development
git clone https://github.com/flo-thereal/interrail-mcp-server.git
cd interrail-mcp-server
npm install
npm run build
npm start| Command | What it does |
|---|---|
| npm run lint | Typecheck src/ and tests/ (no emit) |
| npm run build | Compile src/ to dist/ |
| npm test | Run the test suite (offline, mocked network) |
| npm run test:coverage | Tests + coverage report (enforced thresholds) |
| npm run probe | Smoke-test the real upstream APIs (needs npm run build first) |
Project structure
src/
stdio-server.ts entry point (stdio transport)
mcp-server.ts tool definitions + request handlers
eurail-client.ts HTTP client for the Eurail timetable API
formatting.ts API response → tool output shaping
reservations.ts reservation/supplement rules per train type
pricing.ts 2026-season Interrail pass price table
currency.ts exchange-rate fetching, caching, conversion
tests/
unit/ pure-logic tests (mocked fetch)
integration/ end-to-end MCP protocol tests (in-memory transport)
fixtures/ recorded-style API payloads
scripts/
probe-live-api.mjs live upstream smoke testTesting philosophy
The suite runs fully offline: all HTTP is stubbed, and the integration tests speak real MCP to the server over the SDK's in-memory transport — no processes spawned. Because the upstream Eurail API is unofficial and can change without notice, a weekly GitHub Action probes the live APIs and fails loudly (email notification) if their shape changes.
Releasing
Releases are published to npm by GitHub Actions via trusted publishing (OIDC — no long-lived npm tokens).
One-time setup: on the
package access page,
add GitHub Actions as a trusted publisher for the
flo-thereal/interrail-mcp-server repository with workflow filename
publish.yml (the filename must match exactly).
To release: bump version in package.json, create a GitHub release with a
matching vX.Y.Z tag, and the publish workflow
runs lint + tests and publishes with provenance.
License
MIT
