OC Transpo MCP Server
Provides real-time transit data for OC Transpo in Ottawa, including live vehicle positions and trip updates via GTFS-RT feeds. It enables AI agents to monitor arrival delays, schedule changes, and transit telemetry through the Model Context Protocol.
README
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.
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_here -
Install dependencies:
uv sync
Usage
Running the MCP Server
Start the server using uv:
uv run mcp-server.py
Testing with MCP Inspector
You can visually test the tools using the MCP Inspector:
npx -y @modelcontextprotocol/inspector uv run mcp-server.py
Scripting Example
You can use the helper script check_route.py to filter vehicles by route ID:
uv run check_route.py 62
Deployment
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_KEY -
Access 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.