mcpField
U
Unoffiicial Mvg Public Transport Incidents Mcp Server (munich/germany)

Unoffiicial Mvg Public Transport Incidents Mcp Server (munich/germany)

Local
github.com/rmorizMaps & Travel0Updated 69w ago

About Unoffiicial Mvg Public Transport Incidents Mcp Server (munich/germany)

MVG Störung is an MCP server that provides incident data for Munich’s U-Bahn, Tram, and Bus services. It fetches data from the official MVG API, caches results, and supports searches by line, title, or description.

Key features

  1. 01Retrieve current transit incidents
  2. 02Cache data for at least 10 minutes
  3. 03Search by line, title, or description
  4. 04Expose cache status and resources

Use cases

  1. 01Check current Munich transit incidents
  2. 02Find disruptions affecting a specific line
  3. 03Inspect cache status or refresh data manually

MCP support

The MCP server exposes current incidents and cache information to compatible clients, with tools for retrieval, search, and cache management.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mvg_stoerung_mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/rmoriz/mvg_stoerung_mcp:latest"
]
}
}
}
Run commanddocker run -i --rm ghcr.io/rmoriz/mvg_stoerung_mcp:latest

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocighcr.io/rmoriz/mvg_stoerung_mcp:latest

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MVG Störung MCP Server

A Model Context Protocol (MCP) server that provides cached access to Munich Public Transport (MVG) disruption data.

grafik

Features

  • Cached Data: Automatically caches MVG incident data for at least 10 minutes to reduce API calls
  • Real-time Incidents: Fetches current incidents from the official MVG API
  • Search Functionality: Search incidents by line, title, or description
  • Enhanced Data: Adds human-readable timestamps and formats data for easy consumption
  • MCP Compatible: Works with any MCP-compatible client

Data Source

This server uses the official MVG API endpoint: https://www.mvg.de/api/bgw-pt/v3/messages

The server filters the API response to only return incidents (type=INCIDENT) and enhances the data with:

  • Human-readable timestamps
  • Formatted descriptions
  • Deduplicated line information

Installation

# Install dependencies
pip install -r requirements.txt

# Or install as a package
pip install -e .

Usage

Running the Server
python mvg_mcp_server.py
Available Tools
  1. get_mvg_incidents: Get current MVG incidents (cached for 10+ minutes)

    • Optional parameter: force_refresh (boolean) - Force refresh cache even if not expired
  2. get_cache_status: Get information about the cache status

  3. search_incidents: Search incidents by line, title, or description

    • Required parameter: query (string) - Search query
    • Optional parameter: line (string) - Filter by specific line (e.g., 'U6', 'S1')
Available Resources
  1. mvg://incidents: Current incidents from Munich Public Transport (MVG)
  2. mvg://cache-info: Information about the current cache status

Example Usage

Get All Current Incidents
{
  "method": "tools/call",
  "params": {
    "name": "get_mvg_incidents"
  }
}
Search for U6 Line Issues
{
  "method": "tools/call",
  "params": {
    "name": "search_incidents",
    "arguments": {
      "query": "verspätung",
      "line": "U6"
    }
  }
}
Force Cache Refresh
{
  "method": "tools/call",
  "params": {
    "name": "get_mvg_incidents",
    "arguments": {
      "force_refresh": true
    }
  }
}

Cache Behavior

  • Cache Duration: 10 minutes minimum (configurable)
  • Automatic Refresh: Cache is automatically refreshed when expired
  • Force Refresh: Can be manually triggered via the force_refresh parameter
  • Cache Info: View cache status including expiration time and cached item count

Data Format

Each incident includes:

  • title: Incident title
  • description: Detailed description
  • type: Always "INCIDENT"
  • publication: Publication timestamp (Unix milliseconds)
  • publication_readable: Human-readable publication time
  • validFrom/validTo: Validity period
  • validFrom_readable/validTo_readable: Human-readable validity times
  • lines: Affected transport lines with details
  • provider: Always "MVG"

Error Handling

The server handles various error conditions:

  • API timeouts and connection errors
  • Invalid JSON responses
  • Cache expiration
  • Missing or malformed data

Development

Project Structure
├── mvg_mcp_server.py    # Main MCP server implementation
├── requirements.txt     # Python dependencies
├── pyproject.toml      # Project configuration
└── README.md           # This file
Dependencies
  • mcp>=1.0.0: Model Context Protocol framework
  • httpx>=0.25.0: Async HTTP client
  • pydantic>=2.0.0: Data validation and serialization

License

This project is dedicated to the public domain under the CC0 1.0 Universal license. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Disclaimer

This project is not an official MVG project, not endorsed or recommended. Please ask MVG for permission prior to using it.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.