Used for data validation and serialization of MVG incident data, ensuring proper structure and type consistency of transport disruption information.
MVG Störung MCP Server
A Model Context Protocol (MCP) server that provides cached access to Munich Public Transport (MVG) disruption data.
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
Usage
Running the Server
Available Tools
- get_mvg_incidents: Get current MVG incidents (cached for 10+ minutes)
- Optional parameter:
force_refresh
(boolean) - Force refresh cache even if not expired
- Optional parameter:
- get_cache_status: Get information about the cache status
- 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')
- Required parameter:
Available Resources
- mvg://incidents: Current incidents from Munich Public Transport (MVG)
- mvg://cache-info: Information about the current cache status
Example Usage
Get All Current Incidents
Search for U6 Line Issues
Force Cache Refresh
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 titledescription
: Detailed descriptiontype
: Always "INCIDENT"publication
: Publication timestamp (Unix milliseconds)publication_readable
: Human-readable publication timevalidFrom
/validTo
: Validity periodvalidFrom_readable
/validTo_readable
: Human-readable validity timeslines
: Affected transport lines with detailsprovider
: 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
Dependencies
mcp>=1.0.0
: Model Context Protocol frameworkhttpx>=0.25.0
: Async HTTP clientpydantic>=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.
This server cannot be installed
A Model Context Protocol (MCP) server that provides cached access to Munich Public Transport (MVG) disruption data.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that optimizes token usage by caching data during language model interactions, compatible with any language model and MCP client.Last updated -42JavaScript
- -securityAlicense-qualityThis server implements the Model Context Protocol (MCP) to handle asynchronous tasks with real-time status tracking, robust error handling, and automatic resource management.Last updated -21JavaScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that interacts with system APIs, allowing users to check connections, search employees, register breakfast, and update chemical information by shifts.Last updated -219JavaScript
- AsecurityAlicenseAqualityModel Context Protocol (MCP) server that provides weather forecast, warnings, water level associated with flood, and earthquake reports from Malaysia Government's Open API.Last updated -41PythonMIT License