KM

kryzo/mcp-sncf

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 6 forks 质量 49 趋势 10

该项目为SNCF API提供了模块化的Python包装器,配备MCP服务器接口,可无缝集成Claude Desktop,实现智能行程规划和列车信息......

概览

该项目为SNCF API提供模块化的Python包装器,配备MCP服务器接口,可无缝集成Claude Desktop,实现全法国的智能行程规划和列车信息检索。 SNCF MCP 服务器为法国国家铁路(SNCF)的 API 服务提供了全面的接口,允许您: - 规划法国各城市间的列车行程 - 获取火车站详细信息 - 查看发车和到达时刻表 - 监控服务中断 - 查找附近地点和交通选择 - sncf_api/ - SNCF API 交互的主要包 - .py - 包初始化 - config.py - 配置设置 - client.py - 基础 API 客户端 - api.py - 合并所有模块的主 API 接口 - search.py - 搜索相关端点 - journey.py - 行程规划端点 - stations.py - 车站相关端点 - networks.py - 网络和传输模式端点 - 中断。

概述(AI 翻译)

该项目为SNCF API提供模块化的Python包装器,配备MCP服务器接口,可无缝集成Claude Desktop,实现全法国的智能行程规划和列车信息检索。

目录

  • 概述
  • 特色
  • 安装
  • 获取API密钥
  • 配置
  • 设置 Claude 桌面
  • 环境变量
  • 可用的MCP工具
  • 行程规划
  • 车站信息
  • 中断监测
  • 使用示例
  • 故障排除
  • 高级功能

概述

SNCF MCP 服务器为法国国家铁路(SNCF)的 API 服务提供了全面的接口,允许您:

  • 规划法国各城市间的列车行程
  • 获取火车站的详细信息
  • 查询出发和到达时刻表
  • 监控服务中断
  • 查找附近地点和交通选择

该组织结构如下:

  • sncf_api/ - SNCF API 交互的主要包
  • __init__.py - 包初始化
  • config.py - 配置设置
  • client.py - 基础API客户端
  • api.py - 主API接口,将所有模块组合在一起
  • search.py - 搜索相关端点
  • '旅程。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

SNCF API MCP Server

This project provides a modular Python wrapper for the SNCF API, with an MCP server interface that integrates seamlessly with Claude Desktop for intelligent journey planning and train information retrieval across France.

Table of Contents

Overview

The SNCF MCP Server provides a comprehensive interface to the French National Railway’s (SNCF) API services, allowing you to:

  • Plan train journeys between cities in France
  • Get detailed information about train stations
  • Check schedules for departures and arrivals
  • Monitor service disruptions
  • Find nearby places and transport options

The structure is organized as follows:

  • sncf_api/ - The main package for SNCF API interaction
    • __init__.py - Package initialization
    • config.py - Configuration settings
    • client.py - Base API client
    • api.py - Main API interface combining all modules
    • search.py - Search-related endpoints
    • journey.py - Journey planning endpoints
    • stations.py - Station-related endpoints
    • networks.py - Network and transport mode endpoints
    • disruptions.py - Disruption-related endpoints
    • station_finder.py - Efficient station lookup by coordinates
    • csv_station_finder.py - Station lookup using CSV database
    • vehicle_journey.py - Detailed train journey information
  • sncf_server.py - MCP server implementation with all tool endpoints
  • train_stations_europe.csv - Database of European train stations with coordinates

Features

  • Intelligent Journey Planning: Plan trips between any cities in France with automatic station selection
  • Comprehensive Station Details: Get detailed information about stations including:
    • Available transport types (trains, buses, trams)
    • Nearby places and points of interest
    • Coordinates and accessibility information
  • Real-time Schedules: Access up-to-date departure and arrival information
  • Disruption Monitoring: Stay informed about service disruptions
  • Smart Station Finding: Locate stations by city name, station name, or coordinates
  • Fallback Mechanisms: Hardcoded coordinates for major cities ensure reliability even when API searches fail
  • Detailed Logging: Comprehensive logging for debugging and monitoring

Installation

Prerequisites

  • Python 3.6+
  • pip (Python package manager)

Step 1: Clone the Repository

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →