SNCF
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.
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
Maintainer
Works with
Installation
Manual Installation
npx mcp-sncfConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
Clone the repository
Clone the mcp-sncf repository to your local machine.
git clone https://github.com/Kryzo/mcp-sncf.git
cd mcp-sncfInstall Python dependencies
Install the required Python packages using pip.
pip install requests pandas mcpObtain 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-ef1234567890Configure 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"
}
}
}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 routeSNCF 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.
SNCF Alternatives — Similar APIs Servers
Looking for alternatives to SNCF? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
★ 43.4k🦍 The API and AI Gateway
API Mega List
★ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHub—period. 💪
Fetch
★ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
★ 2.1kSelf-Hosted API Management for Builders
Korean Law
★ 1.8k국가법령정보MCP v4.0 | 법제처 41개 API → 17개 MCP 도구. 법령·판례·조례 검색 + LLM 환각 방지 인용검증 + 조문 영향 그래프(impact_map) + 시점 비교 자동 diff(time_travel) + 시민 5단계 실행 가이드(action_plan) | 41 Korean legal APIs → 17 MCP tools
RuleGo
★ 1.5k⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
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.
Set Up SNCF in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.