Metadata-Version: 2.3
Name: regiojet-mcp
Version: 0.1.1
Summary: MCP server for the RegioJet Affiliate API
Author: Petr Václavek
Author-email: Petr Václavek <petr@vaclavek.cloud>
Requires-Dist: fastmcp
Requires-Dist: httpx
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# regiojet-mcp

MCP server (FastMCP) for the [RegioJet Affiliate API](https://app.swaggerhub.com/apis/regiojet/affiliate/1.1.0).
Read-only: find stations, search connections, inspect routes, prices and free seats.

## Tools

| 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 for a seat class |
| `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 |

Resources: `regiojet://tariffs`, `regiojet://seat-classes`.

## Run

```sh
uv sync
uv run regiojet-mcp                      # stdio
REGIOJET_MCP_TRANSPORT=http uv run regiojet-mcp   # http on 127.0.0.1:8000
uv run fastmcp dev server.py             # MCP Inspector
```

Claude Code:

```sh
claude mcp add regiojet -- uv run --directory /path/to/regiojet-mcp regiojet-mcp
```

## Configuration

| Env var | Default |
|---|---|
| `REGIOJET_BASE_URL` | `https://brn-ybus-pubapi.sa.cz/restapi` |
| `REGIOJET_USER` / `REGIOJET_PASSWORD` | unset (HTTP Basic auth for affiliate accounts) |
| `REGIOJET_LANG` | `en` |
| `REGIOJET_CURRENCY` | `EUR` |
| `REGIOJET_TIMEOUT` | `20` seconds |
| `REGIOJET_MCP_TRANSPORT` / `_HOST` / `_PORT` | `stdio` / `127.0.0.1` / `8000` |

## Tests

```sh
uv run pytest
```
