Skip to main content

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à.

Tool di analisi

Oltre agli endpoint grezzi, il server espone due analisi della libreria (viaggiatreno.insights):

  • profilo_stazione: ruolo (capolinea/transito), frequenza, binari e collegamenti di una stazione, dai tabelloni di partenze e arrivi;
  • profilo_treno: itinerario, fermate, archi (tempi di percorrenza, ritardo accumulato) e anomalie di un treno, da andamentoTreno.

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

Licenza

Vedi il file LICENSE nel repository.

Repository: https://github.com/matteoredaelli/pyviaggiatreno

Metadata

Release files for viaggiatreno-mcp 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viaggiatreno-mcp 0.4.3
File Size Uploaded Provenance Actions
viaggiatreno_mcp-0.4.3.tar.gz 21.2 kB With provenance Details for viaggiatreno_mcp-0.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for viaggiatreno-mcp 0.4.3
File Interpreter ABI Platform Actions
viaggiatreno_mcp-0.4.3-py3-none-any.whl Python 3 none any Details for viaggiatreno_mcp-0.4.3-py3-none-any.whl

Total release size: 47.5 kB

Release files / viaggiatreno_mcp-0.4.3.tar.gz

Download URL viaggiatreno_mcp-0.4.3.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
22424e20963a14c565aee45ec5e3805cfc29ac49693e5a334e3917288cd06769
BLAKE2b-256 checksum
How to use checksums
f594512ea968752c5c7e3e1bea6d4ea3b3083146a239b42f3f148ef9bb0d7300
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 Nov 18, 2026.

Transparency log

Release files / viaggiatreno_mcp-0.4.3-py3-none-any.whl

Download URL viaggiatreno_mcp-0.4.3-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98ed4ec23a8032552aa9c1a85c9099bac26a6f069cfc19dcd48589a1c56d556a
BLAKE2b-256 checksum
How to use checksums
43ce1f31f78a90fb4a2cd8dad149590cc3c971e30d57ad542d642b5de18a2299
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 Nov 18, 2026.

Transparency log

Security for viaggiatreno-mcp 0.4.3

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.

Select from 2 files

Attestation for viaggiatreno_mcp-0.4.3.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 Nov 18, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page