mcp-hsl
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-hslWhen are the next departures from Kamppi?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-hsl
MCP server exposing Greater Helsinki (HSL) public-transport data from Digitransit. Covers Helsinki, Espoo, Vantaa, Kauniainen, Kerava, Kirkkonummi, Sipoo, Siuntio, and Tuusula.
Lets an LLM host (Claude Desktop, Claude Code, Cursor, etc.) answer live-transit questions like "next tram from Kamppi to Töölö" or "plan a trip from Otaniemi to Kallio at 5pm".
Prerequisites
Node.js 20.6 or newer (uses native
--env-file).A free Digitransit subscription key (see below).
Related MCP server: gtfs-pro-mcp
Getting a Digitransit API key
Digitransit publishes HSL data through an Azure API Management portal. The key is free and easy to obtain.
Go to https://portal-api.digitransit.fi/ and click Sign up (top rig ht).
Verify your email and sign in.
Open Products → pick Digitransit API (the free tier).
Click Subscribe, give the subscription a name (e.g.
mcp-hsl), and confirm.Under Profile → Subscriptions, reveal the Primary key. That's you r
DIGITRANSIT_SUBSCRIPTION_KEY.
The free tier has generous rate limits (see https://digitransit.fi/en/developers/api-registration/ for current numbers). Keep the key private — treat it like a password.
Install
mcp-hsl is a standard stdio MCP server, so any MCP-compatible host can use it — Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, Zed, and so on.
Option A — CLI (fastest, if your host has one)
# Claude Code
claude mcp add hsl-transit -e DIGITRANSIT_SUBSCRIPTION_KEY=your-key -- npx -y mcp-hslOther hosts (Cursor, VS Code) offer GUI-driven "Add MCP server" flows in their command palettes — same fields as the JSON below.
Option B — Config file
Add this entry to your host's MCP config:
{
"mcpServers": {
"hsl-transit": {
"command": "npx",
"args": ["-y", "mcp-hsl"],
"env": {
"DIGITRANSIT_SUBSCRIPTION_KEY": "your-key-here"
}
}
}
}Where to put it:
Host | Config path | Wrapper key |
Claude Desktop (macOS) |
|
|
Claude Desktop (Windows) |
|
|
Claude Code |
|
|
Cursor |
|
|
VS Code (Copilot) |
|
|
VS Code uses
"servers"instead of"mcpServers"— otherwise the entry is identical.
Restart the host after editing the config. The server should appear as Connected / Ready.
Local development
git clone <this-repo>
cd mcp-hsl
npm install
cp .env.example .env # then fill in DIGITRANSIT_SUBSCRIPTION_KEY
npm run buildRun against your own build:
{
"mcpServers": {
"hsl-transit": {
"command": "node",
"args": [
"--env-file=/absolute/path/to/mcp-hsl/.env",
"/absolute/path/to/mcp-hsl/build/stdio.js"
]
}
}
}The server exits immediately with a clear message if DIGITRANSIT_SUBSCRIPTION_KEY is missing.
Tools
Name | Purpose | Key inputs |
| Place / address → coordinates |
|
| Route between two places |
|
| Next departures from a stop |
|
All three call Digitransit's HSL routing API. plan_journey geocodes both endpoints internally; stop_departures looks up a stop by name if you don't have the HSL ID.
plan_journey modes
Filter transit modes with the modes array: BUS, TRAM, RAIL, SUBWAY, FERRY. Omit to allow any. departureTime is an ISO 8601 timestamp with offset (e.g. 2026-08-13T17:00:00+03:00); defaults to now.
stop_departures name lookup
HSL stop IDs look like HSL:1140447. If you pass stopName and it matches multiple stops (e.g. Kamppi has several platform IDs), the tool returns the candidate list — the LLM then re-calls with the specific stopId.
Example prompts
"Geocode 'Kamppi metro station' in Helsinki."
"When are the next departures from Kamppi?"
"Plan a tram journey from Kamppi to Töölö."
"Get me from Otaniemi to Kallio around 5pm today, no bus."
"Kamppista Töölöön seuraava ratikka?"
Design notes
Transport-agnostic core.
src/server.tsexposes abuildServer()factory that registers tools without touching any transport. To add HTTP later, add a new entry point that callsbuildServer()and wires it toStreamableHTTPServerTransport.Output for LLMs. Tool results are compact plain-text tables/blocks — enough for the model to reason over without wasting tokens on raw GraphQL responses.
Multilingual. Digitransit returns Finnish and Swedish names side by side; the LLM handles user-facing language.
Real-time. Journey legs and departures include real-time state (
SCHEDULED,UPDATED,CANCELED) so the model can distinguish "on time" from "delayed 3 min".
Attribution
Data © Helsinki Region Transport (HSL) and other producers, provided by Digitransit under Creative Commons BY 4.0. This project is not affiliated with HSL or Digitransit.
License
MIT — see LICENSE.
Available Tools
3 toolsgeocodeGeocode a Helsinki placeA
Look up coordinates for an address, place, or landmark in the Greater Helsinki area. Returns up to 10 candidates with Finnish and Swedish names, coordinates, and a confidence score. Use this before plan_journey when you only have a place name.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-10). | |
| query | Yes | Address, place name, or landmark in the Greater Helsinki area (Finnish, Swedish, or English). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of disclosing behavior. It does well by describing the output: 'Returns up to 10 candidates with Finnish and Swedish names, coordinates, and a confidence score.' However, it doesn't mention error cases or ambiguous query behavior, leaving a minor transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences front-load the purpose, then state the output, then give usage guidance. Every word earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-parameter geocoding tool, the description covers purpose, output format, and usage context relative to siblings. The absence of an output schema is mitigated by the explicit summary of returned fields.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for both parameters, so the description leverages the schema's descriptions. It reinforces that query accepts 'address, place, or landmark' but adds no new parameter-level meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Look up coordinates for an address, place, or landmark in the Greater Helsinki area.' This specific verb+resource combination distinguishes it from sibling tools like plan_journey and stop_departures.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is given: 'Use this before plan_journey when you only have a place name.' This names the alternative tool and provides a clear when-to-use directive, which is exactly what agents need.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
plan_journeyPlan a Helsinki transit journeyA
Plan a public-transport journey between two places in Greater Helsinki. Accepts place names or addresses; both endpoints are geocoded internally. Returns up to 5 itineraries, each with legs, modes, line numbers, and real-time status. Departure time defaults to now; provide an ISO 8601 timestamp with offset to plan ahead.
| Name | Required | Description | Default |
|---|---|---|---|
| modes | No | Optional filter of allowed transit modes (BUS, TRAM, RAIL, SUBWAY, FERRY). Omit to allow any. | |
| origin | Yes | Origin: place name, address, or landmark in Greater Helsinki (e.g. 'Kamppi', 'Otaniemi'). Geocoded internally. | |
| destination | Yes | Destination: place name, address, or landmark. Geocoded internally. | |
| departureTime | No | ISO 8601 timestamp WITH offset, e.g. '2026-08-07T15:00:00+03:00' or '...Z'. Defaults to now. | |
| numItineraries | No | How many itineraries to return. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses internal geocoding, return structure (up to 5 itineraries with legs, modes, line numbers, real-time status), default departure time of 'now,' and the requirement for ISO 8601 timestamps with offset. This is strong behavioral disclosure for a read-only planner, though it does not mention error handling or reversibility.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences: first states the purpose, second covers inputs and outputs, third addresses departure time. It is front-loaded with the main action and contains no filler or redundant wording.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has moderate complexity (5 parameters, no output schema). The description sufficiently explains input types, geocoding behavior, return format (itineraries with legs, modes, line numbers, real-time status), and time defaults. Given the absence of an output schema, this is a complete and self-contained description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds some context—internal geocoding, default departure time, and output details—but these are largely redundant with the schema's per-property descriptions. It does not significantly enhance parameter understanding beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Plan a public-transport journey between two places in Greater Helsinki.' It clearly distinguishes the tool from siblings by focusing on journey planning, while mentioning internal geocoding for endpoints. This is a clear, non-tautological purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: use for public-transport journeys in Greater Helsinki, accepts place names/addresses, returns itineraries. It does not explicitly mention when not to use it or alternatives like geocode or stop_departures, but the purpose is well-scoped enough to avoid confusion with the siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stop_departuresNext departures from a stopA
Get the next departures from a Helsinki public-transport stop, including real-time delays. Accepts either a stop name (e.g. 'Kamppi', looked up internally) or an HSL stop ID (e.g. 'HSL:1140447'). If the name matches multiple stops, returns the candidate list so the caller can pick one.
| Name | Required | Description | Default |
|---|---|---|---|
| stopId | No | HSL GTFS stop ID, e.g. "HSL:1140447". Provide this OR stopName. | |
| stopName | No | Human-readable stop name, e.g. "Kamppi". Provide this OR stopId. | |
| numberOfDepartures | No | How many upcoming departures to return. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of disclosing behavior. It does so by mentioning real-time delays, internal stop-name lookup, and the candidate-list response when multiple stops match. This goes beyond the schema's parameter definitions, though it does not cover all edge cases (e.g., invalid inputs, no departures found).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, each adding value: purpose, input options, and ambiguity handling. No fluff or repetition of schema info. The description is front-loaded with the primary function and scales well.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema, the description does not specify the structure of returned departures (e.g., fields like line, time, delay), which is a notable gap. It also omits error-handling behavior. The core purpose is clear, but the lack of return-format details makes it only moderately complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds context about the OR relationship between stopId and stopName and the disambiguation behavior, but it does not add meaningfully to the numberOfDepartures parameter beyond what the schema already states. Thus, it slightly enhances but does not fully compensate beyond the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Get') and resource ('next departures from a Helsinki public-transport stop'), clearly distinguishing it from sibling tools like geocode or plan_journey. The scope is precise (Helsinki transit, real-time delays), leaving no ambiguity about what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use this tool (to obtain departures from a stop) and explains the two accepted input modes, including a note about ambiguity resolution. However, it does not explicitly state when not to use it or mention alternatives (e.g., use plan_journey for route planning), so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a clearly distinct aspect of transit: geocode for place lookup, stop_departures for real-time departures, and plan_journey for routing. The descriptions reinforce these boundaries, making misselection unlikely.
The naming style is lowercase with underscores, but the grammatical patterns vary: 'geocode' is a single verb, 'plan_journey' is verb_noun, and 'stop_departures' is a noun phrase. This mix is readable but not as consistent as a strict verb_noun convention.
Three tools is at the lower end of the typical well-scoped range, but each tool serves a core transit use case. The set feels slightly sparse for a full public-transport domain, but it is not overly thin or bloated.
The tool surface covers the primary journey-planning workflow: geocoding, departures, and route planning. Minor gaps exist such as no tool for disruptions, fares, or stop metadata, but agents can accomplish the main tasks without dead ends.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
The Ferryhopper MCP server is a connector for LLMs and AI Agents in maritime travel that exposes ferry routes, schedules, and booking options. It enables AI assistants to search ports and connections across 33 countries and 190+ ferry operators, provide real-time ferry itineraries with indicative prices, and assist users with planning island-hopping or multi-leg journeys by processing natural language queries about ferry times, passenger counts, and travel durations.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the Berlin Public Transport (BVG) API to search for locations and plan journeys. It provides real-time access to departures, arrivals, trip details, and vehicle tracking within Berlin's transit network.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that provides tools for querying live transit data (stops, departures, routes, vehicles, alerts) from any WP GTFS Pro site, enabling AI assistants to answer rider questions.21GPL 2.0
- FlicenseNot gradedqualityDmaintenanceMCP server providing real-time public transport data for Tomsk, including routes, schedules, stops with lazy OSM enrichment, nearby stop search, and a routing prompt for LLMs.
- AlicenseAqualityBmaintenanceMCP server for Atlanta MARTA real-time transit data, enabling queries about train arrivals and bus positions via natural language.4MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/devusvulgaris/mcp-hsl'
If you have feedback or need assistance with the MCP directory API, please join our Discord server