Token导航 LogoToken导航TokenDH.com
Oc Transpo MCP logo
AI代理stdio官方级别未说明来源级核验

Oc Transpo MCP

MCP Server

为AI代理和开发者提供实时公交数据的模型上下文协议(MCP)服务器。

工具数

3

提示词数

0

GitHub Stars

2

资源数

0
PythonAPI集成AI代理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

dwdraju

提供方

dwdraju

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run mcp-server.py

详细介绍

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 
  1. Configure environment variables:

Create a .env file in the root directory:

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

目录标签

目录标签

PythonAPI集成AI代理实时公交数据本地部署GTFS-RT支持MCP协议公共交通

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP