OC Transpo MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
OC Transpo MCP Server for Learning
A Model Context Protocol (MCP) server for OC Transpo Ottawa, providing real-time transit data to AI agents and developers.
Features
get_vehicle_positions: Retrieves real-time latitude, longitude, and trip info for all active buses and trains.get_trip_updates: Fetches real-time arrival/departure delays and schedule updates.get_service_alerts: (Coming Soon) Standardized access to service disruptions (pending OC Transpo API activation).FastMCP Integration: Lightweight and easy to use with any MCP-compatible agent.
GTFS-RT Support: Native protocol buffer parsing for live transit feeds.
Related MCP server: ttc-mcp
Prerequisites
Python 3.10+
uv (recommended for dependency management)
OC Transpo API Subscription Key (Get one at the OC Transpo Developer Portal)
Setup
Clone the repository:
git clone <repository-url>Configure environment variables: Create a
.envfile in the root directory:Ocp_Apim_Subscription_Key=your_key_hereInstall dependencies:
uv sync
Usage
Running the MCP Server
Start the server using uv:
uv run mcp-server.pyTesting with MCP Inspector
You can visually test the tools using the MCP Inspector:
npx -y @modelcontextprotocol/inspector uv run mcp-server.pyScripting Example
You can use the helper script check_route.py to filter vehicles by route ID:
uv run check_route.py 62Deployment
Google Cloud Run
You can deploy this server to Google Cloud Run to make it accessible over the internet via HTTPS.
Build and Deploy:
gcloud run deploy octranspo-mcp \ --source . \ --region us-central1 \ --allow-unauthenticated \ --set-env-vars Ocp_Apim_Subscription_Key=YOUR_API_KEYAccess the Server: The server is probably live at:
https://octranspo-mcp-PROJECT_ID.us-central1.run.app/mcp
Project Structure
mcp-server.py: Main MCP server implementation.octranspo.py: API helper for GTFS-RT fetching and parsing.check_route.py: CLI tool for filtering live data.test_api.py: Connectivity and data parsing verification script.
License
MIT
Made with ❤️ by Antigravity
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time transit stops, routes, arrivals, vehicle positions, and schedules via OneBusAway APIs.
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
Belgian trains for AI agents: live journeys, departures, delays, disruptions. Free, no key.
Provide real-time transportation data including bus arrivals, train service alerts, carpark availa…
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides access to real-time Winnipeg Transit data and 311 City Services, enabling AI assistants to plan trips, check bus arrivals, and search for reported city issues. It allows users to interact with city infrastructure data and transit schedules through natural language.81MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server for Toronto Transit Commission (TTC) that exposes subway, streetcar, and bus schedules, real-time arrivals, vehicle positions, and service alerts, plus multi-modal trip planning.1215 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access real-time public transport data for Moscow and the Moscow region, aggregating and reconciling information from multiple sources. Provides tools for finding stops, live arrival boards, vehicle tracking, route details, and ETA calculations.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to access real-time and scheduled public transit data, including routes, stops, departures, and service alerts, across multiple US metropolitan areas.5MIT