onebusaway-mcp-server

v0.1.13 pre-1.0

Query stops, routes, real-time arrivals, vehicle positions, and schedules from OneBusAway transit APIs via MCP. STDIO or Streamable HTTP.

onebusaway.caseyjhand.com/mcp
claude mcp add --transport http onebusaway-mcp-server https://onebusaway.caseyjhand.com/mcp
codex mcp add onebusaway-mcp-server --url https://onebusaway.caseyjhand.com/mcp
{
  "mcpServers": {
    "onebusaway-mcp-server": {
      "url": "https://onebusaway.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http onebusaway-mcp-server https://onebusaway.caseyjhand.com/mcp
{
  "mcpServers": {
    "onebusaway-mcp-server": {
      "command": "bunx",
      "args": [
        "mcp-remote",
        "https://onebusaway.caseyjhand.com/mcp"
      ]
    }
  }
}
{
  "mcpServers": {
    "onebusaway-mcp-server": {
      "type": "http",
      "url": "https://onebusaway.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://onebusaway.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

15

onebusaway_list_agencies

List all transit agencies served by this OneBusAway instance. Returns agency IDs, names, contact info, timezone, and geographic coverage center. Agency IDs are needed for onebusaway_list_routes_for_agency and onebusaway_get_vehicles.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_list_agencies",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
view source ↗

onebusaway_find_stops

Find bus stops near a location. Returns stops within a radius, each with ID, name, direction, served routes, and wheelchair boarding status. Use stopId values from results to fetch real-time arrivals with onebusaway_get_arrivals. Optionally filter by stop code (the number printed on the stop sign, e.g. "75403").

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_find_stops",
    "arguments": {
      "lat": "<lat>",
      "lon": "<lon>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "lat": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Latitude of the search center, in [-90, 90]."
    },
    "lon": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Longitude of the search center, in [-180, 180]."
    },
    "radius": {
      "default": 300,
      "description": "Search radius in meters. Must be positive; capped at 1600m, beyond which results degrade. Defaults to 300m.",
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1600
    },
    "query": {
      "description": "Optional stop code filter (the number printed on the stop sign, e.g. \"75403\"). When provided, returns only stops matching this code within the radius.",
      "type": "string"
    }
  },
  "required": [
    "lat",
    "lon",
    "radius"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_find_routes

Find transit routes near a location, optionally filtered by name or number. Returns routes with IDs, short names, and descriptions. Use routeId values to fetch schedules, vehicles, or stop sequences.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_find_routes",
    "arguments": {
      "lat": "<lat>",
      "lon": "<lon>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "lat": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Latitude of the search center, in [-90, 90]."
    },
    "lon": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Longitude of the search center, in [-180, 180]."
    },
    "radius": {
      "default": 500,
      "description": "Search radius in meters. Must be positive; capped at 1600m. Defaults to 500m. Ignored when latSpan and lonSpan are both set.",
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1600
    },
    "latSpan": {
      "description": "Optional bounding-box height in degrees, as an alternative to radius. Takes effect only when lonSpan is also set, in which case radius is ignored.",
      "type": "number",
      "exclusiveMinimum": 0
    },
    "lonSpan": {
      "description": "Optional bounding-box width in degrees, as an alternative to radius. Takes effect only when latSpan is also set, in which case radius is ignored.",
      "type": "number",
      "exclusiveMinimum": 0
    },
    "query": {
      "description": "Filter by route name or number (e.g. \"44\" or \"Link Light Rail\").",
      "type": "string"
    }
  },
  "required": [
    "lat",
    "lon",
    "radius"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_search_stops

Search for stops by name or code. Returns matching stops with IDs and coordinates. Use to resolve a human-readable stop name or number to a stop ID for arrivals lookups with onebusaway_get_arrivals.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_search_stops",
    "arguments": {
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Stop name fragment or stop code (e.g. \"University Way\" or \"75403\")."
    },
    "maxCount": {
      "default": 10,
      "description": "Maximum number of results to return. A positive integer, at most 100. Defaults to 10.",
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100
    }
  },
  "required": [
    "query",
    "maxCount"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_search_routes

Search for routes by name or number. Returns matching routes with IDs. Use to resolve a route short name (e.g. "44") to a route ID for schedule or vehicle lookups with onebusaway_get_vehicles or onebusaway_get_schedule_for_route.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_search_routes",
    "arguments": {
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Route name or number (e.g. \"44\", \"Link\", or \"RapidRide\")."
    },
    "maxCount": {
      "default": 10,
      "description": "Maximum number of results to return. A positive integer, at most 100. Defaults to 10.",
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100
    }
  },
  "required": [
    "query",
    "maxCount"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_stop

Fetch details for a specific stop by ID. Returns the stop's name, coordinates, direction, served routes, and wheelchair accessibility. Stop IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_75403" for Metro Transit stop 75403).

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_stop",
    "arguments": {
      "stopId": "<stopId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "stopId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency-prefixed stop ID (e.g. \"1_75403\" for Metro Transit stop 75403, \"40_100239\" for Sound Transit). Use onebusaway_find_stops or onebusaway_search_stops to discover IDs."
    }
  },
  "required": [
    "stopId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_route

Fetch details for a specific route by ID. Returns short name, description, agency, route type, and schedule URL. Route IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_100259").

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_route",
    "arguments": {
      "routeId": "<routeId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "routeId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency-prefixed route ID (e.g. \"1_100259\"). Use onebusaway_find_routes or onebusaway_search_routes to discover IDs."
    }
  },
  "required": [
    "routeId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_list_routes_for_agency

List all routes operated by an agency. Returns route IDs, short names, and descriptions. Use to enumerate an agency's full service before searching for a specific route. Get agencyId values from onebusaway_list_agencies.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_list_routes_for_agency",
    "arguments": {
      "agencyId": "<agencyId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "agencyId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency ID (e.g. \"1\" for Metro Transit, \"40\" for Sound Transit). Use onebusaway_list_agencies to discover IDs."
    }
  },
  "required": [
    "agencyId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_arrivals

Real-time arrivals and departures at a stop. Returns predicted arrival times, schedule deviation (how many seconds late/early), vehicle positions, and any active service alerts. The predicted boolean on each arrival indicates whether GPS tracking backs the estimate — predicted=false means schedule-only. Use tripId from results for follow-up onebusaway_get_trip calls. Stop IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_75403").

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_arrivals",
    "arguments": {
      "stopId": "<stopId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "stopId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency-prefixed stop ID (e.g. \"1_75403\" for Metro Transit stop 75403). Use onebusaway_find_stops or onebusaway_search_stops to discover IDs."
    },
    "minutesBefore": {
      "default": 5,
      "description": "Include arrivals that departed up to this many minutes ago. Defaults to 5.",
      "type": "number"
    },
    "minutesAfter": {
      "default": 35,
      "description": "Include arrivals expected within the next N minutes. Defaults to 35.",
      "type": "number"
    }
  },
  "required": [
    "stopId",
    "minutesBefore",
    "minutesAfter"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_alert

Fetch full detail for a service alert (situation) by ID. Returns the summary, description, reason (e.g. detour, construction), affected stops and routes, consequence description, and active time windows. Situation IDs appear in onebusaway_get_arrivals responses under situationIds and situations[].id.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_alert",
    "arguments": {
      "situationId": "<situationId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "situationId": {
      "type": "string",
      "minLength": 1,
      "description": "Situation/alert ID from onebusaway_get_arrivals (situations[].id or arrivals[].situationIds[])."
    }
  },
  "required": [
    "situationId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_trip

Real-time status and stop sequence for a trip. Returns vehicle position, schedule deviation, current phase, and remaining stops. Use tripId from onebusaway_get_arrivals to look up a specific vehicle's progress.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_trip",
    "arguments": {
      "tripId": "<tripId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tripId": {
      "type": "string",
      "minLength": 1,
      "description": "Trip ID from an arrivals response or schedule lookup."
    },
    "serviceDateMs": {
      "description": "Service date as Unix milliseconds (midnight local time). Only needed for trips from a previous service day. Omit to use today.",
      "type": "number"
    },
    "includeSchedule": {
      "default": true,
      "description": "Whether to include the full stop sequence with times. Defaults to true.",
      "type": "boolean"
    }
  },
  "required": [
    "tripId",
    "includeSchedule"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_block

Fetch the full-day block schedule for a vehicle by block ID. A block is the ordered sequence of trips a single vehicle makes in one service day. Returns all trips in order with their stop times. Useful for 'when will this bus return?' and fleet tracking. Block IDs appear in onebusaway_get_trip responses under the schedule block field; obtain a tripId from onebusaway_get_arrivals first.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_block",
    "arguments": {
      "blockId": "<blockId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "blockId": {
      "type": "string",
      "minLength": 1,
      "description": "Block ID from a trip record. Obtain a tripId from onebusaway_get_arrivals, then call onebusaway_get_trip to get the blockId."
    }
  },
  "required": [
    "blockId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_vehicles

Real-time positions of all active vehicles for an agency. Optionally filter to a single route (client-side). Returns GPS coordinates, heading, schedule deviation, and current trip. Useful for "where are all the buses on route X right now?" Use agencyId values from onebusaway_list_agencies.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_vehicles",
    "arguments": {
      "agencyId": "<agencyId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "agencyId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency ID (e.g. \"1\" for Metro Transit, \"40\" for Sound Transit). Use onebusaway_list_agencies to discover IDs."
    },
    "routeId": {
      "description": "Optional agency-prefixed route ID to filter results to one route. Filtering is client-side — all agency vehicles are fetched first.",
      "type": "string"
    }
  },
  "required": [
    "agencyId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_schedule_for_stop

Full-day departure schedule for a stop. Lists every departure by route and direction for the specified date (defaults to today). Useful for planning or when real-time data isn't needed. For live predictions, use onebusaway_get_arrivals instead.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_schedule_for_stop",
    "arguments": {
      "stopId": "<stopId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "stopId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency-prefixed stop ID (e.g. \"1_75403\"). Use onebusaway_find_stops or onebusaway_search_stops to discover IDs."
    },
    "date": {
      "description": "ISO 8601 date (e.g. \"2026-05-23\"). Defaults to today in the agency's timezone.",
      "type": "string"
    }
  },
  "required": [
    "stopId"
  ],
  "additionalProperties": false
}
view source ↗

onebusaway_get_schedule_for_route

Full-day schedule for a route — all trips, stop sequences, and departure times for the specified date (defaults to today). Returns up to all trips for the route. For live predictions, use onebusaway_get_arrivals at specific stops instead.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "onebusaway_get_schedule_for_route",
    "arguments": {
      "routeId": "<routeId>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "routeId": {
      "type": "string",
      "minLength": 1,
      "description": "Agency-prefixed route ID (e.g. \"1_100259\"). Use onebusaway_find_routes or onebusaway_search_routes to discover IDs."
    },
    "date": {
      "description": "ISO 8601 date (e.g. \"2026-05-23\"). Defaults to today.",
      "type": "string"
    }
  },
  "required": [
    "routeId"
  ],
  "additionalProperties": false
}
view source ↗

Resources

2

Stop metadata — name, coordinates, served routes, and wheelchair accessibility. Stop IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_75403").

uri onebusaway://stop/{stopId} mime application/json

Route metadata — short name, description, agency, schedule URL. Route IDs use agency-prefixed format: {agencyId}_{localId} (e.g. "1_100259").

uri onebusaway://route/{routeId} mime application/json