Skip to main content
Glama
Czech Railways (České dráhy) MCP Server

Czech Railways (České dráhy) MCP Server

by JanProvaznik

cd-mcp

MCP (Model Context Protocol) server for Czech Railways (České dráhy) API.

This server provides AI assistants with tools to search for train connections, stations, and prices on the Czech railway network.

Features

  • Search Locations: Find train stations and cities in the Czech Railways network

  • Search Connections: Search for train connections between two stations

  • Get Connection Details: Get detailed information about a specific connection

  • Get Passenger Types: List available passenger types and discount categories

  • Get Price Offers: Get pricing information for connections

Related MCP server: YHT Bilet MCP Server

Installation

npm install
npm run build

Usage

With Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "cd-mcp": {
      "command": "node",
      "args": ["/path/to/cd-mcp/dist/index.js"]
    }
  }
}

With MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Development

npm run dev

Available Tools

search_locations

Search for train stations and cities by name.

Parameters:

  • query (string, required): Search query (e.g., "Praha", "Brno")

  • type (string, optional): Location type filter (e.g., "station", "city")

search_connections

Search for train connections between two stations.

Parameters:

  • from (string, required): Departure station

  • to (string, required): Arrival station

  • departure (string, required): Departure date/time in ISO 8601 format

  • passengers (number, optional): Number of passengers (1-9, default: 1)

get_connection_details

Get detailed information about a specific connection.

Parameters:

  • handle (string, required): Connection search handle from previous search

  • connectionId (string, required): Connection identifier

get_passenger_types

Get available passenger types and discount categories.

Parameters: None

get_price_offer

Get a price offer for a connection (read-only, does not book tickets).

Parameters:

  • connectionId (string, required): Connection identifier

  • passengers (array, required): Array of passenger types and counts

Design Decisions

As a Principal Architect, the following design decisions were made:

  1. Read-only operations only: The server only exposes read operations (search, get details, pricing). Booking, payment, and refund operations are intentionally excluded for security reasons - these should require explicit user action through official channels.

  2. Stdio transport: Uses stdio transport for simple integration with MCP clients like Claude Desktop. HTTP transport can be added if needed.

  3. Error handling: All tools include proper error handling and return user-friendly error messages.

  4. Type safety: Full TypeScript implementation with proper type definitions for API responses.

  5. Formatting: Results are formatted for readability with emojis and structured text output.

API Reference

This server interfaces with the Czech Railways Ticket API:

License

MIT

Available Tools

5 tools
get_connection_detailsGet Connection DetailsA

Get detailed information about a specific train connection. Note: This endpoint is not available with the mobile API - all connection details are included in search results.

Inputs: handle (required), connectionId (required).

get_passenger_typesGet Passenger TypesA

Get a list of available passenger types and discount categories (e.g., adult, child, senior, student discounts).

Inputs: no named parameters.

get_price_offerGet Price OfferB

Get a price offer for a specific connection. Note: Prices are already included in connection search results, so this separate endpoint is not available with the mobile API.

Inputs: passengers (required), connectionId (required).

search_connectionsSearch ConnectionsB

Search for train connections between two stations. Returns available trains with departure times, duration, and transfers.

Inputs: to (required), from (required), departure (required), passengers.

search_locationsSearch LocationsA

Search for train stations and cities in the Czech Railways network. Use this to find station codes for connection searches.

Inputs: query (required), type.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 5 tools

    Disambiguation4/5

    Tools have distinct purposes, but get_connection_details and get_price_offer are noted as redundant with search results, which could cause agent confusion if they attempt to use them and fail.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case: get_* and search_*. No naming anomalies.

    Tool Count4/5

    5 tools is a reasonable size for a railway information server, but two tools are marked as unavailable with the mobile API, suggesting they could be removed.

    Completeness3/5

    Covers basic query operations (search stations, connections, passenger types), but lacks booking, real-time info, or station details, and duplicate tools reduce practical completeness.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers