Skip to main content
Glama
README.md
# geg-gastro

[![Release](https://img.shields.io/github/v/release/udondan/geg-gastro?filter=geg-gastro-v*&label=release)](https://github.com/udondan/geg-gastro/releases/latest)
[![Docker](https://img.shields.io/docker/v/udondan/geg-gastro?sort=semver&label=docker)](https://hub.docker.com/r/udondan/geg-gastro)
[![udondan/geg-gastro MCP server](https://glama.ai/mcp/servers/udondan/geg-gastro/badges/score.svg)](https://glama.ai/mcp/servers/udondan/geg-gastro)
[![CI](https://github.com/udondan/geg-gastro/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/udondan/geg-gastro/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/udondan/geg-gastro/graph/badge.svg)](https://codecov.io/gh/udondan/geg-gastro)
[![Maintainability](https://qlty.sh/gh/udondan/projects/geg-gastro/maintainability.svg)](https://qlty.sh/gh/udondan/projects/geg-gastro)
[![License](https://img.shields.io/github/license/udondan/geg-gastro)](https://github.com/udondan/geg-gastro/blob/main/LICENSE)

> [!NOTE]
> Unofficial community project. Not affiliated with, endorsed or authorized by
> GEG Gastro Service GmbH or schulmenueplaner.de.

CLI and MCP server for school meal orders on the
[GEG Gastro ordering portal](https://www.bestellung-geggastro.de): the menu,
orders, balance, invoices, children and standing orders of an account.

## Contents

- [Installation](#installation)
- [Set up](#set-up)
- [Usage](#usage)
- [MCP server](#mcp-server)
- [Configuration](#configuration)
- [Crates](#crates)
- [Versioning](#versioning)
- [Disclaimer](#disclaimer)

## Installation

```sh
brew install udondan/software/geg-gastro   # macOS and Linux
cargo install geg-gastro                   # from source
docker pull udondan/geg-gastro             # see Docker below
```

The [releases](https://github.com/udondan/geg-gastro/releases) also have
binaries for Linux (x86_64, aarch64, static), macOS and Windows.
`SHA256SUMS.txt` lists their checksums and is signed with the GPG key
`F111A9BDD62F384A`:

```sh
gpg --verify SHA256SUMS.txt.asc SHA256SUMS.txt
sha256sum --check --ignore-missing SHA256SUMS.txt
```

The Docker image is signed with cosign by the release workflow:

```sh
cosign verify udondan/geg-gastro \
  --certificate-identity-regexp '^https://github.com/udondan/geg-gastro/' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
```

## Set up

`geg-gastro` logs in to the portal with the username and password of your
account. Store them once:

```sh
geg-gastro login
```

It asks for the username and the password, logs in with them and only then
stores the password in the keychain of the system (macOS Keychain, Windows
Credential Manager, Secret Service on Linux) and the username in the
configuration file. `geg-gastro login --check` checks the login in effect,
and `geg-gastro logout` removes the password from the keychain.

Without a keychain, as in Docker or CI, set `GEG_GASTRO_USERNAME` and
`GEG_GASTRO_PASSWORD` instead; they take precedence over the keychain.
Without a login, `geg-gastro` sends nothing and answers
`credentials_missing`.

Shell completion, loaded when the shell starts (bash shown; `zsh`, `fish`,
`elvish` and `powershell` work the same way):

```sh
source <(geg-gastro completion bash)
```

## Usage

The examples show the synthetic account of
[`geg-gastro-sim`](https://github.com/udondan/geg-gastro/tree/main/crates/geg-gastro-sim).

```console
$ geg-gastro account
Balance: 63.00 EUR

Muster, Max (number 11111)
  Grundschule Am Park, Igel
  active since: 2024-08-01
  birthday: 2018-03-14
…

$ geg-gastro menu --date 2026-12-02 --child Mia
Week 2026-W49, from Mon 2026-11-30

Muster, Mia, Gesamtschule Nord, 6b
  Wed 2026-12-02
    * Veggie: Kartoffelpuffer mit Apfelmus [ordered, cancel until 2026-12-02 08:00]
    - Zertifiziert: Rindergulasch mit Nudeln [Pro Tag ist nur ein Menü bestellbar.]
    - Salatteller: Griechischer Salat mit Fladenbrot [Pro Tag ist nur ein Menü bestellbar.]
    - Dessert: Schokoladenpudding [comes with the meal]

Weeks: 2026-W49, 2026-W50, 2026-W51, 2026-W52, 2026-W53

$ geg-gastro ledger --from 2026-11-24
Balance: 63.00 EUR
Bookings from 2026-11-24 to 2026-11-30
  2026-11-27 08:15     -3.50 EUR  Veggie, 27.11.2026, Max Muster
  2026-11-26 08:15     -4.20 EUR  Veggie, 26.11.2026, Mia Muster
…
```

| Command | Does |
| --- | --- |
| `login [--username U] [--check]` | Stores the login in the keychain, after checking it |
| `logout` | Removes the password from the keychain |
| `account` | The balance and the children |
| `menu [--week W] [--date D] [--child C]` | The menu of a week, with what is ordered and the deadlines |
| `orders [--from D] [--to D] [--child C]` | The ordered meals, by default from today for 30 days |
| `ledger [--from D] [--to D]` | The bookings of the balance, by default of the last 30 days |
| `invoices list` | The invoices, newest first |
| `invoices download <name> [--file F] [--force]` | Saves the PDF document of an invoice |
| `subscription` | The standing orders of the children (read only) |
| `order <day> <line> --child C [--yes]` | Orders a meal, which costs its price |
| `cancel <day> --child C [--yes] [--final]` | Cancels the meal of a child on a day, which refunds it |
| `config show\|path\|get\|set\|unset` | The configuration file |
| `mcp [--http [ADDR]]` | The MCP server |
| `completion <shell>` | The completion script |

- **Children** are given by their number or a part of their name, like
  `--child Mia`. A name that fits several children gives `ambiguous_child`
  with the candidates, never a guess.
- **Days** are like `2026-12-01`, **weeks** are ISO weeks like `2026-W50`.
  Without `--week`, `menu` shows the first week the portal offers; it lists
  the others at the end. Days and times are those of the portal, in
  Europe/Berlin.
- `invoices download` never replaces an existing file without `--force`.
- `order` and `cancel` ask before they change anything; without a terminal
  they need `--yes`. `order` takes the menu line by its name or a part of
  it, like `veggie`, and checks the menu first: a child gets one meal a
  day, and only before the deadline. To change a meal, cancel it first.
  After the order deadline a cancelled meal cannot be ordered again, so
  `cancel` then needs `--final`.

```console
$ geg-gastro order 2026-12-02 veggie --child Max --yes
Ordered Veggie for Muster, Max on Wed 2026-12-02: Kartoffelpuffer mit Apfelmus
Balance: 59.50 EUR (-3.50 EUR)
```

### Output

`-o text|json|yaml` chooses the format. JSON is the default when stdout is
not a terminal, so scripts get JSON without asking. Amounts come as cents
and as text, like `6300` and `"63.00 EUR"`. Errors are printed in the same
format on stderr, with a stable `status`, and the exit code is 1:

| `status` | Meaning |
| --- | --- |
| `credentials_missing` | No username or password; nothing was sent |
| `keychain_error` | The keychain of the system could not be read or written |
| `login_failed` | The portal rejected the username or password |
| `session_expired` | The session ended and logging in again did not help |
| `ambiguous_child` | The name fits several children; see `candidates` |
| `unknown_child` | No child has that name or number |
| `not_found` | The portal does not have the week or invoice |
| `unknown_menu` | No orderable menu line on that day fits the name; see `candidates` |
| `no_menu` | Nothing can be ordered on that day, like a weekend or a holiday |
| `day_already_ordered` | The child has a meal on that day already |
| `deadline_passed` | The deadline to order or cancel has passed |
| `final_cancel_requires_confirmation` | The meal cannot be ordered again once cancelled; confirm with `--final` (MCP: `allow_final`) |
| `not_ordered` | The child has no meal on that day to cancel |
| `portal_error` | The portal refused the order or cancellation, with its reason |
| `invalid_input` | A day, week or child could not be read (the CLI reports these as usage errors), or a change was not confirmed |
| `unavailable`, `timeout` | The portal did not answer, or failed |
| `unexpected_page` | The portal sent a page `geg-gastro` cannot read; it may have changed |
| `config_error` | The configuration file or a setting is invalid |
| `error` | Anything else, like a file that cannot be written |

`-v` and `-vv` log the requests to stderr. The log never holds the password,
the cookies or the CSRF token.

## MCP server

`geg-gastro mcp` serves eight tools to an MCP client on stdin and stdout:
six that read, and two that order and cancel meals. Each has an output
schema and returns a one-line summary followed by the same JSON as the CLI.
`geg_order` and `geg_cancel` are marked as destructive, so that clients ask
before calling them, and the instructions of the server tell the model to
ask the user first.

| Tool | Returns |
| --- | --- |
| `geg_account` | The balance and the children |
| `geg_menu` | The menu of a week or day, with what is ordered and the deadlines |
| `geg_orders` | The ordered meals in a period |
| `geg_ledger` | The bookings of the balance in a period |
| `geg_invoices` | The invoices |
| `geg_subscription` | The standing orders of the children |
| `geg_order` | Orders a meal, and returns the change of the balance |
| `geg_cancel` | Cancels a meal; `allow_final` for one that cannot be ordered again |

With the login in the keychain, for example in Claude Code:

```sh
claude mcp add geg-gastro -- geg-gastro mcp
```

Or with the login in the environment, in the configuration of another
client:

```json
{
  "mcpServers": {
    "geg-gastro": {
      "command": "geg-gastro",
      "args": ["mcp"],
      "env": {
        "GEG_GASTRO_USERNAME": "you@example.org",
        "GEG_GASTRO_PASSWORD": "…"
      }
    }
  }
}
```

Without a login the server starts, and every tool answers
`credentials_missing`. The server tells the model that menu descriptions and
other texts from the portal are data, not instructions.

Agents that use the CLI instead can load the skill in
[skills/geg-gastro/SKILL.md](https://github.com/udondan/geg-gastro/blob/main/skills/geg-gastro/SKILL.md).

### HTTP

`geg-gastro mcp --http` serves streamable HTTP at `http://127.0.0.1:8080/mcp`;
`--http 0.0.0.0:9000` takes another address. It needs a bearer token of at
least 16 characters in `GEG_GASTRO_MCP_TOKEN`, which every request must send
as `Authorization: Bearer <token>`:

```sh
export GEG_GASTRO_MCP_TOKEN=$(openssl rand -hex 32)
geg-gastro mcp --http
claude mcp add --transport http geg-gastro http://127.0.0.1:8080/mcp \
  --header "Authorization: Bearer $GEG_GASTRO_MCP_TOKEN"
```

All sessions share one login to the portal. The server shuts down cleanly on
SIGINT and SIGTERM. It serves plain HTTP; put a TLS proxy in front of it to
reach it over a network.

### Docker

The image runs `geg-gastro`; without a command it starts the MCP server on
stdio. It has no keychain, so the login comes from the environment:

```sh
docker run --rm -i -e GEG_GASTRO_USERNAME -e GEG_GASTRO_PASSWORD udondan/geg-gastro
```

The image is listed in the
[MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.udondan/geg-gastro)
as `io.github.udondan/geg-gastro`; clients that install servers from there
run this image and ask for `GEG_GASTRO_USERNAME` and `GEG_GASTRO_PASSWORD`.

`mise run docker-build` builds the image from source. For the Docker MCP
Toolkit, `mise run docker` builds it and adds
[docker-mcp.yml](https://github.com/udondan/geg-gastro/blob/main/docker-mcp.yml)
to the profile `geg-gastro`. Set the secrets `geg-gastro.username` and
`geg-gastro.password` with `docker mcp secret set`.

## Configuration

`geg-gastro config path` shows the file, by default
`~/.config/geg-gastro/config.toml` (`%APPDATA%` on Windows).
`geg-gastro config show` shows the settings in effect. The password is never
in the file.

| Setting | Default | Meaning |
| --- | --- | --- |
| `username` | – | The username of the portal; `login` sets it |
| `base_url` | `https://www.bestellung-geggastro.de` | Another address of the portal |
| `timeout_seconds` | 20 | How long to wait for an answer |

| Variable | Does |
| --- | --- |
| `GEG_GASTRO_USERNAME` | Overrides `username` |
| `GEG_GASTRO_PASSWORD` | The password, instead of the keychain |
| `GEG_GASTRO_BASE_URL` | Overrides `base_url` |
| `GEG_GASTRO_CONFIG` | Another configuration file |
| `GEG_GASTRO_OUTPUT` | The output format, like `-o` |
| `GEG_GASTRO_LOG`, `GEG_GASTRO_LOG_FILE` | Log level, like `debug`, and a log file |
| `GEG_GASTRO_MCP_TOKEN` | The bearer token of `mcp --http` |
| `GEG_GASTRO_NOW` | Act as if it were another time, as RFC 3339 like `2026-11-30T07:00:00+01:00`; for tests |

## Crates

| Crate | Description | crates.io | docs.rs |
| --- | --- | --- | --- |
| [`geg-gastro`](https://github.com/udondan/geg-gastro/tree/main/crates/geg-gastro) | The binary: CLI and `geg-gastro mcp` | [![crates.io][geg-gastro-crate-badge]][geg-gastro-crate] | |
| [`geg-gastro-core`](https://github.com/udondan/geg-gastro/tree/main/crates/geg-gastro-core) | Client for the ordering portal: login, the pages, the model, configuration and credentials | [![crates.io][geg-gastro-core-crate-badge]][geg-gastro-core-crate] | [![docs.rs][geg-gastro-core-docs-badge]][geg-gastro-core-docs] |
| [`geg-gastro-sim`](https://github.com/udondan/geg-gastro/tree/main/crates/geg-gastro-sim) | Fake ordering portal for tests, with synthetic data and injected failures | [![crates.io][geg-gastro-sim-crate-badge]][geg-gastro-sim-crate] | [![docs.rs][geg-gastro-sim-docs-badge]][geg-gastro-sim-docs] |

[geg-gastro-crate-badge]: https://img.shields.io/crates/v/geg-gastro?label=
[geg-gastro-crate]: https://crates.io/crates/geg-gastro
[geg-gastro-core-crate-badge]: https://img.shields.io/crates/v/geg-gastro-core?label=
[geg-gastro-core-crate]: https://crates.io/crates/geg-gastro-core
[geg-gastro-core-docs-badge]: https://img.shields.io/docsrs/geg-gastro-core?label=
[geg-gastro-core-docs]: https://docs.rs/geg-gastro-core
[geg-gastro-sim-crate-badge]: https://img.shields.io/crates/v/geg-gastro-sim?label=
[geg-gastro-sim-crate]: https://crates.io/crates/geg-gastro-sim
[geg-gastro-sim-docs-badge]: https://img.shields.io/docsrs/geg-gastro-sim?label=
[geg-gastro-sim-docs]: https://docs.rs/geg-gastro-sim

## Versioning

`geg-gastro` follows [Semantic Versioning](https://semver.org) from 1.0.0.
Its public interface is the commands and their options, the MCP tools, the
JSON and YAML output, the error statuses, the settings and the environment
variables. Breaking changes to it come with a new major version only; new
fields in the output can come with any minor version. The text output is
meant for people and can change at any time.

## Disclaimer

This is an unofficial, independent open-source project and is not affiliated
with GEG Gastro Service GmbH or schulmenueplaner.de. GEG Gastro is a name or
trademark of GEG Gastro Service GmbH. The name is used only to describe
compatibility. The portal has no API: `geg-gastro` reads its web pages, which
can change at any time. Use at your own risk and in accordance with the terms of
use of the ordering portal.

## Security and contributing

See [SECURITY.md](https://github.com/udondan/geg-gastro/blob/main/SECURITY.md)
and [CONTRIBUTING.md](https://github.com/udondan/geg-gastro/blob/main/CONTRIBUTING.md).

## License

[MIT](https://github.com/udondan/geg-gastro/blob/main/LICENSE)

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation4/5

Most tools target clearly distinct resources: account, menu, invoices, ledger, subscription. The one risky pair is geg_order (place a meal order) vs geg_orders (list ordered meals), plus geg_cancel which is the inverse of geg_order; descriptions do clarify, but the singular/plural boundary is a real misselection hazard.

Naming Consistency4/5

All tools share a uniform `geg_` prefix and snake_case single-token names, which is highly predictable. The only deviation is that most names are nouns (account, menu, invoices) while cancel/order are verbs, and order/orders differ only by plurality.

Tool Count5/5

Eight tools is well within the sweet spot and each covers a distinct slice of the meal-ordering workflow (view, order, cancel, review history, billing). Nothing appears redundant or padded.

Completeness4/5

The lifecycle is largely covered: view account/menu, order, cancel, list orders, inspect ledger and invoices, read subscription. Gaps exist around money (no top-up/payment tool) and subscription changes are explicitly deferred to the website, and invoice download is only via CLI, but agents can work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues