GEG Gastro school meals (unofficial)

v1.2.0
io.github.udondan/geg-gastro Checked 2 days ago Published 4 days ago

Menu, orders, balance and invoices of a GEG Gastro school meal account; orders and cancels meals

CLI and MCP server for school meal orders on the GEG Gastro ordering portal: the menu, orders, balance, invoices, children and standing orders of an account. The 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: The Docker image is signed with cosign by the release workflow:

Summary extracted from the README.

geg-gastro

geg-gastro – School meal orders. CLI & MCP.

Release Docker udondan/geg-gastro MCP server CI codecov Maintainability 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: the menu, orders, balance, invoices, children and standing orders of an account.

Contents

Installation

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 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:

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

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

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:

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 stored session and 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.

Session

geg-gastro keeps the session of the portal in ~/.local/state/geg-gastro/session.json ($XDG_STATE_HOME if set, %LOCALAPPDATA% on Windows), so that the next run does not log in again. The file holds the session cookies, for one username and portal address. Only the owner can read it (mode 0600, the directory 0700); treat it like a password. When the session has ended, geg-gastro logs in once more and stores the new one. A missing or unreadable file only costs a login. GEG_GASTRO_SESSION_FILE takes another file, or off to keep the session in memory only. geg-gastro logout removes the file.

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

source <(geg-gastro completion bash)

Usage

The examples show the synthetic account of geg-gastro-sim.

$ 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 stored session and 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.
$ 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:

claude mcp add geg-gastro -- geg-gastro mcp

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

{
  "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.

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>:

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:

docker run --rm -i -e GEG_GASTRO_USERNAME -e GEG_GASTRO_PASSWORD \
  -v geg-gastro-state:/home/geg-gastro/.local/state/geg-gastro udondan/geg-gastro

The volume keeps the session between containers, so that not every container logs in again; without it, each one does. The image runs as UID 10001, which owns the directory of the volume.

The image is listed in the MCP Registry 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 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_SESSION_FILE Another file for the session, or off
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 The binary: CLI and geg-gastro mcp crates.io
geg-gastro-core Client for the ordering portal: login, the pages, the model, configuration and credentials crates.io docs.rs
geg-gastro-sim Fake ordering portal for tests, with synthetic data and injected failures crates.io docs.rs

Versioning

geg-gastro follows Semantic Versioning 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 and CONTRIBUTING.md.

License

Apache-2.0