hafasmcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hafasmcpShow me departures from Bremen Hbf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
vibe-coded ✨
hafasmcp
MCP server for real-time German public transport data via HAFAS. Lets Claude (or any MCP client) query departures, arrivals, journeys, and nearby stops — currently configured for the VBN network (Lower Saxony / Bremen).
No API key needed. Uses the same public HAFAS API as fahrplaner.vbn.de.
Tools
Tool | Description |
| Search stops, addresses, or POIs by name |
| Upcoming departures from a stop |
| Upcoming arrivals at a stop |
| Route planning between two locations |
| Find stops near a coordinate |
Related MCP server: db-mcp
Quick Start
With Claude Code (stdio)
Add to your MCP config:
{
"mcpServers": {
"hafas": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/path/to/hafasmcp"
}
}
}With Docker (HTTP + OAuth 2.1)
cp .env.example .env
docker compose up -dThis starts the HTTP server on port 3000 with a Cloudflare quick tunnel for remote access.
Local Development
npm install
npm run build
npm start # stdio mode
npm run start:http # HTTP mode with OAuth 2.1Environment Variables
Variable | Default | Description |
|
| HTTP server port |
|
| OAuth 2.1 issuer URL |
How It Works
The server wraps hafas-client with the VBN profile and exposes it as MCP tools. Two transport modes:
Stdio — for local MCP clients like Claude Code, zero config
HTTP — for remote access, with full OAuth 2.1 (dynamic client registration, PKCE, auto-approve)
Example
Ask Claude:
"Wann fährt die nächste Straßenbahn vom Hauptbahnhof Bremen?"
Claude will use locations to find the stop ID, then departures to get real-time data — all in under a second.
Stack
TypeScript, Node.js, hafas-client, @modelcontextprotocol/sdk, Express 5
License
ISC
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server for interacting with the Berlin Public Transport (BVG) API to search for locations and plan journeys. It provides real-time access to departures, arrivals, trip details, and vehicle tracking within Berlin's transit network.Last updatedMIT
- AlicenseAqualityBmaintenanceAn MCP server that exposes the Deutsche Bahn public transport API to any MCP-compatible client (Claude Desktop, Cursor, Cline, Continue, etc.). Five tools cover station search, departures, journey planning, trip details, and nearby stations.Last updated6MIT
- AlicenseAqualityAmaintenanceMCP server for Atlanta MARTA real-time transit data, enabling queries about train arrivals and bus positions via natural language.Last updated4MIT
- FlicenseAqualityDmaintenanceMCP server for querying German public transport information, including station search, live departures/arrivals, and journey planning.Last updated5
Related MCP Connectors
Geo-based flight search MCP server. Find more flights between any two places on earth
MCP server wrapping the Tesla Fleet API and TeslaMate API
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mchristoffers/hafasmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server