PD

paulvonberg/db-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

22 stars 4 forks Качество 62 Тренд 10NOASSERTION

A comprehensive Model Context Protocol (MCP) server that provides unified access to Deutsche Bahn (DB) and German mobility APIs.

Обзор

A comprehensive Model Context Protocol (MCP) server that provides unified access to Deutsche Bahn (DB) and German mobility APIs. Built with Python, FastAPI, and FastMCP for seamless integration with Claude Desktop and other MCP clients. The server is ready for local and cloud deployment. A running MCP server is available to connect by adding the URL to your MCP Client: [SERVER DECOMISSIONED - HOST YOUR OWN DEPLOYMENT AS DESCRIBED]. - : Stations, timetables, real-time disruptions, and parking - : Full support for tools, prompts, and resources - : Security headers, rate limiting, input validation - : Clean, maintainable codebase structure - : Designed for Google Cloud Run deployment - : Comprehensive guides and reference materials - Python 3.11+ - Deutsche Bahn API credentials (Get them here) - Google Cloud account (for deployment) 2. Next, edit the new .env file with your DB API credentials. See the "Configuration" section for details on each variable.

README

Показан фрагмент оригинального README. Открыть оригинал.

Deutsche Bahn MCP Server

A comprehensive Model Context Protocol (MCP) server that provides unified access to Deutsche Bahn (DB) and German mobility APIs. Built with Python, FastAPI, and FastMCP for seamless integration with Claude Desktop and other MCP clients.

The server is ready for local and cloud deployment. A running MCP server is available to connect by adding the URL to your MCP Client: [SERVER DECOMISSIONED - HOST YOUR OWN DEPLOYMENT AS DESCRIBED].

🚀 Features

  • 🚄 Complete Railway Data: Stations, timetables, real-time disruptions, and parking
  • 🤖 MCP Protocol: Full support for tools, prompts, and resources
  • 🛡️ Production Ready: Security headers, rate limiting, input validation
  • 🏗️ Modular Architecture: Clean, maintainable codebase structure
  • ☁️ Cloud Native: Designed for Google Cloud Run deployment
  • 📚 Rich Documentation: Comprehensive guides and reference materials

📋 Quick Start (for developers - User instructions below)

Prerequisites

  • Python 3.11+
  • Deutsche Bahn API credentials (Get them here)
  • Google Cloud account (for deployment)

Local Development

  1. Clone and setup:

    git clone 
    cd deutsche-bahn-mcp-server
    python3 -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -r requirements.txt
    
  2. Configure environment:

    cp .env.example .env
    

    Next, edit the new .env file with your DB API credentials. See the “Configuration” section for details on each variable.

  3. Run the server:

    python main.py
    # Server available at http://localhost:8080
    

🎯 Live Server Usage Guide

[SERVER DECOMISSIONED - HOST YOUR OWN DEPLOYMENT AS DESCRIBED]

🖥️ Claude Desktop Setup

Step 1: Locate your configuration file

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\\Claude\\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Step 2: Edit the configuration Open the file and add the Deutsche Bahn server:

{
  "mcpServers": {
    "deutschebahn": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://[SERVER DECOMISSIONED - Use your URL]/mcp",
        "--transport", "http-only"
      ]
    }
  }
}

Step 3: Restart Claude Desktop

  • Close Claude Desktop completely
  • Reopen the application
  • You should see “Deutsche Bahn MCP Server” in the MCP section

Step 4: Test the connection Ask Claude: “What train stations are in Berlin?”

🌐 Claude.ai Web Usage

Step 1: Start a conversation Go to claude.ai and begin a new conversation.

Step 2: Add the MCP Server Click on “Search and Tools > Add connectors > Manage connectors” Select “Add custom connector” Enter a name, e.g.: “Deutsche Bahn MCP Server”

Открыть полный README на GitHub

Установка

npx -y mcp-remote https://[SERVER DECOMISSIONED - Use your URL
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "deutschebahn": { "command": "npx", "args": [ "-y", "mcp-remote", "https://[SERVER DECOMISSIONED - Use your URL]/mcp", "--transport", "http-only" ] } } }