SNCF

v1.0.0APIsstable

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.

mcp-sncfmcpai-integration
Share:
15
Stars
0
Downloads
0
Weekly
0/5

What is SNCF?

SNCF is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 retr...

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.

This server falls under the APIs and Search & Data Extraction categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • This project provides a modular Python wrapper for the SNCF

Use Cases

Query French train schedules and journey information via Claude.
Get intelligent travel recommendations for SNCF network.
Kryzo

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 12, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-sncf

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use SNCF

The SNCF MCP Server is a Python-based Model Context Protocol server that wraps the SNCF Navitia API to give AI assistants intelligent access to French train travel data. It provides tools for planning journeys between cities, retrieving station details and facilities, querying real-time departure and arrival schedules, and checking network disruptions — all through natural language via Claude Desktop.

Prerequisites

  • Python 3.9+ installed
  • A Navitia API key (free registration at https://www.digital.sncf.com/startup/api)
  • Git to clone the repository
  • Claude Desktop installed
1

Clone the repository

Clone the mcp-sncf repository to your local machine.

git clone https://github.com/Kryzo/mcp-sncf.git
cd mcp-sncf
2

Install Python dependencies

Install the required Python packages using pip.

pip install requests pandas mcp
3

Obtain a Navitia API key

Visit the SNCF API portal, create an account, and subscribe to the Navitia API service. You will receive a UUID-formatted API key by email upon approval.

# API portal: https://www.digital.sncf.com/startup/api
# Your key will look like: a1b2c3d4-e5f6-7890-abcd-ef1234567890
4

Configure Claude Desktop

Add the SNCF server to your Claude Desktop configuration file, passing your API key as a command-line argument.

{
  "mcpServers": {
    "sncf": {
      "command": "python",
      "args": ["/absolute/path/to/mcp-sncf/sncf_server.py", "--api-key=YOUR-NAVITIA-API-KEY"],
      "cwd": "/absolute/path/to/mcp-sncf"
    }
  }
}
5

Restart Claude Desktop and test a journey query

Restart Claude Desktop after saving the configuration. Test the integration by asking Claude to plan a train journey. The server exposes four main tools: plan_journey_by_city_names, get_station_details, get_station_schedule, and check_disruptions.

# Available MCP tools:
# plan_journey_by_city_names  - Route planning with optional date/time
# get_station_details         - Facilities and transport options at a station
# get_station_schedule        - Departure/arrival times with real-time status
# check_disruptions           - Current network issues affecting a route

SNCF Examples

Client configuration

Complete Claude Desktop configuration for the SNCF MCP server.

{
  "mcpServers": {
    "sncf": {
      "command": "python",
      "args": [
        "/Users/yourname/projects/mcp-sncf/sncf_server.py",
        "--api-key=a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      ],
      "cwd": "/Users/yourname/projects/mcp-sncf"
    }
  }
}

Prompts to try

Natural language prompts for querying SNCF train data through Claude.

- "Plan a train journey from Paris to Lyon tomorrow morning at 8 AM"
- "What are the next trains leaving from Bordeaux to Paris today?"
- "What transport options and facilities are available at Grenoble station?"
- "Are there any disruptions affecting the Paris to Marseille route right now?"
- "Show me all departures from Gare de Lyon in the next two hours"

Troubleshooting SNCF

API returns 401 Unauthorized errors

Verify your Navitia API key is correct and that you have subscribed to the API service on the SNCF developer portal. Keys are UUID format (e.g., a1b2c3d4-e5f6-7890-abcd-ef1234567890) — do not include curly braces.

Station not found for a city name

The server uses hardcoded coordinates for major French cities for lookup. Try using the full official station name (e.g., 'Paris Gare de Lyon' rather than just 'Paris') or the station's SNCF stop_area ID if available.

Python module not found (mcp, requests, pandas)

Ensure you have installed dependencies with 'pip install requests pandas mcp' in the same Python environment that Claude Desktop will use. If using a virtual environment, specify the full path to the Python binary in the claude_desktop_config.json command field.

Frequently Asked Questions about SNCF

What is SNCF?

SNCF is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install SNCF?

Follow the installation instructions on the SNCF GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with SNCF?

SNCF works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is SNCF free to use?

Yes, SNCF is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-sncf": { "command": "npx", "args": ["-y", "mcp-sncf"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use SNCF?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides