Norway Location Transport Mcp

io.github.trondbjoroy由 GitHub 账号 trondbjoroy 发布v0.1.1更新于 Oct 24, 2026

Norwegian transport (Entur) and geodata (Kartverket): trips, departures, addresses, elevation.

已验证Streamable HTTP可网页运行位置与生活数据与分析

概览

AI 生成的概览

为助手提供挪威公共交通与地理数据工具:行程规划、班次、地址、地名、海拔和坐标转换。

可以做什么
搜索并校验官方地址、地名及附近地物,查询某地点或地址所属的市镇、郡及地籍编号。获取某点的地形海拔,或沿路径采样生成海拔剖面,含总距离、累计上升和下降,并在 EPSG 坐标系之间转换坐标。将地点解析为公共交通站点 ID,并查找坐标附近的站点。规划点到点行程,可按交通方式、时间和步行速度筛选,并获取含实时延误和取消信息的下一班次。查询站点与线路的实时状态、站台、轮椅无障碍信息和票价区,以及车辆实时位置。查找共享单车、电动滑板车和共享汽车及停靠站。
适用场景
适合回答挪威出行与地理方面的实际问题:如何从一地到另一地、下一班何时发车、某坐标附近有什么、某条路线起伏如何,或某地址属于哪个市镇。
运行要求
可作为远程 HTTP 端点运行,也可作为本地进程运行(npm 包,需 Node.js,stdio)。无需 API 密钥或账户;Entur 要求自报客户端名称,可通过环境变量 ET_CLIENT_NAME 设置(未设置时使用包内默认值)。需要能访问 Entur 和 Kartverket 服务的网络。
安装前请注意
仅做只读查询,不写入或修改数据。查询会发往第三方挪威公共 API(Entur、Kartverket/Geonorge),因此所查地址和坐标会发送给它们。数据采用 NLOD 许可,展示时应注明来源。触发限流时会返回错误并要求重试。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Norway Location Transport Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.trondbjoroy%2Fnorway-location-transport-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "norway-location-transport": {
      "type": "http",
      "url": "https://norway-location-transport-mcp.met-mcp-worker.workers.dev/mcp"
    }
  }
}

README

norway-location-transport-mcp

An MCP server that gives AI agents structured access to Norwegian public transport and geospatial data, through the free Entur and Kartverket / Geonorge APIs.

The two sources compose: trip planning needs geocoding, elevation needs address resolution, and admin lookups tie coordinates to places. One server answers practical local questions — "how do I get from here to Bergen?", "what is the elevation along this hike?", "which kommune is this address in?", "are there e-scooters nearby?".

Both data sources are free with no paid tiers and no API keys. Entur requires only a self-identifying ET-Client-Name header (see below); Kartverket requires nothing.

Tools

Location & geodata (Kartverket)

  • search_address(query?, street?, number?, postal_code?, municipality_number?, max_results) — search official addresses by free text or fields; supports the * wildcard. Returns coordinates and cadastral numbers.
  • find_addresses_near(latitude, longitude, radius_m, max_results) — all addresses within a radius of a point, with distances.
  • validate_address(address) — validate and normalize a free-text address (fuzzy). Returns valid, the normalized match, and alternatives.
  • search_place_names(query, max_results) — search official place names; returns feature type (Fjell, Innsjø, …), municipality, county, and coordinates. Supports *.
  • find_place_names_near(latitude, longitude, radius_m, max_results) — nearest named features to a point, with distances.
  • get_elevation(latitude, longitude) — terrain elevation from the national elevation model (DTM).
  • get_elevation_profile(path, samples) — elevation sampled along a path; returns the profile plus total distance, ascent, and descent.
  • transform_coordinates(x, y, from_epsg, to_epsg) — convert between reference systems (e.g. WGS84 4326 → UTM33 25833).
  • lookup_admin_unit(latitude?, longitude?, address?) — which kommune and fylke a coordinate or address falls in, with official codes.
  • lookup_property(address?, latitude?, longitude?, max_results) — cadastral (matrikkel) identifiers (kommune / gnr / bnr / fnr) via the open address register.

