Skip to main content

MCP Server for Munich MVG transit API - Query U-Bahn, S-Bahn, Tram, Bus departures

Project description

MCP MVG - Munich Transit MCP Server 🚇

An MCP (Model Context Protocol) server that provides access to Munich's MVG (Münchner Verkehrsgesellschaft) public transit API.

Features

  • 🔍 Search stations - Find U-Bahn, S-Bahn, Tram, and Bus stops by name
  • 🚇 Real-time departures - Get upcoming departures from any station
  • 🗺️ Nearby stops - Find transit stops near GPS coordinates
  • 📋 Line information - Browse all MVG transit lines
  • 🚌 Transport modes - Learn about Munich's transit types

Quick Start

Option 1: Install from PyPI (Recommended)

# Install globally with uvx
uvx mcp-mvg

# Or with pip
pip install mcp-mvg
mcp-mvg

Option 2: Install from GitHub

# Run directly from GitHub with uvx
uvx --from git+https://github.com/your-username/mcp-mvg.git mcp-mvg

Option 3: Local Development

git clone https://github.com/your-username/mcp-mvg.git
cd mcp-mvg
uvx --from . mcp-mvg

MCP Client Configuration

For installed package (PyPI):

{
  "mcpServers": {
    "mvg-transit": {
      "command": "uvx",
      "args": ["mcp-mvg"]
    }
  }
}

From GitHub:

{
  "mcpServers": {
    "mvg-transit": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/your-username/mcp-mvg.git", "mcp-mvg"]
    }
  }
}

With custom API Key:

{
  "mcpServers": {
    "mvg-transit": {
      "command": "uvx",
      "args": ["mcp-mvg"],
      "env": {
        "MVG_API_KEY": "your-custom-mvg-api-key"
      }
    }
  }
}

Environment Variables

Variable Description Default
MVG_API_KEY MVG API Authorization key Uses default public key

Available Tools

Tool Description Example
search_stations Search for stations by name search_stations("Marienplatz")
get_departures Get real-time departures from a station get_departures(global_id, limit=5)
get_lines List all MVG transit lines get_lines()
find_nearby_stops Find stops near GPS coordinates find_nearby_stops(48.1372, 11.5755)
get_transport_modes Get info about transit types get_transport_modes()

Example Queries

  • "What trains are departing from Marienplatz?"
  • "Find the nearest U-Bahn station"
  • "Show me all tram lines in Munich"
  • "What's at Hauptbahnhof right now?"

Publishing to PyPI

If you want to publish your own version:

# 1. Build the package
pip install build
python -m build

# 2. Upload to PyPI
pip install twine
twine upload dist/*

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_mvg-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_mvg-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_mvg-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_mvg-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mcp_mvg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b87bc088e2b284accabc2d33b1db177d7eaf290bf6c45f2824deb16f5f5afe3
MD5 070f94ec1f5e14dfac567ef7f1052e46
BLAKE2b-256 39a2e303af7b98982b0af2a6c3c1fef1b2d3b38ebd5a55c32111d435f025561b

See more details on using hashes here.

File details

Details for the file mcp_mvg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_mvg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mcp_mvg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5862d14830f1aa12f4055564eb1fd54c3143497b83716b569246bd1330cf753c
MD5 abe36792e0de42a8a2d74373eab252bb
BLAKE2b-256 15c497499c019711b74a05a3ce86018f2ed710ebf776a92f301d32b05f300e28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page