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 two 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.

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 POST /mcp with Content-Type: application/json and Accept: application/json, text/event-stream. GET / returns a small health check.

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.1.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.1.0
File Size Uploaded
mensa_stw_vp_mcp-0.1.0.tar.gz 100.3 kB Details

Built distribution (wheel)

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

Total release size: 103.1 kB

Release files / mensa_stw_vp_mcp-0.1.0.tar.gz

Download URL mensa_stw_vp_mcp-0.1.0.tar.gz
Size 100.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87c126d4ba2f0c95986f54dc452ec2b7aacd74ebd9f3905bfb8b97f1f577424c
BLAKE2b-256 checksum
How to use checksums
f03892b6531e421662cc4adda97fecbfdc1223f24df528302a2a522d504363d2
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.1.0-py3-none-any.whl

Download URL mensa_stw_vp_mcp-0.1.0-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f055684a74a6c075bfb9c9142d659793425104930e4294ccdac1db6ffd50971b
BLAKE2b-256 checksum
How to use checksums
24dd3deddc0e13c1cb6d17edbf72529795c736e435a2a428e42e655ebe8265e6
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

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

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