Skip to content
MCP server
Registry

Calgary Transit MCP Server

Calgary Transit live arrivals, service alerts, bus positions and on-time reliability.

Calgary Transit scores 68 (Good), licensed MIT and written in Python. It installs as a local process. It declares 6 tools. Filed under Uncategorized. GitHub shows 0 stars. Package registries report about 35 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by abiolrMITPython0 stars
Trust score
68Good
Trust score 68 of 100, Good

Good trust

68 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 68 comes from

22 + 20 + 2 + 10 + 4 + 10 = 68. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity2 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 2 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "abiolr-calgary-transit-mcp": {      "command": "uvx",      "args": [        "yyc-transit-mcp"      ],      "env": {        "DATABASE_URL": "YOUR_DATABASE_URL"      }    }  }}

Environment variables

NameRequiredNotes
DATABASE_URLSecretRequiredPostgres + PostGIS database kept up to date by yyc-transit-worker (see README).

Tools6Tool docs quality grade C

All capabilities
  • Reliability for two routes side by side

  • Stops by name ("Centre St and 16 Ave"), stop number ("#4585") or location, with the routes serving each

  • Next arrivals at a stop in the next 3 hours: live, scheduled or cancelled

  • Active detours, closures and delays for a route or stop

  • Historical on-time %, median and 90th-percentile delay, by time of day

  • Live bus positions on a route, with headsign and delay

About

yyc-transit-mcp

CI

An MCP server that lets AI assistants answer "when's my bus, and can I trust it?" with Calgary Transit data:

  • live arrivals;
  • service alerts;
  • bus positions;
  • historical on-time reliability, which it measures itself from the live feeds.

When's the next 3 at Centre St and 16 Ave? The next Route 3 at Centre St and 16 Ave is the northbound one at 11:52 PM tonight, but that time is scheduled only, with no live tracking. The next live-tracked northbound buses are at 12:26 AM and 12:51 AM.

How reliable is route 1? About 85.8% of observed trips were on time (within 1 minute early to 5 minutes late)… However, this is based on only 1 day of data (239 observations), so the history is too short to be a solid measure.

Plan me a trip from Tuscany to the airport with two transfers. I can't plan multi-leg trips with transfers… Calgary Transit's trip planner or app can do that.

These are real answers from the eval suite (Claude Haiku 5.5), lightly trimmed.

Use the hosted server

A public instance runs at:

https://mcp-production-5d8ac39d.up.railway.app/mcp

Nothing to install:

  • Claude.ai or Claude Desktop: Settings → Connectors → Add custom connector, then paste the URL above.
  • Claude Code:
    claude mcp add --transport http yyc-transit https://mcp-production-5d8ac39d.up.railway.app/mcp
    

Then ask: "When's the next train at City Hall?"

It's a hobby deployment with no uptime guarantee. A redeploy drops open sessions; reconnect and carry on. To run your own, see below.

Tools

ToolWhat it answers
find_stopsStops by name ("Centre St and 16 Ave"), stop number ("#4585") or location, with the routes serving each
next_arrivalsNext arrivals at a stop in the next 3 hours: live, scheduled or cancelled
route_alertsActive detours, closures and delays for a route or stop
vehicles_on_routeLive bus positions on a route, with headsign and delay
route_reliabilityHistorical on-time %, median and 90th-percentile delay, by time of day
compare_routesReliability for two routes side by side
  • Route names: riders can name routes the way they say them: "3", "route 3", "MAX Teal", "Red Line".
  • Times: all times are Calgary local time.
  • Freshness: every response says how fresh its data is (meta.data_as_of, meta.is_stale). Live predictions are withheld when the City's feed is stale.
  • Read-only: every tool only reads data.

Limitations

  • Calgary Transit only.
  • Direct routes only; no trip planning with transfers.
  • The City doesn't publish CTrain positions; CTrain arrivals and alerts work.
  • CTrain reliability isn't measured yet: the City's CTrain predictions are an hour off, and live arrivals correct for it, but the history waits until the correction is verified.
  • Reliability is computed from history the worker collects, so it needs a few days of running before the numbers mean much. Until then, results say enough_data: false.

How it fits together

City of Calgary open data            your machine / server
───────────────────────────          ───────────────────────────────────────────
static GTFS (nightly)  ──▶  worker ──▶  Postgres + PostGIS  ◀──  MCP server  ◀──  Claude
GTFS-Realtime (30 s)   ──▶           (schedule, live state,       (6 tools)
                                      delay history)

The worker has to run all the time: it keeps the live state current and writes the delay history that reliability is computed from. The MCP server only reads the database.

Run it yourself (Docker)

Needs Docker. This starts the database, runs the migrations, loads the schedule (about a minute) and starts polling the live feeds:

git clone https://github.com/Abiolr/calgary-transit-MCP.git
cd calgary-transit-MCP
docker compose up -d
docker compose logs -f worker    # wait for "rt_poll.done" lines

The MCP server is now at http://localhost:8000/mcp.

Connect your assistant

Claude Code:

claude mcp add --transport http yyc-transit http://localhost:8000/mcp

Claude Desktop, or any client that launches servers over stdio: run the server with uv and point it at the database:

