SG Bus Arrivals
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SG Bus ArrivalsWhen is the next bus 96 at stop 83139?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ππ SG Bus + Train β a Muse connector
Real-time Singapore bus arrival times and MRT/LRT service info as an MCP server, powered by the official LTA DataMall API. Ask in plain language:
"When is the next bus 96 at stop 83139?" "Which buses stop at Buona Vista?" "Is the next bus 151 wheelchair accessible?" "What buses are near me?" "Is the MRT disrupted right now?" "How crowded is Dhoby Ghaut station?" "Which stations are on the Circle Line?"
Built for submission to the Meta Muse connector directory (muse.ai/platform).
How it works
Muse ββMCP (streamable HTTP)βββΆ this server ββHTTPSβββΆ LTA DataMall API
β β²
ββ forwards YOUR key βββββAuth model (per-user keys, with a demo fallback)
This connector uses API keys auth:
Each end user ideally brings their own free LTA DataMall API key (from https://datamall.lta.gov.sg β sign up, free).
The user saves the key in Muse as the
x-lta-account-keyrequest header (aliasaccountkeyalso accepted). Own keys are unlimited.For try-before-you-commit, the server can be configured with a demo key via the
LTA_DEMO_ACCOUNT_KEYenv var (the developer's own key, shared quota). Callers without their own key fall back to it, rate-limited to 10 calls per client IP per day (in-memory). When the budget is exhausted they get a friendly error pointing at the free key signup.The server never stores any key β yours or the demo one β and never logs keys.
Tools (all read-only)
Tool | What it does |
| Next 3 buses per service at a 5-digit stop code: minutes until arrival, crowding in plain words (seats / standing / limited standing), wheelchair accessibility, single/double deck. Each bus is tagged with its terminating stop, resolved from LTA's per-vehicle destination code. |
| Case-insensitive search over stop names and roads. Served from the bundled stop list (see below) β instant, no LTA call. |
| Stops near a location (haversine distance), nearest first, with distance in metres. Served from the bundled stop list. Enables a "buses near me" flow: resolve the user's location β this tool β |
| Full ordered route for a service (e.g. |
| Live MRT/LRT service status: any disrupted lines with affected stations, directions, free bridging buses / MRT shuttles and LTA's advisory message β or confirmation that all lines run normally. Updated ad hoc by LTA. |
| Live platform crowding ( |
| Crowd forecast in 30-minute slots for the next |
| The bundled MRT/LRT station map: codes, names, coordinates and line order for all 9 lines (188 stations). Filter by line or search by name/code β no API key needed, always instant. |
| Maintenance: one raw 500-record page of an LTA static dataset ( |
Bus stop codes are validated as exactly 5 digits. LTA calls have a 10s timeout with 2 retries (exponential backoff), per-call latency logging, and human-readable errors β agents surface these directly to users.
Bundled static data (no cold starts)
Reference data that changes rarely lives in data/*.json, committed to the
repo, loaded from disk on first use and kept in memory afterwards:
File | Contents | Source |
| ~5k bus stops: code, name, road, coordinates | LTA DataMall |
| ~30k route records: service, operator, direction, ordered stops, first/last bus | LTA DataMall |
| 188 MRT/LRT stations: codes, names, coordinates, line topology (9 lines) | ayaka14732/singapore-hdb-map (sourced from LTA DataMall, the LTA system map and data.gov.sg under the Singapore Open Data Licence) |
This means bus_route, find_bus_stops, nearby_bus_stops and
train_stations answer instantly β even the very first call after a deploy β
with zero LTA traffic. Only genuinely live data (arrivals, alerts, crowding)
hits the LTA API per request. If a bundled file is ever missing, the server
falls back to a live LTA fetch so a partial checkout still works.
Tool outputs note the snapshot date (e.g. "Route data bundled 2026-09-25"), so agents can see the vintage. To refresh the bus datasets:
python3 scripts/refresh_static_data.py # uses the sg-bus CLI + stored credential
git add data/bus_stops.json data/bus_routes.json && git commit -m "Refresh bus datasets"scripts/build_train_stations.py rebuilds the station map from its upstream
source (re-run when new stations open).
Static pages
The same app serves three pages (needed for directory submission):
/β product landing: what it is, example prompts, key signup link, connect instructions/privacyβ plain language: keys forwarded per-request to LTA only, nothing stored, no analytics/termsβ as-is, not affiliated with LTA or Meta
Related MCP server: Singapore Location Intelligence MCP
Local dev
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn server:app --reload
# β http://127.0.0.1:8000/ (landing page)
# β http://127.0.0.1:8000/mcp (MCP endpoint)No LTA key is needed to start the server or list tool schemas β only actual bus queries need a key.
Deploy
Fly.io
fly launch --no-deploy # accepts the existing fly.toml
fly deploy
fly open # your public URL, e.g. https://sg-bus-mcp.fly.devOptional β enable the demo fallback: fly secrets set LTA_DEMO_ACCOUNT_KEY=<your-key>
(use your own DataMall key; the shared quota is yours to mind).
Region is sin (closest to LTA's API). Machines scale to zero when idle.
Render
Push this repo to GitHub.
In Render: New β Blueprint and point it at the repo (it picks up
render.yaml).Done β Render builds the Dockerfile and gives you a public URL.
Optional β enable the demo fallback by adding an LTA_DEMO_ACCOUNT_KEY
environment variable (marked secret) in the Render dashboard.
Region is singapore; Render injects $PORT, which the Dockerfile already listens on.
Connect from Muse (custom connector)
In Muse: Connectors β Add custom connector.
MCP server URL:
https://<your-deployed-host>/mcpAPI key: either save your free LTA DataMall key as the
x-lta-account-keyrequest header β or skip it and try the shared demo key (10 free tries a day, no signup).Ask: "When is the next bus 96 at stop 83139?"
Submission checklist (muse.ai/platform)
Public HTTPS endpoint serving the MCP server at
/mcpProduct landing page at
/with example prompts and key signup link/privacyand/termspagesAuth documented: per-user LTA keys via
x-lta-account-keyheader, nothing stored server-sideDemo fallback documented (developer's shared key, 10 tries/day/IP, own key for unlimited use)
Read-only tools (no writes, no spending, no side effects)
Human-readable error messages for every failure mode
Health check:
GET /returns 200Live end-to-end test with a real LTA key (needs a key β see below)
Privacy/terms reviewed by a human before submission
β οΈ Not yet tested live: the code paths that call LTA (
bus_arrivalswith a valid key, and the firstfind_bus_stopscache load) have not been exercised against the real API β no LTA key was available during development. Run one manualbus_arrivalscall with a real key before submitting.
License
MIT β see LICENSE. Not affiliated with LTA or Meta.
This server cannot be deployed
Maintenance
Related MCP Connectors
Provide real-time transportation data including bus arrivals, train service alerts, carpark availaβ¦
Get real-time bus arrival times for any Singapore bus stop by code, with optional service filterinβ¦
Real-time transit stops, routes, arrivals, vehicle positions, and schedules via OneBusAway APIs.
Get real-time NYC bus arrivals, live vehicle locations, and service alerts. Plan trips between anyβ¦
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceFacilitates real-time access to Singapore's Land Transport Authority (LTA) transportation data, offering insights into bus arrivals, train services, traffic conditions, and more through integration with the LTA DataMall API.473-
- AlicenseBqualityDmaintenanceProvides comprehensive Singapore transport routing with real-time public transport data, weather-aware journey planning, postal code resolution, and Google Maps-quality turn-by-turn navigation across MRT, LRT, buses, and walking routes.1319 npm6MIT
- FlicenseAqualityDmaintenanceProvides real-time access to Singapore's Land Transport Authority data, including bus arrivals, traffic conditions, train updates, and carpark availability.7-
- FlicenseNot gradedqualityDmaintenanceProvides real-time Singapore bus information, including arrival times, routes, and stop details via the LTA DataMall API.1-