Skip to main content
Glama

iett-mcp

CI

An MCP server for Istanbul public transport. It lets AI assistants like Claude Code, Claude Desktop or Cursor answer questions about İETT bus stops and lines using live data from İETT's official web services.

You: I'm at Tersane Köprüsü in Pendik. How far is the next 500T to 4. Levent? Claude: (calls search_stops, then get_live_buses) The nearest one, C-397, is 5 stops away near Aydıntepe İstasyon. Its position was updated 33 seconds ago. The next one is 11 stops behind it.

No API key needed. İETT's data is public.

Tools

Tool

What it does

search_stops

Find bus stops by name, optionally within a district. Ignores Turkish accents and case, so kadikoy finds KADIKÖY. Returns stop code, direction, coordinates and accessibility.

find_stops_near

Stops near a latitude/longitude, nearest first, with distance and a rough walking time. Lets users ask about a place ("near Taksim Square") instead of a stop name.

get_line_info

Look up a line by code (500T, 25G) or find lines by the places in their route name (Sarıyer Taksim). Returns the route ends, length, typical trip time and fare type.

get_line_stops

List a line's stops in travel order, for each direction. Optional toward returns only the direction heading to a place. Codes match loosely, so 78s finds 78Ş.

get_live_buses

Where a line's buses are right now, placed on the route by their nearest stop. With stop_code, lists only the buses still heading to that stop and how many stops away each one is.

get_timetable

Scheduled departures from each direction's first stop: today's next buses with the wait, first and last bus, or a whole day grouped by hour, for weekdays, Saturdays or Sundays.

All tools are read-only.

Related MCP server: TFL MCP Server for Poke

Setup

git clone https://github.com/mohamedzeina/iett-mcp.git && cd iett-mcp
npm install
npm run build

Claude Code:

claude mcp add iett -- node /absolute/path/to/iett-mcp/dist/index.js

If you open Claude Code inside this folder, it picks up the server from .mcp.json automatically. That version runs from source, so you don't need to build first.

Claude Desktop / Cursor (claude_desktop_config.json / .cursor/mcp.json):

{
  "mcpServers": {
    "iett": {
      "command": "node",
      "args": ["/absolute/path/to/iett-mcp/dist/index.js"]
    }
  }
}

How it works

AI assistant ──MCP (stdio)──► server.ts ──► search.ts (local, accent-insensitive search)
                                  │
                                  └──► iett/client.ts (12h in-memory cache)
                                           └──► iett/soap.ts ──SOAP/XML──► api.ibb.gov.tr/iett
  • The upstream API is SOAP. İETT exposes ASP.NET .asmx services. Some return a JSON string inside the XML envelope; the stop-detail service returns an XML DataSet. soap.ts builds the envelope (with input escaped), parses both response styles, turns SOAP faults into readable errors, and retries network errors and 5xx responses.

  • Download once, search locally. İETT can't search by name, so the full lists (~15k stops, ~800 lines, about 3.7 MB) are fetched on the first call and cached for 12 hours. Each line's stop list is cached the same way. A failed download is never cached.

  • Live data has a quota. İETT's fleet service allows about 100 requests per hour. Live positions are cached for 30 seconds per line, every call goes through a 90-per-hour sliding-window budget (rateLimit.ts), and failed calls aren't retried. When the budget runs out, the tool says when live data will be back.

  • Positions mean more on the route. A raw GPS point says little. live.ts matches each bus's nearest stop against the line's stop list, so the tool can say "5 stops away" and flag reports older than 5 minutes.

  • Service days run past midnight. A line's day can run from 05:40 to 00:20, and night lines run 23:40 to 05:20. schedule.ts uses İETT's listing order, where a jump back of more than 12 hours marks midnight, so "next bus" stays right after midnight. It also checks the previous day's late departures. A "largest gap" rule would fail for lines that only run mornings and evenings.

  • Turkish-aware matching. İETT's data mixes spellings ("Kadiköy", "Sisli", "ŞİŞLİ"), and users type without Turkish characters. text.ts lowercases with Turkish rules (İ→i, I→ı) and strips accents, so every spelling matches.

  • Errors the model can act on. When İETT is down, tools return isError with a message the assistant can explain, instead of crashing.

Development

npm run dev        # run the server from source
npm test           # unit + MCP protocol tests (İETT is faked from fixtures)
npm run smoke      # live check against the real İETT service
npm run inspect    # open the MCP Inspector to call tools by hand

