Feedback

Caltrain MCP Server

@davidyen1124 Claim

Basic information

Runtime
Python
Version
1.0.0
Category
License
NOASSERTION
Transports
stdio
Author
davidyen1124
Submitted by
Community
Quality
25
Stars
10

About Caltrain MCP Server

Get real-time Caltrain schedules, station info, and trip planning. Check Caltrain hours and cal train time for your Bay Area commute.

Caltrain is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by davidyen1124. It exposes 2 tools, including next_trains, list_stations. Supported transport: stdio. Runtime: Python. The repository has 10 GitHub stars. Source code is hosted on github.com. Related topics: ai-assistant, analytics-data, bay-area, caltrain, claude-desktop.

Setup

{
    "mcpServers": {
        "caltrain": {
            "command": "uvx",
            "args": [
                "caltrain-mcp"
            ]
        }
    }
}

Caltrain MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "caltrain": {
            "command": "uvx",
            "args": [
                "caltrain-mcp"
            ]
        }
    }
}

Caltrain MCP Server tools

  • next_trains — Return the next few scheduled Caltrain departures. Args: origin: Station name (e.g. 'San Jose Diridon', 'Palo Alto', 'San Francisco'). Supports common abbreviations like 'SF' for San Francisco, 'SJ' for San Jose. If station is not found, use list_stations() to see all available options. destination: Station name (e.g. 'San Francisco', 'Mountain View', 'Tamien'). Supports common abbreviations like 'SF' for San Francisco, 'SJ' for San Jose. If station is not found, use list_stations() to see all available options. when_iso: Optional ISO-8601 datetime (local time). Default: now. Note: If you get a "Station not found" error, try using the list_stations() tool first to see exact station names, then retry with the correct spelling.
  • list_stations — List all available Caltrain stations. This tool is useful when you need to find the exact station names, especially if the next_trains() tool returns a "Station not found" error. Station names are case-insensitive and support some common abbreviations like 'SF' and 'SJ'. Returns a formatted list of all Caltrain stations that can be used as origin or destination in the next_trains() tool.

Overview

What is Caltrain?

caltrain-mcp is a Model Context Protocol server that provides Caltrain schedule information using official GTFS data. It is intended for users of MCP-compatible clients (like Claude Desktop) who need to look up train departures, stations, and travel times between any two Caltrain stops.

How to use Caltrain?

Configure caltrain-mcp in your MCP client (e.g., Claude Desktop) by adding "caltrain": { "command": "uvx", "args": ["caltrain-mcp"] } to the MCP configuration file. The server can also be tested directly via Python imports or started with uvx caltrain-mcp. It relies on local GTFS data that must be fetched first by running fetch_gtfs.py.

Key features of Caltrain

  • Real‑time (GTFS‑based) train schedules between any two stations
  • Look up all 31 Caltrain stations by full name, short name, or abbreviation
  • Query departures at a specific time using the when_iso parameter
  • Smart partial matching of station names (e.g., "diridon" matches "San Jose Diridon")
  • Supports weekday/weekend service calendars from official GTFS data

Use cases of Caltrain

  • Ask your AI assistant for the next trains from San Jose Diridon to San Francisco
  • Find all available Caltrain stations without memorizing names
  • Plan a commute at a precise time and date, using GTFS data
  • Get departure times for the Gilroy extension line

Frequently asked questions

1 What GTFS data does caltrain-mcp use?

It uses official Caltrain GTFS data, including stops.txt, trips.txt, stop_times.txt, and calendar.txt, which are downloaded by running fetch_gtfs.py.

2 How do I install and run caltrain-mcp?

Install the uv package manager, run uv sync to install dependencies, then download the GTFS data with uv run python scripts/fetch_gtfs.py. Finally, configure your MCP client to run uvx caltrain-mcp.

3 What tools does caltrain-mcp expose?

It exposes two tools: next_trains(origin, destination, when_iso=None) to get upcoming departures, and list_stations() to list all 31 Caltrain stations.

4 How does caltrain-mcp communicate?

The server communicates via stdin/stdout using the Model Context Protocol (MCP). It does nothing when run directly in a terminal.

5 Are there any known limitations?

The README notes that actual arrival times may vary and that the server relies on the official GTFS data, so accuracy depends on that data. It handles mixed integer/string GTFS fields and supports 24+ hour time format.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