Get the FREE Ultimate OpenClaw Setup Guide →

mcp -public-transport

MCP server from mirodn/mcp-server-public-transport

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mirodn-mcp-server-public-transport uv --directory /ABSOLUTE/PATH/TO/mcp-server-public-transport run server.py \
  --env UK_TRANSPORT_APP_ID="your-uk-app-id" \
  --env UK_TRANSPORT_API_KEY="your-uk-api-key"

How to use

mcp-server-public-transport is a Python-based MCP server that aggregates real-time public transport data across Europe from multiple providers (UK, Switzerland, Belgium, and Norway). It exposes endpoints and a standard MCP interface so clients can query live departures, connections, locations, and other transit data through a consistent API surface. Use the included tools to run the server locally, manage environment variables for API access, and interact with the MCP endpoints to integrate transit information into downstream apps or dashboards.

How to install

Prerequisites:

  • Python 3.8+ and the uv tool (as described in the repository).
  • Network access to install dependencies and access external transit APIs.

Steps:

  1. Clone the repository
git clone https://github.com/mirodn/mcp-server-public-transport.git
cd mcp-server-public-transport
  1. Install dependencies and run the setup for the Python environment
uv sync
  1. Configure environment variables Create a .env file or export variables in your environment. Example:
# .env
UK_TRANSPORT_APP_ID=your-uk-app-id
UK_TRANSPORT_API_KEY=your-uk-api-key

Or set them directly in your shell for a session:

export UK_TRANSPORT_APP_ID=your-uk-app-id
export UK_TRANSPORT_API_KEY=your-uk-api-key
  1. Run the server
uv run server.py
  1. Optional: Integrate with Claude Desktop configuration (if you use Claude integration)
{
  "mcpServers": {
    "mcp-server-public-transport": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/mcp-server-public-transport",
        "run",
        "server.py"
      ],
      "env": {
        "UK_TRANSPORT_APP_ID": "your-uk-app-id",
        "UK_TRANSPORT_API_KEY": "your-uk-api-key"
      }
    }
  }
}

Additional notes

Tips and caveats:

  • Ensure UK API credentials (UK_TRANSPORT_APP_ID and UK_TRANSPORT_API_KEY) are valid; otherwise UK live data requests will fail.
  • The server depends on external transport APIs; expect occasional rate limits or outages from providers.
  • If moving the repository, update the --directory path to the absolute path where the server is located.
  • For development, you can run tests with pytest as described in the repository, and use uv sync to install dependencies.
  • If you encounter environment issues, verify that uv is correctly installed and accessible in your PATH (which uv on macOS/Linux or where uv on Windows).
  • Review the documentation within the repository for country-specific endpoints and query formats when integrating into clients.

Related MCP Servers

Sponsor this space

Reach thousands of developers