mcp -public-transport
MCP server from mirodn/mcp-server-public-transport
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:
- Clone the repository
git clone https://github.com/mirodn/mcp-server-public-transport.git
cd mcp-server-public-transport
- Install dependencies and run the setup for the Python environment
uv sync
- 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
- Run the server
uv run server.py
- 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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP