efa-cli terminal output showing a departures list

efa-cli v3.0: Now Also an MCP Server


The PHP version of efa-cli needed either a local PHP install or a compiled Phar file to work as something close to a single file. That's bothered me for two years. v3.0 fixes it: a full rewrite in Go, as a single static binary, plus a new efa mcp server that exposes the same four commands as tools for an AI assistant to call directly.

Why rewrite it

A single static binary means install.sh can just fetch the right file and drop it into /usr/local/bin — no runtime to install, no Phar to compile. The command structure, flags and output stayed the same on purpose — if you used efa-cli before, efa departures <stop> still works exactly like it did.

efa mcp

MCP (Model Context Protocol) is the standard that lets an AI assistant call external tools instead of guessing at an answer from what it already knows. efa mcp starts a Streamable HTTP server that exposes efa-cli's four commands — departures, messages, route and stopinfo — as tools an MCP client can call directly.

In practice this means I can ask Claude "when's the next 8 towards Kleinhüningen" or "any disruptions on the tram network right now" and it queries EFA live through my own server. No copy-pasting stop names into a search bar, no switching to a terminal — the assistant just has the tool available and uses it when it's relevant.

efa mcp [--ip=<ip>] [--port=<port>]

By default it binds to 127.0.0.1:8090, fine if client and server run on the same machine. To run it in a container and make it reachable from elsewhere on the network:

services: efa-mcp: image: ghcr.io/simonjenny/efa-cli:latest command: ["mcp", "--ip=0.0.0.0", "--port=8090"] ports: - "8090:8090"

The --ip=0.0.0.0 part matters — bind to 127.0.0.1 inside a container and nothing outside it will ever reach the server.

Update

Same install path as always:

curl -fsSL https://raw.githubusercontent.com/simonjenny/efa-cli/main/install.sh | sh

On Windows, the equivalent PowerShell one-liner is in the README. Building from source now needs Go 1.27 instead of PHP/Composer.