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.

Release files for mensa-stw-vp-mcp 0.3.0

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.0
File Size Uploaded
mensa_stw_vp_mcp-0.3.0.tar.gz 83.4 kB Details

Built distribution (wheel)

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

Total release size: 92.9 kB

Release files / mensa_stw_vp_mcp-0.3.0.tar.gz

Download URL mensa_stw_vp_mcp-0.3.0.tar.gz
Size 83.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2c9a95e7082d111d3c8e8c836d5508bbdb98376081dbb713f4bc644935970fcb
BLAKE2b-256 checksum
How to use checksums
270e9413ae3a3467cf94c0d9ac9d37d0e5d3c8fb3621fd21d745dd5615e0ff37
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.0-py3-none-any.whl

Download URL mensa_stw_vp_mcp-0.3.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78c5757dfa74540b42257df9be01ca4a7e5f447668b797f0e17d26b7723659dd
BLAKE2b-256 checksum
How to use checksums
1c1192bf72ce433d20f4e9e72b16de100674ff10b96bb092ef3c819533a7c668
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 history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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