Skip to main content
Glama

CATA Bus MCP Server

๐ŸšŒ CATA Bus MCP Server

A Model Context Protocol (MCP) server that provides live and static schedule data for the Centre Area Transportation Authority (CATA) bus system in State College, PA.

๐ŸŒŸ Features

  • Real-time vehicle positions - Track buses live on their routes

  • Trip updates - Get delay information and predicted arrivals

  • Service alerts - Stay informed about detours and disruptions

  • Static schedule data - Access routes, stops, and scheduled times

  • Fast in-memory storage - No database required, pure Python performance

๐Ÿš€ Quick Start

Installation

# Clone the repository git clone https://github.com/yourusername/catabus-mcp.git cd catabus-mcp # Install dependencies pip install -e .

Running the Server

# Run in stdio mode (for MCP clients) python -m catabus_mcp.server # Run in HTTP mode (for testing) python -m catabus_mcp.server --http

The HTTP server will be available at http://localhost:7000

๐Ÿ› ๏ธ Available Tools

Tool

Description

Parameters

list_routes

Get all bus routes

None

search_stops

Find stops by name/ID

query: string

next_arrivals

Get upcoming arrivals at a stop

stop_id: string

,

horizon_minutes?: int

vehicle_positions

Track buses on a route

route_id: string

trip_alerts

Get service alerts

route_id?: string

๐Ÿ’ป API Examples

Using with cURL (HTTP mode)

# List all routes curl -X POST http://localhost:7000/mcp \ -H "Content-Type: application/json" \ -d '{"method":"list_routes_tool","params":{}}' # Search for stops curl -X POST http://localhost:7000/mcp \ -H "Content-Type: application/json" \ -d '{"method":"search_stops_tool","params":{"query":"HUB"}}' # Get next arrivals curl -X POST http://localhost:7000/mcp \ -H "Content-Type: application/json" \ -d '{"method":"next_arrivals_tool","params":{"stop_id":"PSU_HUB","horizon_minutes":30}}'

Integration with ChatGPT

  1. Install the MCP client in ChatGPT

  2. Add this server configuration:

{ "name": "catabus", "command": "python", "args": ["-m", "catabus_mcp.server"], "description": "CATA bus schedule and realtime data" }
  1. Ask questions like:

    • "When is the next N route bus from the HUB?"

    • "Are there any service alerts for the V route?"

    • "Show me all buses currently on the W route"

Integration with Claude Desktop

Add to your Claude Desktop configuration:

{ "mcpServers": { "catabus": { "command": "python", "args": ["-m", "catabus_mcp.server"] } } }

๐Ÿงช Development

Running Tests

# Install dev dependencies pip install -e ".[dev]" # Run tests pytest # Run with coverage pytest --cov=catabus_mcp

Code Quality

# Format code black src/ # Lint ruff check src/ # Type checking mypy src/catabus_mcp/

๐Ÿ“Š Data Sources

This server uses official CATA data feeds:

Data is cached locally and updated:

  • Static GTFS: Daily

  • Realtime feeds: Every 15 seconds

๐Ÿ—๏ธ Architecture

catabus-mcp/ โ”œโ”€โ”€ src/catabus_mcp/ โ”‚ โ”œโ”€โ”€ ingest/ # Data loading and polling โ”‚ โ”‚ โ”œโ”€โ”€ static_loader.py โ”‚ โ”‚ โ””โ”€โ”€ realtime_poll.py โ”‚ โ”œโ”€โ”€ tools/ # MCP tool implementations โ”‚ โ”‚ โ”œโ”€โ”€ list_routes.py โ”‚ โ”‚ โ”œโ”€โ”€ search_stops.py โ”‚ โ”‚ โ”œโ”€โ”€ next_arrivals.py โ”‚ โ”‚ โ”œโ”€โ”€ vehicle_positions.py โ”‚ โ”‚ โ””โ”€โ”€ trip_alerts.py โ”‚ โ””โ”€โ”€ server.py # FastMCP server โ””โ”€โ”€ tests/ # Test suite

