Skip to main content

Model Context Protocol server enabling AI assistants to access transit information

Project description

Infobús MCP (servidor)

Interfaz de inteligencia artificial en sistemas de información para personas usuarias del transporte público

Fabián Abarca Calderón

Nota: manejador de paquetes de Python uv.

uv init transit
cd transit
uv venv
source .venv/bin/activate
uv add "mcp[cli]" httpx
touch transit.py
@mcp.tool()
async def get_forecast(latitude: float, longitude: float) -> str:
    """Get weather forecast for a location.

    Args:
        latitude: Latitude of the location
        longitude: Longitude of the location
    """
    # First get the forecast grid endpoint
    points_url = f"{INFOBUS_API_BASE}/points/{latitude},{longitude}"
    points_data = await make_infobus_request(points_url)

    if not points_data:
        return "Unable to fetch forecast data for this location."

    # Get the forecast URL from the points response
    forecast_url = points_data["properties"]["forecast"]
    forecast_data = await make_infobus_request(forecast_url)

    if not forecast_data:
        return "Unable to fetch detailed forecast."

    # Format the periods into a readable forecast
    periods = forecast_data["properties"]["periods"]
    forecasts = []
    for period in periods[:5]:  # Only show next 5 periods
        forecast = f"""
{period['name']}:
Temperature: {period['temperature']}°{period['temperatureUnit']}
Wind: {period['windSpeed']} {period['windDirection']}
Forecast: {period['detailedForecast']}
"""
        forecasts.append(forecast)

    return "\n---\n".join(forecasts)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_simovilab_transit-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_simovilab_transit-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_simovilab_transit-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_simovilab_transit-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_simovilab_transit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6505b0198e2a648b52fec86d33c83b2f08b9fffaed947c061866031d85989492
MD5 9e2b4a602fead80c46426e7604b6101c
BLAKE2b-256 54fd059679858d905b2af8b9d7925c905a22072ba5c003ade0b29d659422b64e

See more details on using hashes here.

File details

Details for the file iflow_mcp_simovilab_transit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_simovilab_transit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_simovilab_transit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a350a954e62c9c070714ba239bedbe37efa5441243d7f80360c87c6738384dc
MD5 156ec6b1da026763b9f8614ba806b968
BLAKE2b-256 5099e305fa17a3936d690f11247135e6a5bb09cb1e652f14febb8f2cdc9acd50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page