{
  "mcpServers": {
    "yyc-transit": {
      "command": "uvx",
      "args": ["yyc-transit-mcp"],
      "env": { "DATABASE_URL": "postgresql://transit:transit@localhost:5432/transit" }
    }
  }
}

To try it without a client, use the MCP Inspector: npx @modelcontextprotocol/inspector, then connect to http://localhost:8000/mcp.

Install without Docker

You need Postgres 16 with PostGIS 3.

pip install yyc-transit-mcp            # or: uv tool install yyc-transit-mcp
export DATABASE_URL=postgresql://user:pass@host:5432/transit
yyc-transit-migrate                     # create or upgrade the schema
yyc-transit-worker                      # load the schedule, then poll; keep it running
yyc-transit-mcp                         # MCP server over stdio (default)
yyc-transit-mcp --transport streamable-http --host 0.0.0.0 --port 8000
CommandWhat it does
yyc-transit-migrateCreates or upgrades the database schema
yyc-transit-workerAlways-on: loads the schedule nightly and polls the live feeds every 30 s
yyc-transit-ingest --downloadLoads the latest schedule once (the worker does this for you)
yyc-transit-mcpThe MCP server (--transport stdio or streamable-http)
yyc-transit-agent "question"Asks Claude a question through the tools. Needs pip install "yyc-transit-mcp[agent]" and ANTHROPIC_API_KEY

Configuration

Set these as environment variables, or in a .env file in the working directory:

VariableDefault
DATABASE_URLpostgresql://transit:transit@localhost:5432/transitPostgres + PostGIS
RT_POLL_SECONDS30How often the worker polls the live feeds
RT_STALE_AFTER_SECONDS120Live data older than this is reported as stale
GTFS_STATIC_URL, GTFS_RT_*_URLCity of Calgary open dataFeed locations
ANTHROPIC_API_KEYOnly for yyc-transit-agent
AGENT_MODELclaude-haiku-5-5Model used by yyc-transit-agent

Hosting

Run the worker on an always-on host; if it sleeps, the reliability history gets gaps.

  • Resource use: about 70 MB of RAM for the worker and about 300 MB for Postgres.

  • History growth: tens of MB a day.

  • Railway (how the hosted server runs): a PostGIS template plus two services built from this repo's Dockerfile:

    • worker: start command yyc-transit-worker, pre-deploy yyc-transit-migrate;
    • mcp: start command yyc-transit-mcp --transport streamable-http --host 0.0.0.0 --port 8000, with a public domain whose target port is 8000. No pre-deploy step: the worker runs the migrations.

    Give both services DATABASE_URL from the PostGIS service's private (railway.internal) URL.

Evals

The repo includes an eval suite that measures how well an LLM uses the tools: 40 rider questions covering:

  • stops, arrivals, alerts, vehicles, reliability and comparisons;
  • questions out of scope that it should decline;
  • questions it should answer with honest uncertainty.

Ground truth comes from SQL against a frozen database snapshot, never from an LLM.

Claude Haiku 5.5, 40 cases × 3 runs:

BaselineNow
Answer correct94.2% (95% CI 88–97%)100% (95% CI 97–100%)
Right tools called100%100%
Latency p50 / p952.6 s / 6.1 s2.2 s / 4.3 s
Tool calls per question1.21.2
Cost of a full runabout $0.08about $0.08

All 7 baseline failures were arrival questions, caused by the tools rather than the model:

  • City Hall: a bus stop named "City Hall LRT Station" ranked above the CTrain platforms, which were listed as routes "201" and "202".
  • MAX Teal: results showed the route code "MT" without the name "MAX Teal".

The fixes:

  • CTrain and MAX lines are shown by name (Red Line (201), MAX Teal (MT));
  • station searches list CTrain platforms first;
  • find_stops takes a route, so a station's many bays narrow to the ones that route serves.

The suite is small, so 100% means these 40 questions pass, not that every question will.

Results are in .claude/hillclimb/transit-agent/ (baseline/, then v1/ and v2/); how to run the suite is in CONTRIBUTING.md.

More

Data & licence

Contains information licensed under the Open Government Licence – City of Calgary (City of Calgary open data). Every tool response carries this attribution. The data is fetched from the City at run time and isn't included in this package.

The code is MIT licensed; see LICENSE. This project is not affiliated with Calgary Transit or the City of Calgary.

Frequently asked questions

What is Calgary Transit MCP Server?

Calgary Transit live arrivals, service alerts, bus positions and on-time reliability.

How do I install Calgary Transit MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. Calgary Transit MCP Server runs locally from the PyPI package yyc-transit-mcp with the command uvx yyc-transit-mcp.

Is Calgary Transit MCP Server free and open source?

Yes. Calgary Transit MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does Calgary Transit MCP Server support remote (HTTP) connections?

No remote endpoint is listed for Calgary Transit MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does Calgary Transit MCP Server provide?

Calgary Transit MCP Server provides 6 tools, including compare_routes, find_stops, next_arrivals, and route_alerts. See the full tool list for descriptions and parameters.

How is Calgary Transit MCP Server's trust score calculated?

Calgary Transit MCP Server scores 68 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server