Public transport (Entur)

  • resolve_stop_place(query, max_results) — resolve a place or address to Entur Stop Place IDs.
  • find_stops_near(latitude, longitude, radius_m, max_results) — reverse-geocode a coordinate to the nearest stop places.
  • plan_trip(from_place?/from_latitude/from_longitude, to_place?/to_latitude/to_longitude, date_time?, arrive_by?, transport_modes?, walk_speed?, num_trip_patterns) — plan a point-to-point journey; filter by mode and walk speed. Returns trip patterns with legs, modes, durations, and realtime times.
  • get_departures(stop_place_id, count) — next departures from a stop, with realtime delays, cancellations, and platform.
  • get_realtime_status(stop_place_id? | line_id?) — realtime health: for a stop, on-time/delayed/cancelled counts; for a line, active vehicles and delays.
  • get_stop_accessibility(stop_place_id) — per-quay wheelchair access and a summary. (See the accessibility note below.)
  • list_quays(stop_place_id) — all quays (platforms) at a stop, with codes and coordinates.
  • get_fare_zones(stop_place_id) — the fare (tariff) zone(s) a stop belongs to.
  • find_shared_vehicles(latitude, longitude, range_m, form_factors?, count) — free-floating shared vehicles (bikes, e-scooters, cars, mopeds) across all operators.
  • find_docking_stations(latitude, longitude, range_m, count) — docking stations with available vehicle and free-dock counts.
  • get_vehicle_positions(codespace_id?, line_id?, max_results) — live vehicle positions with bearing, speed, and delay.

Tool definitions live in src/kartverket.ts and src/entur.ts, combined in src/tools.ts and shared by both the stdio and HTTP entry points.

Setup

bash
npm installnpm run buildnpm test

npm test spawns the server over stdio and calls every tool against the live APIs.

Run it

Over stdio (for most MCP clients):

bash
node dist/index.js

Over Streamable HTTP (for HTTP-based clients):

bash
node dist/http.js# listens on http://localhost:3000/mcp  (override with PORT)

The Entur client-name requirement

Entur's terms require every request to carry an identifying ET-Client-Name header, formatted like company-app. This server sends one on every Entur request. Set your own value with the ET_CLIENT_NAME environment variable:

bash
ET_CLIENT_NAME="acme-travelbot" node dist/index.js

If unset, a package default is used. Kartverket needs no header or key.

Use with Claude Code

bash
claude mcp add norway -- node C:\Users\trond\norway-location-transport-mcp\dist\index.js

Then ask, for example: "Plan a trip from Oslo S to Bergen and tell me the elevation of Galdhøpiggen."

Remote version (Cloudflare Workers)

