How Do I Let an AI Assistant Validate GTFS Feeds?

By Igor Akimov, maintainer of GTFS Guru

Install gtfs-guru-mcp, the GTFS Guru MCP server, and register it in your assistant with --allow-dir pointing at the folder that holds your feeds. The assistant can then list your feeds, validate them, and explain the results using exact notice totals and real examples from the report.

MCP (Model Context Protocol) is the standard way for an AI client to call local tools. The server runs on your own machine, started by the client. It is read-only: it never writes to a feed, and it can only open files under the folders you allow. It runs the same Rust validator as the browser app and the CLI.

What the server exposes

Four tools:

The totals are counted by the validator, not estimated by the model. When the assistant says a feed has a given number of foreign_key_violation errors, that number comes from the report.

Install the server

Every GitHub release attaches gtfs-guru-mcp archives for Linux (x86_64, x86_64-musl, aarch64), macOS (x86_64, arm64, universal) and Windows (x64). Unpack one and put the binary on your PATH, for example on Linux:

tar -xzf gtfs-guru-mcp-linux-x86_64.tar.gz
sudo install -m 755 gtfs-guru-mcp /usr/local/bin/

With a Rust toolchain you can install it from crates.io instead:

cargo install gtfs-guru-mcp

The Developers section on the home page has a "Connect your AI assistant" dialog that builds the install commands and client config for your operating system.

Connect your assistant

Most clients take the same JSON block. Replace the path with the folder that holds your feeds:

{
  "mcpServers": {
    "gtfs-guru": {
      "command": "gtfs-guru-mcp",
      "args": ["--allow-dir", "/path/to/feeds"]
    }
  }
}

A client started from a desktop icon often does not inherit your shell's PATH. If the server does not start, give command the absolute path to the binary. Then ask something like "Which GTFS feeds do I have, and what are the errors in the newest one?"

What stays on your machine

What the server returns to your assistant (totals, the profile, and the example rows) becomes part of your conversation, so it goes wherever your assistant sends its context. Use --notice-examples-per-group 0 to return only the grouped totals and no example rows.

Remote clients over HTTP

For a client that cannot start a local process, the server also speaks stateless Streamable HTTP, protected by a bearer token of at least 32 bytes:

export GTFS_GURU_MCP_BEARER_TOKEN="$(openssl rand -hex 32)"
gtfs-guru-mcp --transport http --bind 127.0.0.1:3000 --allow-dir /path/to/feeds

The endpoint is /mcp. Put TLS in front of it with a reverse proxy before exposing it, and pass the public hostname with --allowed-host. By default the HTTP transport allows 60 authenticated requests per rolling minute, four concurrent validations and 64 KiB request bodies. The MCP setup guide covers every option.

FAQ

Does the AI decide whether my feed is valid?

No. The validator decides, using the same rules and notice codes as the rest of GTFS Guru. The assistant reads the result and can paraphrase it, but the counts and examples come from the report.

Can the assistant fix my feed through MCP?

No. The server is read-only and never writes to a feed. It can return a suggested fix per example, and the CLI's --fix option writes a repaired copy if you want to apply those changes yourself.

Which assistants work with it?

Any MCP client that can start a local stdio server, or connect to an HTTP one. The setup dialog on the home page has ready-made config for Claude Code, Claude Desktop, Cursor, VS Code, Codex CLI and OpenCode.

Related Questions

• How do I validate my GTFS feed?

• How do I validate GTFS in Python?

• How do I validate GTFS in CI?

• gtfs-guru-mcp source on GitHub

Prefer to look at a report yourself? Validate a feed in your browser. The file stays on your device.