viaggiatreno-mcp
Server MCP (Model Context Protocol) per interrogare in tempo reale la rete ferroviaria italiana tramite le API di ViaggiaTreno.
Il server è un adattatore sottile: espone come tool MCP le funzionalità della
libreria viaggiatreno, senza
conoscere i dettagli delle API sottostanti. Permette ad assistenti come Claude
di cercare stazioni, consultare tabelloni partenze/arrivi, monitorare ritardi e
andamento dei treni, controllare le tratte e leggere le notizie di infomobilità.
Installazione
pip install viaggiatreno-mcp
Avvio
# tramite lo script console
viaggiatreno-mcp
# oppure come modulo
python -m viaggiatreno_mcp
Il server usa il trasporto stdio: viene avviato dal client MCP, non va lanciato a mano quando lo si configura in Claude/Kiro/ecc.
Configurazione nei client MCP
Il modo consigliato è uvx, che scarica ed esegue il pacchetto in un ambiente
isolato senza installazione manuale (richiede uv).
Claude Desktop
File di configurazione:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"viaggiatreno": {
"command": "uvx",
"args": ["viaggiatreno-mcp"]
}
}
}
Kiro (e client con lo stesso formato: Cursor, Windsurf, VS Code MCP, ecc.)
In ~/.kiro/settings/mcp.json (globale) o .kiro/settings/mcp.json (per workspace):
{
"mcpServers": {
"viaggiatreno": {
"command": "uvx",
"args": ["viaggiatreno-mcp"],
"disabled": false,
"autoApprove": []
}
}
}
Alternativa senza uvx (pacchetto già installato con pip)
Se hai fatto pip install viaggiatreno-mcp, punta direttamente al comando.
Usa un percorso assoluto se il client non eredita il tuo PATH:
{
"mcpServers": {
"viaggiatreno": {
"command": "viaggiatreno-mcp",
"args": []
}
}
}
Oppure, per essere indipendenti dal PATH, via interprete Python:
{
"mcpServers": {
"viaggiatreno": {
"command": "python",
"args": ["-m", "viaggiatreno_mcp"]
}
}
}
Dopo aver salvato la configurazione, riavvia il client MCP.
Dipendenze
viaggiatreno— libreria client corefastmcp— framework MCP
Licenza
Vedi il file LICENSE nel repository.
Repository: https://github.com/matteoredaelli/pyviaggiatreno
Metadata
Release files for viaggiatreno-mcp 0.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 | |
|---|---|---|---|---|
| viaggiatreno_mcp-0.2.0.tar.gz | 7.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| viaggiatreno_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / viaggiatreno_mcp-0.2.0.tar.gz
| Download URL | viaggiatreno_mcp-0.2.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfc89cb32840333c40f9f934da91ee9fc40c9dee87f1948ee6078358f4011e7c
|
|
BLAKE2b-256 checksum How to use checksums |
6440b334c0db6dcfbe6eff94162030e813bc1e2914b069066eec5de3f2e729b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logRelease files / viaggiatreno_mcp-0.2.0-py3-none-any.whl
| Download URL | viaggiatreno_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34baf8dec8dcb76db78eec3344a8315763e963fc0c604b8f7efbd13b03776191
|
|
BLAKE2b-256 checksum How to use checksums |
0b2f4c56b2111bbcc87b88892e2930ffd3fe1e49d9c252f1c0705a880eebf722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logSecurity for viaggiatreno-mcp 0.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for viaggiatreno_mcp-0.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 Oct 23, 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.