Sign inTry it

Deutsche Bahn MCP server: let your AI agent search train connections with prices

Wield is an MCP server that gives your AI agent Deutsche Bahn tools. The main tool searches connections between two stations on a date and returns departure and arrival times, transfers and the cheapest fare for the class you choose. The search runs in your own browser, because bahn.de rejects requests that lack the browser's own cookies. Your passwords and cookies never leave your computer.

Updated

Live recipebahn.de/search-connectionsv2

Deutsche Bahn Search train connections between two stations with prices

Read-only, no loginRuns in your browser only

Parameters (8)
adultsintegerNumber of adult travellers without discount card
datestringrequiredTravel date YYYY-MM-DD
fromstringrequiredDeparture station, e.g. 'Berlin Hbf', 'Hamburg'
modestringABFAHRT = depart at or after time, ANKUNFT = arrive by time "ABFAHRT" | "ANKUNFT"
page_refstringnext_page_ref from a previous result, to get later connections with otherwise identical params
timestringHH:mm, Europe/Berlin local time
tostringrequiredArrival station, e.g. 'München Hbf'
travel_classstring2nd or 1st class (changes the price) "KLASSE_2" | "KLASSE_1"
Use it with your agent
Measured on the live site
MetricWield recipeBrowser Use + Claude Sonnet 5.5
Success100%0%
Median time2.1 s676 s
Cost per run$0$0.589

9 runs each, 7 November 2026. How we measure

Wield recipes for Deutsche Bahnbahn.de
Everything for Deutsche Bahn

What your agent gets

A Wield recipe is a small public file that describes the request bahn.de's own search makes. Your agent runs it through wield-mcp, the local MCP server on your computer.

RecipeWhat it doesLoginStatus (7 Nov 2026)
bahn.de/search-connectionsFinds connections by train, bus or S-Bahn, with times, duration, transfers, platforms and the cheapest fareNoPending: no live check from a user's browser yet
bahn.de/my-bookingsLists your upcoming trips and ticketsYesUntested. Skeleton only, not run

The connection search takes two stations, a date, a time, depart-after or arrive-by mode, first or second class, and the number of adults. Station names are free text, and the first match is used. The how-to guide shows example prompts.

How a request flows

  1. You ask your agent for the fastest train from Berlin Hbf to München Hbf on a given morning.
  2. The agent calls find_recipe, then run with bahn.de/search-connections.
  3. wield-mcp passes the run through a local bridge to the Wield extension in your browser.
  4. The extension sends the request from a bahn.de tab, with your own session.
  5. The results return to your agent. Nothing passes through wield.run.

What leaves your computer

  • Three requests to www.bahn.de per search.
  • Wield never reads, copies or sends your cookies or passwords.
  • Results go to your AI app and are marked as website content, so your agent is told not to follow instructions found in them.
  • Logs stay on your computer. They never record request bodies or query values.

Recipes are data, not code, and no JavaScript from the registry runs in the page. The registry signs every recipe with Ed25519, and wield-mcp refuses a recipe that is unsigned or has changed. Wield sends no Cookie or Host headers, and it redacts derived tokens from results and logs.

Deutsche Bahn terms, in plain words

The recipe's notes say bahn.de's terms do not allow automated bulk queries of timetable or fare data. This recipe runs one search at a time that you start, at human pace. Do not poll it or page through results in bulk. It never books. Booking and payment stay with you on bahn.de.

Limits and what is not working yet

  • The connection search is pending. Its extraction was tested on sample responses, but a live check on bahn.de still needs a user's own browser.
  • The bookings recipe is untested. It needs a recording from a logged-in session before it can be used.
  • In our benchmark, Wield passed 9 of 9 runs. That benchmark covers one search task.
  • If the site's bot protection shows a check, Wield stops and asks you to solve it in your own tab. Wield never tries to solve a check itself.

Every run stops at 12 steps, 40 requests, 5 MB per response or 60 seconds. Pacing is set per site, so a single search cannot run away.

FAQ

Is there an official Deutsche Bahn MCP server?

Not that we know of as of 7 November 2026.

Which AI apps work with it?

Any MCP client. npx -y wield-mcp init sets up Claude Desktop, Claude Code, Cursor and Codex. Claude Desktop also has a one-click bundle on wield.run/install.

Does it need a login?

The connection search needs no login. Listing your bookings does need one, and that recipe is still untested.

How fast is it compared with a browser agent?

As of 7 November 2026, in our preliminary benchmark, the recipe passed 9 of 9 runs with a median of 2,127 ms and no model cost. Browser Use driving Claude Sonnet 5.5 passed 0 of 1 runs. Bot protection blocked that one run, which took a median of 675.9 s and cost $0.59. One run is too few to draw a conclusion. The full method is on the benchmark page.