Skip to main content

Mensa MCP Server

An MCP (Model Context Protocol) server for accessing meal plans from Studierendenwerk Vorderpfalz (stw-vp.de).

Features

  • Get meals plans for specific weeks or dates
  • Fetch meal plans for all canteens from Studierendenwerk Vorderpfalz
  • Structured JSON output with meal details (vegan, vegetarian, main dish flags)

Available Canteens

ID Name
310 Landau
311 Landau Bürgerstr.
320 Germersheim
330 Worms
340 Ludwigshafen

Installation

uv sync

Transports

The server supports three transport protocols:

  • stdio (default) — launched as a child process by the MCP client. Best for IDE/editor integration.
  • streamable-http — runs as a long-running HTTP server. Best for remote access or multi-client deployments.
  • sse — runs the legacy HTTP+SSE transport for clients that still require it.

Stdio (default)

Add to your MCP client e.g., opencode.json:

{
  "mcpServers": {
    "mensa": {
      "type": "local",
      "command": ["uv", "run", "mensa-mcp", "--canteen", "330"],
      "cwd": "/Users/boza/git/hswo/zd/mensa-stw-vp"
    }
  }
}

Streamable HTTP

uv run mensa-mcp --transport streamable-http --port 8000

The MCP endpoint is /mcp.

SSE

uv run mensa-mcp --transport sse --port 8000

The default SSE endpoint is /sse, with client messages sent to /messages/.

The --canteen argument sets the default canteen ID. Omit it if you prefer to always specify canteen_id explicitly.

Available Tools

list_canteens

List all available canteens with their IDs and names.

Parameters: none.

Example:

  • list_canteens()

get_weekly_meals

Fetch the weekly meal plan for a canteen.

Parameters:

  • canteen_id (int, optional): ID of the canteen (310, 311, 320, 330, 340). Uses default from command line if not specified.
  • week_number (int, optional): ISO week number (1-53). Defaults to current week.

Example:

  • get_weekly_meals() # Uses default canteen, current week
  • get_weekly_meals(canteen_id=330) # Current week, Worms
  • get_weekly_meals(canteen_id=330, week_number=25) # Specific week

get_daily_meals

Get meals for a specific date.

Parameters:

  • date (string, optional): Date in ISO format YYYY-MM-DD (e.g., "2026-06-11"). If omitted, uses today.
  • canteen_id (int, optional): Canteen ID. Uses default from command line if not specified.

Example:

  • get_daily_meals() # Today's meals, default canteen
  • get_daily_meals(date="2026-06-11") # Specific date, default canteen
  • get_daily_meals(canteen_id=340) # Today, Ludwigshafen
  • get_daily_meals(date="2026-06-11", canteen_id=340) # Both specified

Development

# Install dependencies (including dev/test extras)
uv sync --extra dev

# Run tests
uv run pytest tests/ -v

# Run server in stdio mode (for MCP integration)
uv run mensa-mcp --canteen 330

# Run server with HTTP transport
uv run mensa-mcp --transport streamable-http --port 8000

Validation

  • canteen_id must be one of the known IDs (310, 311, 320, 330, 340).
  • week_number must be an ISO week number between 1 and 53. Out-of-range values are rejected with a clear error at both the server and scraper layers.
  • date must be in YYYY-MM-DD format.
  • Dates outside the currently-served week return an empty meal list with a note explaining the date is out of range.

2026 Hochschule Worms, Zentrum für Digitalisierung.

Metadata

Release files for mensa-stw-vp-mcp 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mensa-stw-vp-mcp 0.3.1
File Size Uploaded Provenance Actions
mensa_stw_vp_mcp-0.3.1.tar.gz 83.4 kB Without provenance Details for mensa_stw_vp_mcp-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mensa-stw-vp-mcp 0.3.1
File Interpreter ABI Platform Actions
mensa_stw_vp_mcp-0.3.1-py3-none-any.whl Python 3 none any Details for mensa_stw_vp_mcp-0.3.1-py3-none-any.whl

Total release size: 92.8 kB

Release files / mensa_stw_vp_mcp-0.3.1.tar.gz

Download URL mensa_stw_vp_mcp-0.3.1.tar.gz
Size 83.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e5f5fd23b582949b70b3c32d21133fa27c81d8abe90eaf070f050ae71e792a
BLAKE2b-256 checksum
How to use checksums
284bdb91fc8b2b73dbf7a1a8bb53e2ca7ebd975b10015536aa41eabd9c7e1cce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mensa_stw_vp_mcp-0.3.1-py3-none-any.whl

Download URL mensa_stw_vp_mcp-0.3.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f72bf7213e94412f63984b5ae9e27146138da570906dae0263ab309962cfd5bc
BLAKE2b-256 checksum
How to use checksums
267bfcb74ad35f392c1d527e69cf018395d535aad5f763978807b353c2078cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mensa-stw-vp-mcp 0.3.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page