MCP Server for Public Transport Timetables Built on GTFS Feeds
Build a Model Context Protocol server that lets any AI assistant answer real transport questions correctly: next departures, journeys with transfers, service changes and accessibility, all computed from GTFS timetable data rather than guessed by the model. Where a city has no public feed, the team builds one for a route they know, such as a university shuttle or a metro bus line, and publishes it openly.
Intermediate
A small team, or one strong student willing to learn something new.1 semester · 2 students
7 to ship
3 optional extrasSuggested stack
What you should ship
- A GTFS loader and validator that imports a feed into a local database and reports errors
- A GTFS feed you create for at least one real route that lacks one (for example a university shuttle), with stops, times and calendar
- MCP tools such as find_stop, next_departures, plan_journey and service_alerts, with clear descriptions and typed parameters
- A journey planner (RAPTOR or a simpler time-expanded search) that handles transfers and walking between nearby stops
- An evaluation set of 100 natural-language questions in English and Roman Urdu with correct answers computed from the timetable
- A comparison of answer accuracy for an assistant with and without your server
- Published documentation so others can point the server at their own city's feed
If you have time left
- GTFS Realtime support where a feed exists
- Fare calculation from GTFS fare data
- A WhatsApp-style chat front end that uses the server
The problem: assistants make up bus times
Ask a general chatbot when the next bus leaves and it will either refuse or invent a plausible time. Timetables are exactly the kind of structured, changing data a language model should look up, not remember. MCP gives assistants a standard way to call tools, so one good transport server can serve many assistants.
In many cities in Pakistan, India, Bangladesh and Africa, timetable data is not published in a standard format at all, even when routes and times are well known locally.
What already exists and the gap
- GTFS, the General Transit Feed Specification, is the standard format that apps like Google Maps use for timetables. The Mobility Database lists public feeds worldwide.
- OpenTripPlanner is a mature open source journey planner built on GTFS and OpenStreetMap.
- MCP servers exist for many developer tools, maps and search, and hobby servers for individual transit agencies.
The gap is a reusable, well-tested MCP server that turns any GTFS feed into reliable tools for assistants, evaluated for correctness, plus the civic work of creating a feed where none exists.
Inspiration
Transit agencies that publish open GTFS data have seen a wave of third-party apps built on it. Your project adds AI assistants to that list and shows how a few students can put a local route on the map.
What you build
- A loader and validator for GTFS.
- A new feed for a route you know, collected carefully.
- The MCP server with a small set of well-described tools.
- An evaluation of question answering accuracy.
The technically interesting part
- Journey planning. RAPTOR (Delling, Pajor and Werneck, 2012) is a fast round-based algorithm designed for public transit. Implementing it is a satisfying algorithms chapter.
- Tool design. The model must pick the right tool and pass a stop it can resolve. Fuzzy stop matching, including Roman Urdu spellings of stop names, matters more than you expect.
- Time. Service calendars, overnight trips past midnight and time zones are where most bugs hide.
How you will evaluate it
- Accuracy on your 100 questions, with and without the server.
- Correctness of journey plans against a hand-checked set.
- Validator results on your own feed and two public feeds.
Path to a product
Transport agencies, ride-hailing and city apps all want conversational interfaces that do not invent times. A hosted server per city, or consulting to help agencies publish GTFS, are realistic paths. A published feed for a local route is also a public good you can point to.
Scope warning
Do not scrape apps or private APIs for timetables. Collect data yourself or use published feeds and respect their licences. One city or route done well is enough.
Learn what you need on Sefism
- AI agents roadmap: tools, tool descriptions and how agents choose them.
- MCP cheat sheet: servers, tools, transports and testing in one page.
- MCP Python SDK: building the server in Python.
- MCP TypeScript SDK: the TypeScript alternative.
- MCP Inspector: testing your tools by hand.
- Writing effective tools for AI agents: naming and describing tools so models use them well.
- What is MCP and do I need to learn it?: a quick primer.
Get help with this idea
The risk is a server that works for the demo but gives wrong answers on edge cases. Tauseef can help you choose a route, design the tools and build an evaluation that proves correctness. If you are new here, create a free account first.
Ideas and guidance, not finished projects
These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.
Not sure this one fits you?
I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.