
Elevation Mcp Server
io.github.cyanheadsv0.1.1更新於 Oct 1, 2026
Look up elevation worldwide, profile route ascent/descent, grid areas, check terrain line of sight.
概覽
讓助理查詢全球地面高程、分析路線的爬升與下降、取樣網格區域,並判斷地形視線是否被遮蔽。
- 功能
- 四個工具查詢免金鑰的高程資料來源:elevation_get_points 回傳 1-100 個座標點的地面高程(公尺與英尺),並附上資料集與解析度;elevation_get_profile 沿路線取樣並彙總距離、爬升、下降、高程範圍與最陡坡度;elevation_get_grid 在邊界框上取樣節點網格,回報最高點、最低點、平均高程與起伏;elevation_check_line_of_sight 結合地球曲率與折射判斷地形是否遮蔽視線。USGS 3DEP 涵蓋美國及其屬地以及加拿大與墨西哥大部分地區,其餘地區由 Open Topo Data(先 SRTM,再 Mapzen)提供。剖面、網格與視線都由點取樣在本機計算。
- 適用情境
- 適合助理需要地形事實的情境:某地點的地面高程、規劃路線的爬升與下降數據、某區域的最高與最低點,或兩點之間地形是否通視。它是唯讀查詢服務,適用於登山、測繪、無線電選址與地圖類問題,而非編輯或儲存資料。
- 執行需求
- 以本機 stdio 程序(或本機 Streamable HTTP 伺服器)執行,透過 npm 套件 @cyanheads/elevation-mcp-server 使用 Bun v1.4.0+ 或 Node.js v24+,也可使用已發佈的 Docker 映像。不需要 API 金鑰。需要連線至 USGS 3DEP 與 Open Topo Data 的網路。選用環境變數包括 OPENTOPODATA_BASE_URL(自架實例)、MCP_TRANSPORT_TYPE、MCP_HTTP_PORT、MCP_AUTH_MODE 與 MCP_LOG_LEVEL。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Elevation Mcp Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@cyanheads/elevation-mcp-server
Look up elevation worldwide, profile route ascent/descent, grid areas, check terrain line of sight via MCP. STDIO or Streamable HTTP.
Overview
Ground elevation and terrain analysis from two keyless sources: USGS 3DEP across the US and its territories (plus much of Canada and Mexico), and Open Topo Data everywhere else, which answers from SRTM GL1 v3 and, where SRTM has no tile, Mapzen terrain tiles. Look up spot heights, measure a route's ascent, descent, and grades, find an area's high and low points, and check whether terrain blocks a sightline. Runs as a stdio process or a local Streamable HTTP server.
Tools
Capability reference
elevation_get_points tool
points: 1–100{lat, lon}objects in decimal degrees (WGS84)- Each point comes back
okorno_data, withelevation_m/elevation_ft,dataset, andresolution_m(omitted formapzen); 3DEP answers addraster_idand the upstreamacquisition_date.points_with_datacounts the hits, and a point without data never fails the call
elevation_get_profile tool
path: 2–1,000 vertices in travel order (consecutive duplicates dropped);samples: 2–250 evenly spaced points along it, endpoints included (default 100)summarycarriestotal_distance_m,ascent_m/descent_m(and feet), start, end, min, and max elevation,highest_point/lowest_point, andmax_grade_pct/min_grade_pctwith where each occurs; ascent depends on the reportedsample_interval_m. Fails asdegenerate_path(under 1 m of route) orno_coverage(no sample has data)include_samples(defaulttrue) returnssamples[](distance, position, elevation, grade, dataset, and resolution per sample) and the sample table;falseomits both, while the summary, spacing, coverage counts, datasets, notices, and attribution are unchanged, still computed from every sample
elevation_get_grid tool
south,west,north,eastedges in decimal degrees (a box can't cross longitude 180);rowsandcols2–25 each (default 10), withrows × colsat most 250elevations_mandcell_datasetsmatrices indexed[row][col](row 0 north, column 0 west,nullwithout data), plussummary.highest,summary.lowest,mean_elevation_m, andrelief_m. Fails asinvalid_bbox,too_many_cells, orno_coverage- Nodes are point samples with the edges included, not cell averages; re-grid a smaller box around
summary.highestto refine a summit
elevation_check_line_of_sight tool
observerandtargetpoints, at most 1,000 km apart;observer_height_m(default 1.7) andtarget_height_m(default 0), each 0–10,000 m above ground;earth_modelflat,geometric,optical(default, κ 0.13), orradio(κ 0.25);samples3–250 (default 100)verdictisclear,blocked, orindeterminate(samples without data leave the line unconfirmed), withmin_clearance_m/min_clearance_ft, thelimiting_point, and thefirst_obstructionwhen blocked. Fails assame_endpoints(under 1 m apart),sightline_too_long(over 1,000 km apart), orendpoint_no_data- Terrain only: buildings, vegetation, and Fresnel zones aren't modeled beyond what the elevation source captures; over open water, clearance is measured to the sea surface
Failures shared by every tool
A coverage miss is never an error: it degrades to no data for that point. Any provider failure fails the whole call with no partial result, and each reason's recovery text names the call to make next.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Elevation-specific:
sourceon every tool:auto(default) queries USGS 3DEP inside its coverage and sends 3DEP misses and everything outside it to Open Topo Data;usgs_3depandopentopodatapin one provider. Only a coverage miss falls back, never an outage- Open Topo Data is asked for SRTM GL1 v3 first (about 30 m, land between 60°N and 56°S), then Mapzen terrain tiles where SRTM has no tile: high latitudes, Antarctica, and ocean bathymetry
- Per-call caps of 100 points or 250 samples or grid cells, inside a 45 s sampling budget; each 3DEP point is its own request, paced at 6 concurrent and 10 per second, while Open Topo Data takes 100 points per request
- The public Open Topo Data instance is paced under its published limits: one request at a time, starts at least 1.1 s apart, at most 1,000 in any trailing 24 hours per server process
- Profiles, grids, and sightlines are computed locally from point samples: haversine distances, great-circle resampling of routes and sightlines, and earth curvature with standard refraction
Agent-friendly output:
- Provenance on every value: each point, profile sample, grid cell, and sightline point names its
dataset(usgs_3dep,srtm30m,mapzen), with the source'sresolution_m(aresolution_m_rangeon profiles and grids) except for Mapzen; computed results adddatasets_usedcounts, and aSources:line credits every dataset that answered - Absent stays absent: a point or sample without data omits its elevation and a grid cell is
null, never 0, and computed summaries report how many values had data - Notices flag what changes interpretation: results mixing 3DEP and Open Topo Data, Mapzen values below 0 m (sea-floor depths), sample spacing coarser or finer than the source, and thin clearance margins
Getting started
Add the following to your MCP client configuration file.
Or with npx (no Bun required):
Or with Docker:
For Streamable HTTP, set the transport and start the server:
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- No API key: USGS 3DEP and Open Topo Data are both keyless.
- Optional: a self-hosted Open Topo Data instance with the
srtm30mandmapzendatasets, for heavy or hosted use (see Configuration).
Installation
- Clone the repository:
- Navigate into the directory:
- Install dependencies:
- Configure environment:
Configuration
With OPENTOPODATA_BASE_URL unset, the server uses the public instance at api.opentopodata.org and paces itself under its published limits: 100 locations per request, 1 request a second, and 1,000 a day per address. Any other URL is treated as a self-hosted instance (Open Topo Data is MIT-licensed and runs in Docker) and gets 4 concurrent requests with no rate windows. That instance must serve datasets named srtm30m and mapzen and accept at least 100 locations per request; otherwise calls fail with opentopodata_config_rejected.
See .env.example for every server setting and the common framework overrides.
Known limitations
- Open Topo Data's public limits. The public instance allows 100 locations per request, 1 request per second, and 1,000 requests per day per IP address. Each server process paces itself under them, but its count is process-local and resets on restart. Several processes on one machine (a stdio server per client session), or other clients on the same address, also draw on the upstream's count, so the upstream can refuse first (
opentopodata_rate_limited). - Hosted deployments. A hosted deployment sends every user's requests from one address, so on the public instance its whole user base shares one 1,000-a-day allowance: about 1,000 point lookups, or 333 full 250-sample calls, and as few as 111 when retries spend requests too. One caller can spend that day in about 18 minutes; for up to 24 hours after, every call that needs Open Topo Data fails with
opentopodata_daily_limit, including a US call inautomode with a single 3DEP miss. A hosted deployment needs both its own Open Topo Data instance (OPENTOPODATA_BASE_URL; MIT-licensed, Docker, loaded with thesrtm30mandmapzendatasets) and a per-client rate limit at its edge. Without its own instance, global answers on a hosted deployment are best-effort. - No per-caller limits in the server. A stateless deployment without auth has no caller identity, so the server paces each upstream for the whole process and can't ration one caller against another. A hosted endpoint needs a per-client rate limit at its edge (reverse proxy, CDN, or API gateway); without one, a caller sending many heavy calls at once slows USGS 3DEP for everyone, gets other callers' heavy calls refused until its lookups drain, and can spend the public Open Topo Data day.
- Global resolution. SRTM is a 30 m radar surface model. Mapzen's 1 arc-second grid is interpolated in places from coarser sources (GMTED2010 at 7.5 arc-seconds over parts of the high latitudes, ETOPO1 at about 1.8 km over the open ocean). Outside 3DEP coverage, profile ascent is therefore underestimated, and line of sight misses terrain narrower than the source's true resolution.
- Whole-meter values. Open Topo Data's datasets are integer rasters, and the upstream rounds the interpolated result to the nearest meter, so ascent and descent over gentle terrain from Open Topo Data include 1 m quantization steps.
- Water. SRTM reports water inside a land tile as 0 m. Beyond SRTM's tiles, Mapzen reports sea-floor depth, and points, profiles, and grids include it. 3DEP values over water depend on the raster: a hydro-flattened surface, sea level, or bathymetry. Line of sight measures clearance to 0 m over Mapzen values below 0, but uses 3DEP bathymetric values as received.
- Mixed models. 3DEP is a bare-earth DEM referenced to NAVD 88 in the conterminous US (local datums in some territories). SRTM is a radar surface model that partly includes canopy and buildings, referenced to EGM96. Mapzen blends both kinds by region. Differences of a meter or more between datasets at the same point are expected; per-value provenance shows which applies.
- Sampling. Features narrower than the sample spacing are missed: a ridge between line-of-sight samples, a summit between grid nodes, short climbs between profile samples. Spacing is always reported.
- USGS 3DEP throughput. The point query service has no published limit and no batch endpoint: about 10 points per second at this server's pacing, hence the 250-sample cap and 45 s budget. Each call keeps at most 6 lookups outstanding, so concurrent calls interleave and a short call isn't stuck behind a long one. A call whose lookups would push the queue past a running call's budget is refused at once with
sampling_deadline_exceededanddata.retryAfter, so two 250-sample calls at once run in turn: the first finishes, and the second can be retried after about 25 s. - Acquisition dates from USGS are passed through raw when they have the M/D/YYYY form, and sometimes carry a zero month or day; a value in any other form is omitted.
- Antimeridian. A grid box cannot cross longitude 180, so split it into two calls. Paths and sightlines crossing it are handled by great-circle math.
- Line of sight models terrain only, with no Fresnel-zone, building, or vegetation clearance. Observer and target must be at most 1,000 km apart; within that, the curvature term is the standard parabolic approximation, which overstates the curve's rise by at most about 10 m at the midpoint.
Running the server
Local development
-
Build and run the production version:
-
Run checks and tests:
Project structure
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor logging,ctx.statefor storage - Register new tools in
allToolDefinitionsinsrc/mcp-server/tools/definitions/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Data sources and attribution
Every successful result's Sources: line credits each dataset that answered, and a response that used any Mapzen value carries the full Mapzen attribution there. The public Open Topo Data instance publishes no terms beyond its usage limits; its server software is MIT-licensed and self-hostable.
Mapzen terrain tiles attribution, verbatim from the tilezen/joerd attribution document:
- ArcticDEM terrain data DEM(s) were created from DigitalGlobe, Inc., imagery and funded under National Science Foundation awards 1043681, 1559691, and 1542736;
- Australia terrain data © Commonwealth of Australia (Geoscience Australia) 2017;
- Austria terrain data © offene Daten Österreichs – Digitales Geländemodell (DGM) Österreich;
- Canada terrain data contains information licensed under the Open Government Licence – Canada;
- Europe terrain data produced using Copernicus data and information funded by the European Union - EU-DEM layers;
- Global ETOPO1 terrain data U.S. National Oceanic and Atmospheric Administration
- Mexico terrain data source: INEGI, Continental relief, 2016;
- New Zealand terrain data Copyright 2011 Crown copyright (c) Land Information New Zealand and the New Zealand Government (All rights reserved);
- Norway terrain data © Kartverket;
- United Kingdom terrain data © Environment Agency copyright and/or database right 2015. All rights reserved;
- United States 3DEP (formerly NED) and global GMTED2010 and SRTM terrain data courtesy of the U.S. Geological Survey.
This server is independent of the U.S. Geological Survey and of Open Topo Data, and is not endorsed by either.
Contributing
Issues are welcome. Run checks and tests before submitting:
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
來源:README.md,提交 314a295
工具
0版本歷史
1- v0.1.1最新Oct 1, 2026