worker/ holds a remote deployment: the same 21 tools served over MCP Streamable HTTP, so the server can be added as a claude.ai connector. It shares the tool definitions with the local server (src/tools.ts takes z as a parameter, so it works with both the local MCP SDK v1 / zod 3 and the worker's SDK v2 / zod 4).

bash
cd workernpm installnpm run dev     # local test at http://127.0.0.1:8787/mcpnode test-http.mjs

Deploy it (needs a Cloudflare account and wrangler login):

bash
cd workernpm run deploy

Set your Entur client name as a worker variable:

bash
cd workernpx wrangler secret put ET_CLIENT_NAME

After deploy, add the remotes entry with your workers.dev URL to server.json.

Example calls

Get the next departures from Oslo S:

json
{ "name": "get_departures", "arguments": { "stop_place_id": "NSR:StopPlace:59872", "count": 5 } }

Plan a bus/tram-only trip with a set walk speed:

json
{ "name": "plan_trip", "arguments": {  "from_place": "NSR:StopPlace:59872",  "to_latitude": 59.95, "to_longitude": 10.78,  "transport_modes": ["bus", "tram"], "walk_speed": 1.4} }

Elevation profile along a short path:

json
{ "name": "get_elevation_profile", "arguments": {  "path": [{ "latitude": 61.636, "longitude": 8.312 }, { "latitude": 61.64, "longitude": 8.32 }],  "samples": 20} }

Convert a WGS84 coordinate to UTM33:

json
{ "name": "transform_coordinates", "arguments": { "x": 10.7461, "y": 59.9127, "from_epsg": 4326, "to_epsg": 25833 } }

Notes and limits

  • Coordinates are WGS84 latitude/longitude everywhere. The Kartverket APIs are queried with EPSG 4326 so the numbers match; EUREF89 (4258) differs by well under a metre in Norway.
  • Accessibility: Entur's free JourneyPlanner exposes wheelchair access per quay. Deeper equipment detail (elevators, tactile guidance) lives only in Entur's authenticated Stop Register API and is not available here; the tool says so.
  • Rate limiting from either source is surfaced as a clear error asking the agent to retry.
  • Attribution: data from Kartverket / Geonorge and Entur is under NLOD. Credit the sources when you show the data.

How it works

  • src/index.ts speaks MCP over stdio (JSON-RPC on stdin/stdout). src/http.ts speaks MCP over Streamable HTTP with session management. Both build the same server via src/server.ts.
  • Each tool declares a Zod input schema with descriptions the LLM reads directly — no external docs needed to call a tool.
  • Results are JSON text trimmed to what an agent needs, not the raw upstream payloads.
  • Never write to stdout with console.log; it corrupts the stdio protocol. Log to stderr.

License

MIT © Trond Bjørøy. Data © Kartverket and Entur, under NLOD.

来源:README.md,提交 f1b7c49

工具

21

search_address

Search Norwegian addresses

Search official Norwegian addresses (Kartverket) and get coordinates. Use `query` for free text, or the specific fields for a structured search. Wildcards with `*` are supported (e.g. street 'Storg*'). Returns coordinates, postal code, municipality, and cadastral numbers for each match.

输入参数querynumberstreetmax_resultspostal_codemunicipality_number

find_addresses_near

Find addresses near a coordinate

Find all official addresses within a radius of a coordinate (Kartverket). Each result includes its distance from the point. Good for 'what is at this location?'.

输入参数latitude必填radius_mlongitude必填max_results

validate_address

Validate and normalize an address

Check whether a free-text address exists in the official register and return its normalized form with coordinates. Uses fuzzy matching, so it also corrects small spelling errors. Returns `valid`, the best normalized match, and alternatives.

输入参数address必填

search_place_names

Search Norwegian place names

Search official Norwegian place names (Kartverket Sentralt stedsnavnregister). Returns each name's feature type (e.g. Fjell, Innsjø, By), municipality, county, and coordinates. Supports the * wildcard and corrects small spelling errors.

输入参数query必填max_results

find_place_names_near

Find place names near a coordinate

Find the nearest official named features to a coordinate (Kartverket). Each result includes its feature type and distance from the point.

输入参数latitude必填radius_mlongitude必填max_results

get_elevation

Get elevation at a coordinate

Get the terrain elevation (metres above sea level) at a coordinate from the Norwegian national elevation model (Kartverket DTM). Covers mainland Norway.

输入参数latitude必填longitude必填

get_elevation_profile

Get an elevation profile along a path

Sample the terrain elevation evenly along a path of coordinates (Kartverket DTM) and return the profile plus total distance, ascent, and descent. Useful for hikes and routes. Give the path vertices in order; `samples` controls resolution.

输入参数path必填samples

transform_coordinates

Transform coordinates between systems

Convert a coordinate between reference systems using Kartverket's transformer. Give EPSG codes for source and target. Axis order: x is easting (longitude for geographic systems), y is northing (latitude). Common EPSG codes: 4326 WGS84, 4258 EUREF89 (both lon/lat), 25832 UTM32/EUREF89, 25833 UTM33, 25835 UTM35 (east/north in metres).

输入参数x必填y必填to_epsg必填from_epsg必填

lookup_admin_unit

Look up municipality and county

Find which municipality (kommune) and county (fylke) a location falls in, with official codes (Kartverket). Give either a coordinate or a free-text address.

输入参数addresslatitudelongitude

lookup_property

Look up property (matrikkel) info

Look up cadastral (matrikkel) identifiers for a property via the open address register (Kartverket): municipality number, gårdsnummer (gnr), bruksnummer (bnr), and festenummer. Give a free-text address or a coordinate. Full ownership data requires Kartverket's authenticated Matrikkel API; this returns the open address-linked identifiers.

输入参数addresslatitudelongitudemax_results

resolve_stop_place

Resolve a place to a Stop Place ID

Turn a place or address into Entur Stop Place IDs (public transport stops/stations). Use the returned ID with the departure, trip, accessibility, quay, and fare-zone tools.

输入参数query必填max_results

find_stops_near

Find stop places near a coordinate

Reverse-geocode a coordinate to the nearest public transport stop places (Entur), each with its distance. Use the returned IDs with the departure and trip tools.

输入参数latitude必填radius_mlongitude必填max_results

plan_trip

Plan a public transport trip

Plan a point-to-point public transport journey in Norway (Entur JourneyPlanner). Give each endpoint either as a Stop Place ID or as coordinates. Optionally set a departure or arrival time, filter transport modes, and set walk speed. Returns trip patterns with legs, modes, durations, and realtime times.

输入参数to_placearrive_bydate_timefrom_placewalk_speedto_latitudeto_longitudefrom_latitudefrom_longitudetransport_modesnum_trip_patterns

get_departures

Get next departures from a stop

Get the next departures from a stop place (Entur), including realtime delays and cancellations. Each departure shows line, destination, scheduled and expected times, delay, platform, and whether it is cancelled.

输入参数countstop_place_id必填

get_realtime_status

Get realtime status for a stop or line

Get a realtime health summary. For a stop, pass stop_place_id: it summarizes how many upcoming departures are on time, delayed, or cancelled. For a line, pass line_id: it reports how many vehicles are currently active and their delays.

输入参数line_idstop_place_id

get_stop_accessibility

Get stop accessibility

Get accessibility information for a stop place (Entur): per-quay (platform) wheelchair access, and a summary. Note: Entur's free API exposes wheelchair access per quay; deeper equipment detail (elevators, tactile guidance) is only in Entur's authenticated Stop Register API and is not available here.

输入参数stop_place_id必填

list_quays

List quays (platforms) for a stop

List all quays (platforms/stopping points) at a stop place (Entur), with their public codes, coordinates, and wheelchair access.

输入参数stop_place_id必填

get_fare_zones

Get fare zones for a stop

Get the fare (tariff) zone(s) a stop place belongs to (Entur). Fare zones set the ticket price for a journey.

输入参数stop_place_id必填

find_shared_vehicles

Find shared vehicles nearby

Find free-floating shared vehicles (city bikes, e-scooters, car share, mopeds) near a coordinate across all Norwegian operators (Entur Mobility). Each result shows the operator, type, battery, and location.

输入参数countrange_mlatitude必填longitude必填form_factors

find_docking_stations

Find docking stations nearby

Find shared-mobility docking stations (e.g. city bike stations) near a coordinate (Entur Mobility), with available vehicle and free-dock counts per station.

输入参数countrange_mlatitude必填longitude必填

get_vehicle_positions

Get live vehicle positions

Get live positions of public transport vehicles (Entur realtime), filtered by operator codespace and/or line. Each vehicle shows its position, bearing, speed, and delay. Codespace examples: ATB (Trondheim), KOL (Stavanger), SKY (Bergen area). Get a line_id from get_departures.

输入参数line_idmax_resultscodespace_id

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分