DB Timetable MCP Server
DB 时刻表 MCP 服务器
德国铁路时刻表 API 的模型上下文协议 (MCP) 服务器。该服务器提供 MCP 工具和资源来访问时刻表数据、车站信息和列车变更。
命名义务:
该项目提供德国铁路时刻表数据,根据知识共享署名 4.0 国际许可协议 (CC BY 4.0)向公众开放。
有关 API 和许可条件的更多信息,请访问developers.deutschebahn.com 。 API 请求受许可条款的约束。
功能
当前时刻表:检索车站的当前时刻表数据
时间表变更:跟踪最新变更
计划时间表:访问特定时间的计划时间表数据
车站搜索:按名称或代码搜索火车站
Related MCP server: db-mcp
要求
Node.js 18 或更高版本
DB 时间表 API 的 API 凭证(客户端 ID 和客户端密钥)
安装
克隆存储库:
git clone <repository-url> cd db-mcp安装依赖项:
npm install编译 TypeScript 代码:
npm run build
配置
在项目根目录中创建一个.env文件,其中包含以下环境变量:
DB_TIMETABLE_CLIENT_ID=deine-client-id
DB_TIMETABLE_CLIENT_SECRET=dein-client-secret
TRANSPORT_TYPE=stdio
PORT=8080
SSE_ENDPOINT=/sse
LOG_LEVEL=info配置选项
DB_TIMETABLE_CLIENT_ID:DB API 的客户端 ID(必需)DB_TIMETABLE_CLIENT_SECRET:DB API 的客户端密钥(必需)TRANSPORT_TYPE:MCP 服务器的传输类型(stdio或sse,默认值:stdio)PORT:SSE 服务器的端口(默认值:8080)SSE_ENDPOINT:SSE 连接的端点(默认值:/sse)LOG_LEVEL:日志级别(debug,info,warn,error,默认值:info)
使用
启动服务器
在 stdio 模式下(用于 CLI 测试和调试):
npm start在 SSE 模式下(针对 Web 客户端):
TRANSPORT_TYPE=sse npm start使用检查模式进行测试
可以使用 FastMCP Inspector 测试服务器:
npx fastmcp inspect path/to/index.jsMCP 工具
该服务器提供以下工具:
getCurrentTimetable :检索车站的当前时刻表数据
参数:
evaNo- 车站的 EVA 编号(例如法兰克福 Hbf 的 EVA 编号为 8000105)
getRecentChanges :检索电台的最近更改
参数:
evaNo- 车站的 EVA 编号(例如法兰克福 Hbf 的 EVA 编号为 8000105)
getPlannedTimetable :检索车站的计划时刻表数据
范围:
evaNo- 车站的 EVA 编号(例如法兰克福 Hbf 的 EVA 编号为 8000105)date- YYMMDD 格式的日期(例如 230401 表示 01.04.2023)hour- HH 格式的小时(例如 14 表示下午 2 点)
findStations :使用搜索模式搜索车站
参数:
pattern- 搜索模式(例如“Frankfurt”或“BLS”)
MCP 资源
服务器提供以下资源:
当前时间表数据:
db-api:timetable/current/{evaNo}当前时间表变更:
db-api:timetable/changes/{evaNo}计划时间表数据:
db-api:timetable/planned/{evaNo}/{date}/{hour}站点搜索:
db-api:station/{pattern}
发展
项目结构
db-mcp/
├── src/
│ ├── api/ # API-Client und Typen
│ ├── tools/ # MCP-Tools
│ ├── resources/ # MCP-Ressourcen
│ ├── utils/ # Hilfsfunktionen
│ ├── config.ts # Konfiguration
│ └── index.ts # Haupteinstiegspunkt
├── dist/ # Kompilierte Dateien
├── .env # Umgebungsvariablen
├── package.json
├── tsconfig.json
└── README.mdNPM 脚本
npm run build:编译 TypeScript 代码npm start:启动服务器npm run dev:以开发模式启动服务器并自动重新加载npm test:运行测试
可扩展性
潜在的扩展
数据处理和丰富
语义时间表数据处理:将 XML 转换为具有语义丰富的结构化 JSON
延误和中断的历史数据分析
多式联运连接的整合
先进的 MCP 工具
站间路线规划
基于人工智能的延误和容量预测
出行中断分析
车站和连接点的无障碍检查
执照
MCP 服务器: MIT 许可证
DB 时刻表 API:知识共享署名 4.0 国际许可证
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
- Flicense-qualityCmaintenanceProvides unified access to Deutsche Bahn APIs for real-time railway data, station information, timetables, disruptions, parking, and accessibility services.18
- 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.6MIT
- FlicenseAqualityDmaintenanceMCP server for querying German public transport information, including station search, live departures/arrivals, and journey planning.5
- AlicenseAqualityDmaintenanceProvides access to Deutsche Bahn's timetable data through MCP, enabling real-time train schedules, station search, and change tracking for German railway stations.470MIT
Related MCP Connectors
Swiss Transport MCP — wraps Transport Open Data API (free, no auth)
iRail MCP — Belgian rail (SNCB/NMBS) real-time via the community iRail API
TravelMind: 8 MCP tools for travel (12306 trains, flights, hotels, geocode, planning, policy).
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/jorekai/db-timetable-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server