Regiojet MCP
An MCP server that lets AI assistants search, book and cancel RegioJet train and bus tickets.
What is this?
A FastMCP server for the RegioJet Affiliate API. It finds stations, searches connections and shows routes, prices and free seats. If you give it an account token, it can also book tickets, pay for them from your RegioJet credit and cancel them.
Quick Start
Run it from PyPI with uvx. You don't need a checkout.
Claude Code
claude mcp add regiojet -- uvx regiojet-mcp
# with account tools (booking, payment, cancellation):
claude mcp add regiojet -e REGIOJET_API_KEY=<token> -- uvx regiojet-mcp
Other MCP clients (Claude Desktop, Cursor, ...)
{
"mcpServers": {
"regiojet": {
"command": "uvx",
"args": ["regiojet-mcp"],
"env": { "REGIOJET_API_KEY": "<token>" }
}
}
}
Leave out env if you only need the read-only tools.
Standalone
uvx regiojet-mcp # stdio
REGIOJET_MCP_TRANSPORT=http uvx regiojet-mcp # http on 127.0.0.1:8000
Tools
Search and reference data
These tools are read-only and don't need a token.
| Tool | Description |
|---|---|
find_locations |
Resolve city/station names (any language, diacritics optional) to ids |
search_routes |
Connections between two locations on a date, paginated via cursor + page |
get_route_detail |
Sections (lines, platforms, transfers) and price per seat class |
get_free_seats |
Free seats per vehicle and deck for a seat class, with single_seats (free seats without a neighbour, read from the deck layout) |
list_tariffs, list_seat_classes, list_vehicle_standards, list_carriers, list_action_prices |
Reference data (cached) |
get_ticket |
Existing ticket by account code + ticket id |
Account
These tools need REGIOJET_API_KEY.
| Tool | Description |
|---|---|
get_account |
Name, default tariff, credit balance |
list_my_tickets, get_my_ticket |
Tickets on the account, filterable by state |
create_reservation |
Reserve seats (UNPAID until paid, expires at expiration_date) |
pay_ticket_with_credit |
Pay UNPAID tickets from account credit (spends money) |
cancel_ticket |
Cancel a reservation or paid ticket (cancel charges may apply) |
Resources
regiojet://tariffs, regiojet://seat-classes
Booking flow
flowchart LR
A[find_locations] --> B[search_routes]
B --> C[get_route_detail]
C -->|price_source per seat class| D[get_free_seats]
D --> E[create_reservation]
E --> F[pay_ticket_with_credit]
E --> G[cancel_ticket]
F --> G
Configuration
When you run it with uvx, set variables through your MCP client's env. When you run it from a checkout with uv run,
you can put them in a .env file in the server's working directory instead.
| Env var | Default | Notes |
|---|---|---|
REGIOJET_API_KEY |
unset | RegioJet customer account token (sent as Bearer). Enables account tools |
REGIOJET_USER / REGIOJET_PASSWORD |
unset | HTTP Basic auth for affiliate accounts. Ignored when REGIOJET_API_KEY is set |
REGIOJET_BASE_URL |
https://brn-ybus-pubapi.sa.cz/restapi |
|
REGIOJET_LANG |
en |
|
REGIOJET_CURRENCY |
EUR |
|
REGIOJET_TIMEOUT |
20 |
Seconds |
REGIOJET_MCP_TRANSPORT / _HOST / _PORT |
stdio / 127.0.0.1 / 8000 |
Development
uv sync # install with dev dependencies
uv run regiojet-mcp # run from source (stdio)
REGIOJET_MCP_TRANSPORT=http uv run regiojet-mcp # run from source (http)
uv run fastmcp dev inspector server.py # MCP Inspector in the browser
uv run pytest # tests
To use a local checkout in Claude Code:
claude mcp add regiojet -- uv run --directory /path/to/regiojet-mcp regiojet-mcp
Project structure
regiojet-mcp/
├── src/
│ └── regiojet_mcp/
│ ├── __init__.py # entry point, transport selection
│ ├── client.py # async HTTP client for the RegioJet API
│ ├── config.py # settings from environment
│ └── server.py # MCP tools and resources
├── tests/
│ └── test_tools.py
├── fastmcp.json # FastMCP project config
├── LICENCE
├── pyproject.toml
├── server.py # entry point for `fastmcp run` / `fastmcp dev`
└── uv.lock
License
MIT © Petr Václavek
Metadata
Release files for regiojet-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| regiojet_mcp-0.2.0.tar.gz | 14.9 kB | Without provenance | Details for regiojet_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| regiojet_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for regiojet_mcp-0.2.0-py3-none-any.whl |
Total release size: 31.7 kB
Release files / regiojet_mcp-0.2.0.tar.gz
| Download URL | regiojet_mcp-0.2.0.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da15cd888e195a2cbea585521c117d279943d6b17dbde4c84dcf6ea4ad417558
|
|
BLAKE2b-256 checksum How to use checksums |
df3a1c55fcdb6c75bb7f1f0682594fc6cc8eee2bf992c8e060c72d206536be2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / regiojet_mcp-0.2.0-py3-none-any.whl
| Download URL | regiojet_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08b4c5d5da9cd92c2563c9d209972db9a20dd4c2a3578906532b7eb710369e25
|
|
BLAKE2b-256 checksum How to use checksums |
ff03ef40444006f754a3a7cea72c51c9f1f81ed601d28932f254d3f88c0bc547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for regiojet-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.