The tests connect a real MCP client to the server over an in-memory transport, so they cover tool registration, input validation and response format, not just helper functions.

Roadmap

  • get_line_stops: ordered stops along a line

  • get_timetable: scheduled departures

  • get_live_buses: real-time bus positions for a line

  • find_stops_near: stops near a coordinate

  • İsbike bike-share stations

  • Publish to npm and an MCP server registry

Data

Data comes from İETT via the İBB Open Data Portal. This project is not affiliated with İETT or İBB.

License

MIT

Available Tools

6 tools
find_stops_nearFind İETT bus stops near a locationA
Read-only

Find Istanbul İETT bus stops near a latitude/longitude, nearest first, with walking-distance estimates. Use it when the user gives a place instead of a stop name: use coordinates you know for well-known places, or ones the user shares. Results include stop codes for get_live_buses.

Inputs: latitude (required), longitude (required), limit, radius_m.

get_line_infoGet İETT bus line infoA
Read-only

Look up an Istanbul İETT bus line by its code (e.g. '500T', '25G') or find lines by places in their route name (e.g. 'Sarıyer Taksim'). Returns the route endpoints, length, typical trip time and fare type. Note: route names only list a line's two ends, not every stop along the way.

Inputs: line (required), limit.

get_line_stopsGet the stops along an İETT bus lineA
Read-only

List the stops of an Istanbul İETT bus line in travel order, for each direction. Use it to check whether a line serves a stop, or how many stops lie between two places. Accepts line codes loosely ('78s' finds '78Ş'). Pass 'toward' to get only the direction heading to a place.

Inputs: line (required), toward.

get_live_busesGet live İETT bus positionsA
Read-only

Show where an Istanbul İETT line's buses are right now, placed on the route by their nearest stop. Pass 'stop_code' (from search_stops) to get only the buses still heading to that stop and how many stops away each one is, which answers 'is my bus close?'. Positions come from İETT's fleet tracking and can lag; some lines have no tracked buses. İETT limits this data to about 100 requests per hour, so avoid polling.

Inputs: line (required), stop_code.

get_timetableGet an İETT line's timetableA
Read-only

Scheduled departures of an Istanbul İETT line from the first stop of each direction. By default shows today's next departures (Istanbul time) plus the first and last bus; pass 'day' for another day type and 'full' for every departure. Times are at the starting stop, not at stops along the way: to see whether a bus is close to a stop, use get_live_buses. Public holidays may run a different schedule.

Inputs: line (required), day, full, count, +1 more.

search_stopsSearch İETT bus stopsA
Read-only

Search Istanbul İETT bus stops by name, optionally within a district. Matching ignores Turkish accents and case, so 'kadikoy' finds 'KADIKÖY'. Many places have several stops (one per direction); each result says which way its buses go. Returns stop codes, which other tools accept.

Inputs: query (required), limit, district.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 6 tools

    Disambiguation4/5

    The six tools are largely distinct: line metadata, line stops, live positions, and timetables don't overlap. The only mild overlap is search_stops vs find_stops_near, both of which return stop codes, and a request like "stops near Kadıköy" could plausibly route to either, though the descriptions do explain when to use each.

    Naming Consistency4/5

    All names are snake_case with a verb_noun shape (search_stops, find_stops_near, get_line_info, get_line_stops, get_live_buses, get_timetable). The verb mix between 'search' and 'find' for the two stop-lookup tools is a minor deviation but still predictable.

    Tool Count5/5

    Six tools is a well-scoped surface for a bus transit API, with each tool covering a distinct query type (stops by name, stops by location, line info, line stops, live vehicles, schedule). Nothing feels redundant or missing at the count level.

    Completeness4/5

    The core lifecycle for a transit use case—locate stops, identify a line, list its stops, see live buses, get scheduled departures—is covered, and the descriptions cross-reference how to combine tools. Minor gaps exist: timetables only show departures from the first stop per direction, and there is no journey/route-planning or service-alert tool.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time access to İzmir's public transportation data, including bus locations, schedules, and route information for ESHOT, İZBAN, Metro, and Tram services. It enables AI assistants to perform transit queries, calculate fares, and locate nearby stations using the Model Context Protocol.
      5 npm
      1
      ISC
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to query live arrivals, vehicle positions, routes, stops, and timetables across the Athens public transport network, with stop lookups by name or coordinate in Greek or Latin script. Results cover OASA buses, trolleys, metro, and tram, falling back to cached reference data when the upstream API is unreachable.
      10
      1
      MIT