Naolib MCP
Un serveur MCP pour obtenir les informations de trafic en temps réel de Naolib (Nantes Métropole) via le protocole SIRI.
Fonctionnalités
- Recherche d'arrêts : Trouvez l'identifiant technique d'un arrêt à partir de son nom (avec recherche floue sur le cache NeTEx local).
- Prochains passages : Horaires de passage en temps réel pour un arrêt (raw XML SIRI).
- Perturbations : Alertes et incidents en temps réel (SIRI Situation Exchange).
- Messages généraux : Annonces et avis de service (SIRI General Message).
- Position des véhicules : Localisation GPS en direct des véhicules sur une ligne (SIRI Vehicle Monitoring).
- Horaires estimés : Horaires estimés par ligne complète (SIRI Estimated Timetables).
- État des équipements : Statut des ascenseurs, escaliers mécaniques, valideuses (SIRI Facility Monitoring).
- Découverte des arrêts : Liste des arrêts disponibles (SIRI StopPointsDiscovery).
- Découverte des lignes : Liste des lignes du réseau, groupées par mode (SIRI LinesDiscovery).
- Vérification du service : Disponibilité SIRI (raw XML et SOAP).
- Synchronisation Dynamique : Mise à jour automatique du catalogue des arrêts via les données NeTEx de Nantes Métropole.
- Cache Intelligent : Optimisation des appels API avec un cache interne pour réduire la latence.
- Rate Limiter : Respecte automatiquement la limite de 1 requête / 30 secondes sur l'accès libre.
Prérequis
- Python 3.10+
- Une clé API Naolib pour les fonctionnalités authentifiées (optionnel). Requestez-la sur le portail Naolib/Okina.
Installation via PyPI
pip install naolib-mcp
Configuration
Variables d'environnement :
NAOLIB_API_KEY— Clé API pour l'accès authentifié. Outils nécessitant une clé :get_stop_monitoring,get_vehicle_monitoring,get_estimated_timetables. Les autres outils sont en accès libre.NAOLIB_BASE_URL— URL de base de l'API. Par défaut :https://api.okina.fr/gateway/sem/realtime. Pour staging :https://api.staging.okina.fr/gateway/sem/realtime.NAOLIB_DATASET_ID— Identifiant du dataset (par défaut :NAOLIBORG).
Intégration (claude_desktop_config.json)
{
"mcpServers": {
"naolib-mcp": {
"command": "uvx",
"args": ["naolib-mcp"],
"env": {
"NAOLIB_API_KEY": "votre_cle_api_ici",
"NAOLIB_BASE_URL": "https://api.okina.fr/gateway/sem/realtime"
}
}
}
}
Pour staging :
{
"mcpServers": {
"naolib-mcp": {
"command": "uvx",
"args": ["naolib-mcp"],
"env": {
"NAOLIB_API_KEY": "votre_cle_api_staging_ici",
"NAOLIB_BASE_URL": "https://api.staging.okina.fr/gateway/sem/realtime"
}
}
}
}
Utilisation
Démarrer le serveur manuellement :
naolib-mcp
Outils MCP disponibles
search_stop (libre)
Recherche un arrêt par nom (fuzzy matching sur le cache NeTEx local).
search_stop("Jamet")
→ 1. **Jamet** → `FR_NAOLIB:Quay:50`
get_stop_monitoring (authentifié)
Prochains passages pour un arrêt (raw XML SIRI, nécessite une clé).
get_stop_monitoring("FR_NAOLIB:Quay:50", maximum_visits=5)
→ 🚊 **Ligne A** → Jamet | 08:37 ⚡
check_api_status (libre, rate limit)
Disponibilité du service SIRI (raw XML). Rate limit : 1 req / 30s.
check_api_status_soap (libre, rate limit)
Disponibilité du service SIRI (SOAP). Rate limit : 1 req / 30s.
get_traffic_alerts (libre, rate limit)
Perturbations et incidents en temps réel (SIRI Situation Exchange).
get_general_messages (libre, rate limit)
Messages généraux et avis de service (SIRI General Message).
get_vehicle_monitoring (authentifié)
Position GPS en direct des véhicules sur une ligne (SIRI Vehicle Monitoring).
get_vehicle_monitoring("Line:A")
→ 🚍 3 véhicule(s) sur `Line:A`
🚌 `VEH-001` → Beaujoire — expire 14:50
📍 47.218, -1.550 | cap: 45°
get_estimated_timetables (authentifié)
Horaires estimés pour tous les arrêts d'une ligne (SIRI Estimated Timetables).
get_facility_status (libre, rate limit)
Statut des équipements (ascenseurs, valideuses, etc.) à un arrêt ou sur tout le réseau (SIRI Facility Monitoring).
get_facility_status("FR_NAOLIB:Quay:50")
→ 🏗️ 2 équipement(s) — `FR_NAOLIB:Quay:50`
✅ `ELV-001` — elevator @ Station Jamet
❌ `ASC-002` — escalator: en panne
discover_stops (libre, rate limit)
Liste des arrêts disponibles dans le dataset Naolib, avec filtre optionnel (SIRI StopPointsDiscovery).
Pour une recherche plus précise par nom, préférez search_stop().
discover_lines (libre, rate limit)
Liste des lignes du réseau Naolib, groupées par mode de transport (SIRI LinesDiscovery).
discover_lines()
→ 🚌 52 ligne(s) — toutes
🚊 **Tram**
• **Ligne A** → `FR_NAOLIB:Line:TM:A`
• **Ligne 2** → `FR_NAOLIB:Line:TM:2`
🚌 **Bus**
• **Ligne C3** → `FR_NAOLIB:Line:BS:C3`
Protocole SIRI — notes techniques
L'implémentation suit la spécification SIRI 2.0 avec les points d'accès Okina :
| Format | Endpoint | Auth | Rate limit |
|---|---|---|---|
| Raw XML | /anshar/services |
Libre + api-key |
1 req / 30s (libre) |
| SOAP | /anshar/ws/siri |
Libre + api-key |
1 req / 30s (libre) |
| SIRI Lite | /siri/2.0/{service}.json |
Libre + api-key |
1 req / 30s (libre) |
Les requêtes POST XML utilisent le header HTTP datasetId: NAOLIBORG.
Les structures XML respectent le format <Siri><ServiceRequest>...</ServiceRequest></Siri>.
Les endpoints SIRI Lite sont documentés dans le manuel ITR Okina v16 (Chap. 15).
Metadata
Release files for naolib-mcp 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| naolib_mcp-1.2.0.tar.gz | 74.6 kB | With provenance | Details for naolib_mcp-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| naolib_mcp-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for naolib_mcp-1.2.0-py3-none-any.whl |
Total release size: 88.6 kB
Release files / naolib_mcp-1.2.0.tar.gz
| Download URL | naolib_mcp-1.2.0.tar.gz |
|---|---|
| Size | 74.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a530ff49f9ea9e9995e117a452aff03c8764680ed9c5ee37951ea92fd40bb62b
|
|
BLAKE2b-256 checksum How to use checksums |
c2109447d77b4c79980b8d09976cfa57867da22b43420d57e0c61124d6e6eb39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 12, 2026.
Transparency logRelease files / naolib_mcp-1.2.0-py3-none-any.whl
| Download URL | naolib_mcp-1.2.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
721446ca43c5331ce7f653db9b8752cdf92d8b5305f372e1d79f985ef8c6fa71
|
|
BLAKE2b-256 checksum How to use checksums |
73ab2a1ac4447a4ad2ad8b048753af92661e444d610766a91c674cea81e7a9e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 12, 2026.
Transparency logSecurity for naolib-mcp 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for naolib_mcp-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.