Serveur MCP pour les informations de trafic en temps réel de Naolib (Nantes)
Project description
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).
- Suivi en temps réel : Obtenez les horaires de passage (arrivées/départs) pour un arrêt spécifique.
- Vérification du service : Testez la disponibilité de l'API 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 le suivi en temps réel (optionnel mais recommandé). 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é (requis pourget_stop_monitoring). Sans clé, seulscheck_api_statusetcheck_api_status_soapsont disponibles.NAOLIB_BASE_URL— URL de base de l'API (par défaut :https://api.okina.fr/gateway/sem/realtime). Pour tester contre staging :https://api.staging.okina.fr/gateway/sem/realtime.NAOLIB_DATASET_ID— Identifiant du dataset Naolib (par défaut :NAOLIBORG).
Intégration (claude_desktop_config.json)
Si vous avez installé le package via PyPI, utilisez la commande naolib-mcp :
{
"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
Recherche un arrêt par nom et retourne son identifiant StopPoint.
search_stop("Babiniere")
→ 1. **Babinière** → `StopPoint:BAB`
get_stop_monitoring
Obtenez les prochains passages en temps réel pour un arrêt (authentifié).
get_stop_monitoring("StopPoint:BAB", maximum_visits=5)
→ - **Ligne 1** → Hôtel de Ville | Expected: 14:32 | Platform: A | Status: arrived
check_api_status
Vérifie la disponibilité du service SIRI via XML brut (accès libre, rate limit 30s).
check_api_status_soap
Vérifie la disponibilité du service SIRI via SOAP (accès libre, rate limit 30s).
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) |
Les requêtes utilisent le header HTTP datasetId: NAOLIBORG.
Les structures XML respectent le format <Siri><ServiceRequest>...</ServiceRequest></Siri>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file naolib_mcp-1.0.1.tar.gz.
File metadata
- Download URL: naolib_mcp-1.0.1.tar.gz
- Upload date:
- Size: 69.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ed5e73737a56a15f04ff7c0e05916210b11ea4f96cc4cc0f4722aee000aaea3
|
|
| MD5 |
6fc33c766421fd148304228ba3cc50df
|
|
| BLAKE2b-256 |
7142f940ea0cfd86350c28dc5e6ca4c748d2436d02f605411e4c6405210f6b37
|
Provenance
The following attestation bundles were made for naolib_mcp-1.0.1.tar.gz:
Publisher:
publish.yml on alexandrerodenas/naolib-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
naolib_mcp-1.0.1.tar.gz -
Subject digest:
2ed5e73737a56a15f04ff7c0e05916210b11ea4f96cc4cc0f4722aee000aaea3 - Sigstore transparency entry: 1511177762
- Sigstore integration time:
-
Permalink:
alexandrerodenas/naolib-mcp@16d3d9117a56567d3ddb4db0feef442a190af210 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/alexandrerodenas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16d3d9117a56567d3ddb4db0feef442a190af210 -
Trigger Event:
release
-
Statement type:
File details
Details for the file naolib_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: naolib_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
952cb60925e53f605b7f34e25e1b78a8f39c6d6f86f8e0c64df66c7e180552b7
|
|
| MD5 |
72942022af78df7b6021dde4ef5cc9c7
|
|
| BLAKE2b-256 |
3716e7246263cf668ac8ec4f68ef975e9f6b2104bcac765607a3fda8fb035d4a
|
Provenance
The following attestation bundles were made for naolib_mcp-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on alexandrerodenas/naolib-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
naolib_mcp-1.0.1-py3-none-any.whl -
Subject digest:
952cb60925e53f605b7f34e25e1b78a8f39c6d6f86f8e0c64df66c7e180552b7 - Sigstore transparency entry: 1511177871
- Sigstore integration time:
-
Permalink:
alexandrerodenas/naolib-mcp@16d3d9117a56567d3ddb4db0feef442a190af210 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/alexandrerodenas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16d3d9117a56567d3ddb4db0feef442a190af210 -
Trigger Event:
release
-
Statement type: