OC Transpo MCP Server

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.

Category
Visit Server

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

Setup

  1. Clone the repository:

    git clone <repository-url>
    
  2. Configure environment variables: Create a .env file in the root directory:

    Ocp_Apim_Subscription_Key=your_key_here
    
  3. 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.

  1. Build and Deploy:

    gcloud run deploy octranspo-mcp \
      --source . \
      --region us-central1 \
      --allow-unauthenticated \
      --set-env-vars Ocp_Apim_Subscription_Key=YOUR_API_KEY
    
  2. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured