MCP server for Belgian railway data via the iRail API
Project description
iRail MCP Server
A Model Context Protocol (MCP) server that provides Belgian railway travel information via the iRail API.
Features
- Search Stations - Find Belgian railway stations by name
- Live Departures/Arrivals - Real-time departure and arrival boards
- Find Connections - Route planning between stations with transfers
- Train Information - Detailed stops, delays, and platforms for a specific train
- Network Disturbances - Current disruptions and planned maintenance
Installation
Requires Python 3.11+ and uv.
git clone https://github.com/HansF/irail-mcp.git
cd irail-mcp
uv venv && source .venv/bin/activate
uv pip install -e .
Usage with Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"irail": {
"command": "uv",
"args": ["run", "--directory", "/path/to/irail-mcp", "python", "-m", "irail_mcp.server"]
}
}
}
Then ask Claude things like:
- "What trains leave Brussels Central in the next hour?"
- "Find a route from Antwerp to Bruges at 2:30 PM tomorrow"
- "Are there any disruptions on the Belgian rail network?"
- "Show me details for train IC2240"
Tools
search_stations
Search for stations by name.
query(required) - Station name or partial namelang(optional) - Language: en, nl, fr, de, it
get_liveboard
Real-time departures or arrivals from a station.
station(required) - Station namedate(optional) - YYYY-MM-DD, "today", "tomorrow", "+2 days"time(optional) - HH:MM (24h)arrival(optional) - Show arrivals instead of departureslang(optional)
find_connections
Find routes between two stations.
from_station(required) - Departure stationto_station(required) - Destination stationdate,time,lang(optional)arrival_time(optional) - If true, time is desired arrival time
get_train_info
Detailed information about a specific train.
train_id(required) - e.g. "IC1234" or "BE.NMBS.IC1234"date,lang(optional)
get_disturbances
Current network disruptions and planned works.
lang(optional)
Running Tests
uv pip install -e ".[dev]"
python -m pytest tests/ -v
API Compliance
- Rate limited to 3 requests/second per iRail guidelines
- Proper User-Agent header set
- 30-second timeout for slow responses
License
MIT
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file irail_mcp-0.1.0.tar.gz.
File metadata
- Download URL: irail_mcp-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63c4d9d5df780581ddc37877e842fd7b5a98aaa97c8d906cdf998e9fbf0516c1
|
|
| MD5 |
5cbc3ec8e3424be096b0df81151aadcc
|
|
| BLAKE2b-256 |
78656a7d6930bae6e3ea34d6f6449691781f52924ebf07f7b33aa9664a2f79a0
|
Provenance
The following attestation bundles were made for irail_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on HansF/irail-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irail_mcp-0.1.0.tar.gz -
Subject digest:
63c4d9d5df780581ddc37877e842fd7b5a98aaa97c8d906cdf998e9fbf0516c1 - Sigstore transparency entry: 926961412
- Sigstore integration time:
-
Permalink:
HansF/irail-mcp@eff98012d01eff3586e32f7b745496707358cb70 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HansF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eff98012d01eff3586e32f7b745496707358cb70 -
Trigger Event:
release
-
Statement type:
File details
Details for the file irail_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: irail_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d73fb70623911b4d04320d5f16bd5c624c5eccc99c6489d291b66307a7a41e3
|
|
| MD5 |
5ae44412fde1285d71c3172e8df03cc1
|
|
| BLAKE2b-256 |
19e138f3ab22f11b934192b413a7c06166b7b97f7572204ed56b110bccddd4cd
|
Provenance
The following attestation bundles were made for irail_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on HansF/irail-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irail_mcp-0.1.0-py3-none-any.whl -
Subject digest:
2d73fb70623911b4d04320d5f16bd5c624c5eccc99c6489d291b66307a7a41e3 - Sigstore transparency entry: 926961413
- Sigstore integration time:
-
Permalink:
HansF/irail-mcp@eff98012d01eff3586e32f7b745496707358cb70 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HansF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eff98012d01eff3586e32f7b745496707358cb70 -
Trigger Event:
release
-
Statement type: