- Home
- MCP servers
- UK Bus Departures
UK Bus Departures
- typescript
0
GitHub Stars
typescript
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"vandamd-bustimes-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}You run an MCP server that surfaces real-time UK bus departures by scraping bustimes.org. It validates ATCO codes, caches data, and serves structured JSON to clients via the MCP protocol and Server-Sent Events. This makes it easy to build apps or dashboards that show current bus services for UK stops.
How to use
Start the MCP server and connect your MCP client to its MCP endpoint. You can then request real-time departures for a given UK bus stop ATCO code, or validate ATCO codes to retrieve stop metadata. Use the two built-in tools to fetch data and verify stop details.
Typical usage patterns you can implement: - Retrieve departures for a specific stop code to display upcoming services and delays. - Validate a stop code to ensure it exists and to obtain human-friendly stop metadata such as the name and location. - Build a small dashboard or widget that polls departures at a reasonable rate and updates the UI with the latest times.
How to install
Prerequisites you need before installing:
- Node.js 18+ on your development machine
- Wrangler CLI for Cloudflare Workers development (if you plan to deploy as a Worker)
# Install dependencies for local development
npm install
# Start local development server
npm run dev
Additional configuration and notes
Connection options: you can run the MCP server locally and connect from an MCP client using a standard stdio configuration, or deploy the server to Cloudflare Workers and consume the MCP endpoints exposed by the deployment.
{
"mcpServers": {
"uk_bus_deps": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8787/sse"]
}
}
}
Endpoints and data flow
When deployed as a Cloudflare Worker, you expose the MCP protocol at GET /mcp and a Server-Sent Events endpoint at GET /sse. Clients use these endpoints to invoke tools and receive real-time data streams.
Troubleshooting and tips
If you encounter invalid ATCO codes, you will receive a validation response indicating the code format issue or missing metadata. If you see 404 responses for a stop, double-check the ATCO code and ensure it exists in the bustimes.org stop metadata. Be mindful of rate limiting: the server enforces a 2-second delay between requests to bustimes.org and uses caching for stop metadata to keep responses fresh without overloading the source.
Security and usage notes
This MCP server scrapes public data from bustimes.org to provide real-time information. Use it responsibly and respect the source’s terms of service. If you deploy publicly, consider implementing appropriate access controls to prevent abuse or excessive scraping.
Available tools
get_bus_departures
Fetches real-time bus departures for a UK bus stop using its ATCO code and returns stop metadata, departures list, and timing information.
validate_atco_code
Validates an ATCO code format and returns stop metadata if valid, including human-friendly stop names and geolocation.