
mcp-server-public-transport
mcp-server-public-transport is an open-source, locally hosted server providing an interface for accessing public transport data across Europe.
README
mcp-server-public-transport
An MCP-compatible server providing real-time public transport data across Europe.
About
mcp-server-public-transport is a Model Context Protocol (MCP)-compatible local server that provides access to public transport data across Europe. Currently, it integrates APIs from UK, Switzerland and Belgium, allowing you to retrieve train connections, live departures, and bus locations.
Feature Implementation Status
Supported Countries
Country | API Base URL | Status |
---|---|---|
United Kingdom | https://transportapi.com | ✅ |
Switzerland | https://transport.opendata.ch | ✅ |
Belgium | https://api.irail.be | ✅ |
Features by Country
Feature | API Path | Status |
---|---|---|
United Kingdom | ||
Live Departures | /uk/train/station_timetables/{station_code}.json |
✅ |
Switzerland | ||
Search Connections | /connections |
✅ |
Station Lookup | /locations |
✅ |
Departure Board | /stationboard |
✅ |
Nearby Stations | /locations?x={lon}&y={lat} |
✅ |
Belgium | ||
Live Departures | /departures |
✅ |
Station Lookup | /stations |
✅ |
Nearby Stations | /stations/nearby |
✅ |
Setup
Environment Variables
Set the following environment variables:
UK_TRANSPORT_APP_ID=your_uk_app_id
UK_TRANSPORT_API_KEY=your_uk_api_key
Usage with Claude Desktop
Add to your claude_desktop_config.json`:
{
"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"
}
}
}
}
Replace /ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-server-public-transport
with the actual path where you've cloned the repository.
Note: You may need to put the full path to the uv executable in the command field. You can get this by running which uv on MacOS/Linux or where uv on Windows.
Development
Setting up Development Environment
-
Clone the repository
git clone https://github.com/mirodn/mcp-server-public-transport.git cd mcp-server-public-transport
-
Install dependencies
uv sync
-
Set environment variables
cp .env.example .env
-
Run the server
uv run server.py
Running Tests
The project uses pytest for testing with the following commands available:
# Run all tests
make test
Code Quality
# Run linting
make lint
# Run code formatting
make format
Continuous Integration
The project includes a GitHub Actions workflow (.github/workflows/test.yml
) that automatically:
- Runs tests on Python 3.10, 3.11, and 3.12
- Executes linting checks using ruff
- Runs on every push and pull request to
main
branch
The CI pipeline ensures code quality and compatibility across supported Python versions before any changes are merged.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
The package is deployed automatically to PyPI when project.version is updated in pyproject.toml
.
Follow semver for versioning.
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.