โšก Performance

  • Warm cache response time: < 100ms for all queries

  • Memory usage: ~50MB with full GTFS data loaded

  • Rate limiting: Respects CATA's 10-second minimum between requests

๐Ÿ“ License

MIT License - See LICENSE file

๐Ÿ™ Attribution

Transit data provided by Centre Area Transportation Authority (CATA). This project is not affiliated with or endorsed by CATA.

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Write tests for new functionality

  4. Ensure all tests pass

  5. Submit a pull request

๐Ÿ“ž Support

๐ŸŽฏ Roadmap

  • Add trip planning capabilities

  • Support for accessibility features

  • Historical data analysis

  • Geospatial queries (nearest stop)

  • Multi-agency support

โœ… Manual Acceptance Checklist

  • pip install -e . completes without errors

  • python -m catabus_mcp.server starts successfully

  • Static GTFS data loads on startup

  • Realtime polling begins automatically

  • list_routes_tool returns CATA routes

  • search_stops_tool finds stops by query

  • next_arrivals_tool returns predictions with delays

  • vehicle_positions_tool shows bus locations

  • trip_alerts_tool displays active alerts

  • Tests pass with pytest

  • Type checking passes with mypy


Version: 0.1.0
Status: Production Ready
Last Updated: 2024

Deploy Server
A
security โ€“ no known vulnerabilities
-
license - not tested
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Provides real-time and scheduled bus data for the Centre Area Transportation Authority (CATA) in State College, PA. Enables users to track live bus positions, get arrival predictions, search stops, view routes, and receive service alerts through natural language queries.

  1. ๐ŸŒŸ Features
    1. ๐Ÿš€ Quick Start
      1. Installation
      2. Running the Server
    2. ๐Ÿ› ๏ธ Available Tools
      1. ๐Ÿ’ป API Examples
        1. Using with cURL (HTTP mode)
        2. Integration with ChatGPT
        3. Integration with Claude Desktop
      2. ๐Ÿงช Development
        1. Running Tests
        2. Code Quality
      3. ๐Ÿ“Š Data Sources
        1. ๐Ÿ—๏ธ Architecture
          1. โšก Performance
            1. ๐Ÿ“ License
              1. ๐Ÿ™ Attribution
                1. ๐Ÿค Contributing
                  1. ๐Ÿ“ž Support
                    1. ๐ŸŽฏ Roadmap
                      1. โœ… Manual Acceptance Checklist

                        Related MCP Servers

                        • A
                          security
                          -
                          license
                          A
                          quality
                          Facilitates real-time access to Singapore's Land Transport Authority (LTA) transportation data, offering insights into bus arrivals, train services, traffic conditions, and more through integration with the LTA DataMall API.
                          Last updated -
                          7
                          3
                        • -
                          security
                          -
                          license
                          -
                          quality
                          Provides real-time access to Bangalore's public transportation information including bus tracking, schedules, routes, and service updates to improve passenger experience.
                          Last updated -
                          3
                          MIT License
                        • A
                          security
                          -
                          license
                          A
                          quality
                          A Model Context Protocol server that provides real-time Caltrain schedule information, allowing AI assistants to look up train departures between any stations and access station information using GTFS data.
                          Last updated -
                          2
                          6
                        • -
                          security
                          -
                          license
                          -
                          quality
                          An MCP server for accessing college basketball statistics through the SportsData.io CBB v3 Stats API, enabling AI agents to retrieve and analyze college basketball data through natural language interactions.
                          Last updated -

                        View all related MCP servers

                        MCP directory API

                        We provide all the information about MCP servers via our MCP API.

                        curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pranav-Karra-3301/catabus-mcp'

                        If you have feedback or need assistance with the MCP directory API, please join our Discord server