Skip to main content
Glama

OpenBusData MCP Server

mcp-name: io.github.AndrewAubury/openbusdata

MCP server for the UK Bus Open Data Service with rich timetable parsing, stop search, route discovery, journey planning and real-time bus tracking.

Features

  • Live API tools — query timetables, fares, disruptions, cancellations and real-time bus locations

  • Stop search — fuzzy text search across every bus stop in the UK

  • Route finder — discover all routes serving a pair of stops

  • Journey planner — "get to X by Y o'clock" with support for direct and chained multi-leg journeys

  • Live tracking — see exactly where buses are right now

Related MCP server: BVG MCP Server

Installation

Option 1: via uvx (recommended — no install needed)

uvx openbusdata-mcp

Option 2: via pip

pip install openbusdata-mcp

Configuration

Set your Bus Open Data Service API key as an environment variable:

export OPENBUS_API_KEY="your-api-key-here"

Get a free key at data.bus-data.dft.gov.uk.

Usage

With uvx (recommended)

Add to your MCP client (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "openbusdata": {
      "command": "uvx",
      "args": ["openbusdata-mcp"],
      "env": {
        "OPENBUS_API_KEY": "your-api-key-here"
      }
    }
  }
}

With pip install

{
  "mcpServers": {
    "openbusdata": {
      "command": "openbusdata-mcp",
      "env": {
        "OPENBUS_API_KEY": "your-api-key-here"
      }
    }
  }
}

Development

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

# Install dependencies
pip install -e ".[dev]"

# Run server
python -m openbusdata_mcp.server

License

MIT

Available Tools

16 tools
Data_set_api_v1_fares_datasetC

Returns all fares datasets

Parameters: noc: Operators can operate using a single National Operator Code (NOC) or have multiple NOCs associated. Download the data catalogue to see the relationship between operators and NOCs within the service. To limit results to operators associated with multiple NOCs, input a comma separated list of the relevant NOCs. status: Limit results to data sets with the specified status string, accepted values are published, inactive. boundingBox: Limit results to fares data sets that contain information for the area within the rectangular boundingBox you set using co-ordinates. [minLatitude, maxLatitude, minLongitude, maxLongitude]. The default values shown are for the Liverpool area. limit: The maximum number of records to return. The default value shown is 25. offset: Return results that match the query starting from the specified offset. e.g. If the offset=10 and limit=25, then results from 11 to 35 will be returned The default value shown is 0.

Inputs: kwargs (required). Returns: result

Data_set_api_v1_fares_dataset_by_datasetIDB

Returns a single dataset

Parameters: datasetID (required): Limit results to a specific data set of a publisher using the data set ID.

Inputs: kwargs (required). Returns: result

find_buses_by_arrival_timeA

Find scheduled buses that board at stop_a and arrive at stop_b by the given time.

Parameters: stop_a: Boarding stop (NaPTAN code or name). stop_b: Alighting stop (NaPTAN code or name). arrive_by: Target arrival time (HH:MM, 24h format). day: Optional day filter: mon, tue, wed, thu, fri, sat, sun. Defaults to today.

Inputs: stop_a (required), stop_b (required), arrive_by (required), day. Returns: result

find_routes_between_stopsA

Find all bus routes that serve BOTH of the given stops. Stops can be specified by NaPTAN code or by name.

Parameters: stop_a: First stop (NaPTAN code or name substring). stop_b: Second stop (NaPTAN code or name substring).

Inputs: stop_a (required), stop_b (required). Returns: result

get_live_buses_on_routeA

Get real-time bus locations for a specific operator and route.

Parameters: operator_ref: Operator NOC code (e.g. ARBB, SCCM, CBBH). line_ref: Route number (e.g. 12, MK1, 100).

Inputs: line_ref (required), operator_ref (required). Returns: result

get_route_stopsA

Get the full ordered list of stops for a specific bus route.

Parameters: operator: Operator name (exact or partial match). route: Route number/identifier. direction: Optional filter: 'inbound', 'outbound', or leave blank for all.

Inputs: route (required), operator (required), direction. Returns: result

GTFS_RT_Data_feed_api_v1_gtfsrtdatafeedD

Returns all published datafeeds

Parameters: boundingBox: Limit results to bus location data with vehicle position within the rectangular boundingBox you set using co-ordinates. [minLongitude, minLatitude, maxLongitude, maxLatitude] The default values shown are for the Liverpool area. routeId: Limit results to bus location data with the specified routeId. Use a comma-separated list to specify multiple routeId values. startTimeAfter: Limit results to bus location data with a start time after startTimeAfter. startTimeBefore: Limit results to bus location data with a start time before startTimeBefore.

Inputs: kwargs (required). Returns: result

load_timetable_indexA

Download and index all accessible timetable datasets. Call this first if stop/route search tools return no results.

Parameters: force_refresh: If true, re-download all data instead of using cache.

Inputs: force_refresh. Returns: result

plan_journeyA

Plan a journey from stop_a to stop_b arriving by a given time. Supports direct routes and single changes.

Parameters: stop_a: Starting stop (NaPTAN code or name). stop_b: Destination stop (NaPTAN code or name). arrive_by: Target arrival time (HH:MM, 24h format). day: Optional day filter: mon, tue, wed, thu, fri, sat, sun. Defaults to today. max_changes: Maximum number of bus changes (0 = direct only, 1 = one change). Default 1.

Inputs: stop_a (required), stop_b (required), arrive_by (required), day, +1 more. Returns: result

search_stopsA

Search for bus stops by name across all loaded timetable data. Returns matching stops with their NaPTAN codes.

Parameters: query: Substring to search for in stop names (case-insensitive).

Inputs: query (required). Returns: result

SIRI_SX_Cancellations_siri_sx_cancellationsD

Returns all cancellations

Parameters:

Inputs: kwargs (required). Returns: result

SIRI_SX_Disruptions_siri_sxC

Returns all disruptions

Parameters:

Inputs: kwargs (required). Returns: result

SIRI_VM_Data_feed_api_v1_datafeedA

Returns all published datafeeds

Parameters: boundingBox: Limit results to bus location data with vehicle position within the rectangular boundingBox you set using co-ordinates. [minLongitude, minLatitude, maxLongitude, maxLatitude]. The default values shown are for the Liverpool area. operatorRef: Limit results to bus location data with the specified operatorRef. The National Operator Code is often used as the input for operatorRef. Comma separated list of values can be used for querying. vehicleRef: Limit results to bus location data with the specified vehicleRef. lineRef: Limit results to bus location data with the specified lineRef. producerRef: Limit results to bus location data with the specified producerRef. originRef: Limit results to bus location data with the specified originRef. destinationRef: Limit results to bus location data with the specified destinationRef.

Inputs: kwargs (required). Returns: result

SIRI_VM_Data_feed_api_v1_datafeed_by_datafeedIDC

Returns a single datafeed

Parameters: datafeedID (required): Limit results to a specific data feed of a publisher using the data feed ID.

Inputs: kwargs (required). Returns: result

timetables_api_v1_datasetC

Returns all timetables

Parameters: adminArea: Limit results to datasets with services that stop within the specified area(s). The adminAreas entered will be inserted into a comma delimited query in the API. noc: Limit results to data sets published by an operator identified by the specified National Operator Code (NOC). The NOCs entered will be inserted into a comma delimited query in the API. limit: The maximum number of records to return. The default value shown is 25. offset: Return results that match the query starting from the specified offset e.g. If the offset=10 and limit=25, then results from 11 to 35 will be returned. The default value shown is 0. search: Return data sets where the data set name, data set description, organisation name, or admin area name contain the specified value. status: Limit results to data sets with the specified status. endDateStart: Limit results to data sets with services with end dates after this date. endDateEnd: Limit results to data sets with services with end dates before this date. modifiedDate: Limit results to data sets that have been created/updated since the specified date. startDateStart: Limit results to data sets with services with start dates after this date. startDateEnd: Limit results to data sets with services with start dates before this date. dqRag: Limit results to data sets with the specified String. bodsCompliance: Limit results to data sets with the specified boolean value.

Inputs: kwargs (required). Returns: result

timetables_api_v1_dataset_by_datasetIDC

Returns a single dataset

Parameters: datasetID (required): Limit results to a specific data set of a publisher using the data set ID.

Inputs: kwargs (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 16 tools

    Disambiguation3/5

    Several tools have overlapping scopes, like multiple dataset listing tools (Data_set_api_v1_fares_dataset and timetables_api_v1_dataset) and real-time feed tools (get_live_buses_on_route and SIRI_VM_Data_feed_api_v1_datafeed). While they target different data types (fares vs timetables, route-level vs feed-level), the names are similar and could confuse an agent.

    Naming Consistency2/5

    Naming is highly inconsistent: some tools use snake_case (find_buses_by_arrival_time), some use camelCase (Data_set_api_v1_fares_dataset), and others use a mix (GTFS_RT_Data_feed_api_v1_gtfsrtdatafeed). There is no consistent pattern, making it hard to predict tool names.

    Tool Count4/5

    16 tools is reasonable for a comprehensive bus data API covering fares, timetables, real-time, disruptions, and planning. It is slightly on the high side but still well-scoped for the domain.

    Completeness4/5

    The tool set covers core bus data operations: dataset discovery, stop search, route lookup, timetables, real-time positions, cancellations, disruptions, and journey planning. Minor gaps exist (e.g., no fare calculation), but the overall coverage is good.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers