Skip to content
Back to search

mcp-server

Spatial Intelligence Layer for AI

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 18 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/geoinsight-ai/mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/geoinsight-ai/mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/geoinsight-ai--mcp-server/badge.svg)](/listings/geoinsight-ai--mcp-server)

HTML

<a href="/listings/geoinsight-ai--mcp-server"><img src="/api/listings/geoinsight-ai--mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 253 lines
  1. # GeoInsight's MCP for the Spatial Intelligence Layer for AI
  2. An MCP (Model Context Protocol) server, written in Rust with [rmcp](https://github.com/modelcontextprotocol/rust-sdk),
  3. that exposes geoinsight's [`ogc-dggs-api`](../ogc-dggs-api) as **task-shaped** tools for
  4. LLM agents — not a 1:1 mirror of the REST API.
  5. The API's real value is answering "what's the NDVI here" or "any burn scar here",
  6. not "list me some DGGS zones" — DGGRS/zone mechanics are how the data is indexed, not
  7. something a caller should have to reason about. So `get_insight` does the whole job
  8. internally (resolve concept → collection → resolution → covering zone(s) → per-property
  9. aggregation) and returns one clean answer. Zones, DGGRS grids, schemas and admin/order
  10. routes are deliberately **not** exposed as tools at all.
  11. ## Tools
  12. | Tool | What it does | Backend calls it composes |
  13. | --- | --- | --- |
  14. | `list_insights` | List available concepts (NDVI, burn scar analysis, ...) | `GET /concepts` |
  15. | `get_insight` | The main tool: one aggregated value of an insight at a point or over an area | `GET /concepts/{id}`, `GET /collections/{id}/dggs`, `GET .../zones`, `GET .../zones/{id}/data` (×N, concurrently), `GET /collections/{id}/queryables` |
  16. | `get_data` | Raw, unaggregated field values from one or more named collections at a location, optionally joined in one call | `GET /collections/{id}/dggs`, `GET .../zones`, `POST /dggs/{id}/zones/{id}/data` (×N, concurrently) |
  17. | `list_collections` | Browse raw dataset metadata directly (secondary/advanced) | `GET /collections` |
  18. | `get_collection` | Describe one dataset, including its `fields` (name, type, title, unit, aggregation stat) | `GET /collections/{id}`, `GET /collections/{id}/queryables` |
  19. `list_insights` and `get_insight` need this server's Auth0 client-credentials configured
  20. — they call `/concepts`, the one route the backend guards with a bearer token.
  21. `get_data`, `list_collections` and `get_collection` are open and work without it.
  22. ### How `get_insight` works
  23. Given an insight (by name or id) and a location (`lon`/`lat`, or a
  24. `min_lon`/`min_lat`/`max_lon`/`max_lat` box):
  25. 1. Resolve the insight to a concept (`GET /concepts/{id}`) by id, name, label or one
  26. of its `aliases`. The concept carries which collection(s) serve it and, for each,
  27. what it calculates there: `sources[].properties`, a name and an expression over the
  28. collection's fields, e.g. `ndvi` and `(B08_10m - B04_10m) / (B08_10m + B04_10m - 2000)`.
  29. A concept without an expression for the collection (e.g. burn scars, which run a
  30. process) reports its input fields (`sources[].inputs`) instead; a collection the
  31. concept doesn't list falls back to all fields.
  32. 2. Find the DGGRS grid for that collection (`GET /collections/{id}/dggs`, preferring
  33. `IVEA7H` — see gotcha below — unless overridden).
  34. 3. Choose the zone levels from the place and the data (see
  35. [Zone levels](#zone-levels)), then find the zone(s) at the answer level covering the
  36. location. A point resolves to the
  37. **single zone containing it** (zone polygons via `f=geojson`, point-in-polygon), not
  38. the 2-3 neighbours its small search box overlaps; an area to every zone it
  39. intersects, sampled **evenly** across the list if there are more than 64.
  40. 4. Fetch each zone's own value (`GET .../zones/{id}/data?zone-depth=0`, one call per
  41. zone, run concurrently). The concept's expression is sent unchanged as
  42. `alias[name]=expression&properties=name`, so the API calculates the value for each
  43. zone; this server never rewrites or evaluates a formula. A zone that fails is listed under `errors` and left out of
  44. the reduction; only if every zone fails is the call an error.
  45. 5. Reduce each property across the sampled zones using **that property's own
  46. configured statistic**: the concept's `output.stat` for the value it calculates,
  47. `gi_dggs_stat` from `GET /collections/{id}/queryables` for a stored field (e.g.
  48. `majority` for a categorical one like a country name), not a hardcoded guess. Numeric properties support
  49. `mean`/`sum`/`min`/`max`/`count`; anything non-numeric falls back to a majority vote
  50. across the sampled zones.
  51. The result is one JSON object: the insight, which collection/grid/resolution were used,
  52. how many zones were sampled, a `values` map of `{ value, stat, unit, sampled_zones }`
  53. per value, `errors` when some zones failed, and the same map fields as `get_data`
  54. (`parent_level`, `children_level`, `collections`, `parquet_requests`), so a map can draw
  55. the insight's value over the whole place.
  56. ### `get_data`: raw values for the model, Parquet requests for the map
  57. `get_insight` is concept-first and aggregated; `get_data` is the lower-level sibling for
  58. when you already know the collection(s)/field(s) you want. Given a location and a
  59. `collections` array (each `{ collection_id, fields?, alias?, filter? }`, mirroring the
  60. backend's cross-collection body; leave `fields` out to get every field in the collection's
  61. `/queryables` schema), it returns two things: a **small answer** for the
  62. model, and **Parquet requests** a map fetches and draws itself, so the full data never
  63. passes through the model or this server.
  64. `derived_fields` (optional, `{ name: expression }`) adds values the API calculates for
  65. each zone from the selected fields, e.g. `{ "ratio": "(a - b) / (a + b)" }`. This is how
  66. the model answers a request no insight covers: it reads a collection's fields and
  67. description with `get_collection` and writes the formula itself. The expression is
  68. CQL2-Text arithmetic and is sent unchanged as `alias[name]=expression`; with one plain
  69. collection it uses bare field names, otherwise the `prefix__field` column names. The
  70. calculated columns appear in `rows`/`summary` under their own names and in the
  71. `parquet_requests`. This is separate from a collection's `alias`, which only renames its
  72. column prefix.
  73. 1. Picks a DGGRS grid (first listed collection's `GET .../dggs`, preferring `IVEA7H`
  74. when available — see gotcha below — unless overridden).
  75. 2. Chooses the zone levels from the place and the data (see [Zone levels](#zone-levels)).
  76. 3. Resolves the location at the answer level. A point resolves to the **single zone
  77. containing it** (zone polygons via `f=geojson`, point-in-polygon), not the 2-3
  78. neighbours its small search box overlaps; an area to every zone it intersects.
  79. 4. **Small answer:**
  80. - 20 matched zones or fewer → `rows`: one flat row per zone,
  81. `{ zone_id, prefix__field: value, ... }` (`prefix` = `alias` or `collection_id`),
  82. from `POST /dggs/{dggrs_id}/zones/{zone_id}/data` per zone.
  83. - More → `summary`: per field, min/mean/max for numbers or the most common values
  84. otherwise, computed over up to 64 zones sampled evenly across the area
  85. (`summary_sampled_zones`).
  86. 5. **`parquet_requests`:** one Parquet request per parent zone covering the location (up to 16;
  87. `requests_truncated` beyond that), each `{ parent_zone_id, method, url, body? }`. One
  88. collection with no alias/filter → the per-collection `GET .../zones/{parent}/data`;
  89. otherwise the cross-collection `POST`, so several collections come back as one
  90. combined view. `zone-depth` is omitted so the backend expands each parent by its
  91. default depth (and can serve it from its cache) — about 118,000 children per parent on
  92. IVEA7H.
  93. 6. If a collection fails at a zone, the zone is retried one collection at a time so the
  94. others' values still come back; each failure is listed under `errors` with the
  95. backend's `hint`. A collection that fails at **every** sampled zone is left out of the
  96. Parquet requests (`excluded_collections`). Only if no zone returns anything is the call an error.
  97. ### Zone levels
  98. Neither tool uses a fixed zone level. Each picks three from the size of the place
  99. (the bbox's longer side; a point counts as 1 km) and the finest pixel size of the
  100. chosen fields (`gi_gsd` in the collection's queryables, which raster collections record
  101. per band; vector collections have none):
  102. - **children** (what the map draws) = the place's level plus the grid's default depth
  103. (`defaultDepth` from `GET /dggs/{id}`, 6 on IVEA7H), but never finer than the
  104. data's pixel size: below that, children would only repeat the same pixel. The
  105. place's level is the finest whose zones are still as wide as the place.
  106. - **parent** (one Parquet request each) = children minus the default depth, so the
  107. backend expands each parent by its cached default. Children shallower than the
  108. default depth use level-0 parents and send `zone-depth` explicitly.
  109. - **answer** (what the small answer is sampled at) = the zone containing a point at
  110. the children level, or two levels below the place's level for an area (~49 zones).
  111. Zone widths come from the grid's aperture (read from its id, e.g. 7 in `IVEA7H`):
  112. an icosahedral grid has `10·aperture^level + 2` equal-area zones per level. On IVEA7H
  113. that is ~21 km at level 6, ~1.1 km at 9 and ~61 m at 12. For example, a ~3 km town on
  114. 10 m Sentinel-2 bands draws level-13 children (~23 m) under level-7 parents, while a
  115. ~100 km park on vector data draws level 10 under level 4. Passing `zone_level`
  116. overrides the children level.
  117. `zone_depth` (default `"0"`, one value per zone) passes straight through to the
  118. backend's own zone-depth expansion if you want finer detail *within* a resolved zone;
  119. be aware that expanding it can return a lot of values very fast (thousands, not
  120. gotcha-free — see below).
  121. **Known backend gotchas** (found via live testing against `api-dev.geoinsight.ai`,
  122. independent of this server, worth their own bug reports against `ogc-dggs-api`):
  123. - The bbox filter treats an exact `min == max` (degenerate/point) box as unbounded and
  124. returns effectively the whole global grid instead of the single containing zone. Both
  125. `get_insight` and `get_data` work around this by expanding a point to a ±0.0005° box
  126. before querying.
  127. - The DGGRID-backed grids (`ISEA3HDGGRID` — which happens to sort first in every
  128. collection's DGGRS list — and likely its siblings) can 500 on zone data at finer
  129. resolutions with `"No regions: bbox is empty"`, reproducible with plain `curl`,
  130. unrelated to this server. Both `get_insight` and `get_data` default to `IVEA7H`
  131. instead of "whichever grid sorts first" for exactly this reason; override `dggrs_id`
  132. explicitly if you need a different grid and hit this.
  133. - `GET .../data` without an explicit `zone-depth` picks a server-chosen `defaultDepth`
  134. that can be surprisingly deep (thousands of values for one small zone) — both tools
  135. always pass `zone-depth=0` unless you override it, to keep responses bounded.
  136. - Live STAC collections (e.g. `sentinel-2-l2a`) make the API search Copernicus once per
  137. zone request, and Copernicus rate-limits bursts — a 64-zone area query on Jasper
  138. National Park was refused with `429 Too Many Requests`, which the API passes on as a
  139. **500** whose hint contains "Too Many Requests". A burst of 8 still had half refused, while 4
  140. got through, so this server keeps at most 4 per-zone requests in flight per tool call,
  141. and retries a rate-limited response (a real 429, or a 5xx with that text) up to 3 times,
  142. honouring `Retry-After` or backing off ~1s/2s/4s with jitter so a refused burst doesn't
  143. retry all at once.
  144. **Not handled yet**: place names ("Lisbon") aren't geocoded — both tools take
  145. coordinates only, relying on the calling agent's own geographic knowledge to turn a
  146. place into a point/bbox. Revisit if that turns out not to be precise enough.
  147. Every tool returns JSON, pretty-printed. Non-2xx responses become an MCP tool error
  148. whose `data` field carries the backend's own error body (the API includes a helpful
  149. `hint` field, e.g. listing valid DGGRS ids on a 404).
  150. ## Configuration
  151. All configuration is via environment variables.
  152. | Variable | Required | Default | Purpose |
  153. | --- | --- | --- | --- |
  154. | `OGC_DGGS_API_BASE_URL` | no | `http://localhost:3001` | Base URL of the ogc-dggs-api instance to call |
  155. | `OGC_DGGS_API_PUBLIC_URL` | no | `OGC_DGGS_API_BASE_URL` | The same API's URL as the caller reaches it, used for `get_data`'s `parquet_requests`. Set it when `OGC_DGGS_API_BASE_URL` is an internal address (e.g. in-cluster DNS in k8s) |
  156. | `AUTH0_DOMAIN` | only for `list_insights`/`get_insight` | — | Auth0 tenant domain, e.g. `geoinsight.us.auth0.com` |
  157. | `AUTH0_CLIENT_ID` | only for `list_insights`/`get_insight` | — | Auth0 M2M application client id |
  158. | `AUTH0_CLIENT_SECRET` | only for `list_insights`/`get_insight` | — | Auth0 M2M application client secret |
  159. | `AUTH0_AUDIENCE` | only for `list_insights`/`get_insight` | — | API identifier configured on the Auth0 API (same value the ogc-dggs-api validates as `AUTH0_AUDIENCE`) |
  160. | `RUST_LOG` | no | `info` | Standard `tracing` filter |
  161. The server uses the Auth0 client-credentials (machine-to-machine) grant: it fetches a
  162. token from `https://{AUTH0_DOMAIN}/oauth/token` and caches/refreshes it automatically.
  163. All four `AUTH0_*` variables must be set together or auth is left disabled (`get_data`,
  164. `list_collections`/`get_collection` still work without it; `list_insights`/`get_insight`
  165. will fail with the backend's own 401).
  166. ## Build
  167. ```sh
  168. cargo build --release
  169. ```
  170. The binary is `target/release/ogc-dggs-mcp`.
  171. ## Run with Claude Code / Claude Desktop
  172. Add to your MCP config (e.g. `claude_desktop_config.json`, or via `claude mcp add`):
  173. ```json
  174. {
  175. "mcpServers": {
  176. "ogc-dggs": {
  177. "command": "/absolute/path/to/target/release/ogc-dggs-mcp",
  178. "env": {
  179. "OGC_DGGS_API_BASE_URL": "https://api-dev.geoinsight.ai",
  180. "AUTH0_DOMAIN": "your-tenant.us.auth0.com",
  181. "AUTH0_CLIENT_ID": "...",
  182. "AUTH0_CLIENT_SECRET": "...",
  183. "AUTH0_AUDIENCE": "..."
  184. }
  185. }
  186. }
  187. }
  188. ```
  189. Point `OGC_DGGS_API_BASE_URL` at whichever deployment you want:
  190. `http://localhost:30001` (local dev), `https://api-dev.geoinsight.ai`, or
  191. `https://api-mr.geoinsight.ai`.
  192. The server talks JSON-RPC over stdio — it must not print anything to stdout itself;
  193. all logs go to stderr via `tracing`.
  194. ## Project layout
  195. - `src/config.rs` — env var loading
  196. - `src/auth.rs` — Auth0 client-credentials token fetch/cache
  197. - `src/client.rs` — thin reqwest wrapper: builds requests, attaches auth, maps HTTP
  198. errors to MCP tool errors
  199. - `src/bearer_auth.rs` — validates an HTTP caller's Auth0 bearer token (JWKS/RS256)
  200. - `src/http_transport.rs` — the HTTP transport: `/mcp` behind the bearer check, `/healthz`
  201. - `src/server/` — the `DggsServer` MCP server (`mod.rs`: the server and its combined tool
  202. router):
  203. - `tools/` — what MCP clients see, each file with the helpers only it uses:
  204. - `insights.rs` — `list_insights`, `get_insight`: concept resolution, per-zone values,
  205. per-property reduction
  206. - `collections.rs` — `list_collections`, `get_collection`: metadata and fields from
  207. `/queryables`
  208. - `data/` — `get_data`: per-zone fetching with per-collection fallback (`mod.rs`),
  209. flat rows, summary and sampling (`rows.rs`), parent-zone Parquet requests
  210. (`parquet.rs`)
  211. - `stats.rs` — `get_call_stats`
  212. - `dggs/` — internal, shared by the tools: `extent.rs` (point/bbox arguments),
  213. `level.rs` (zone levels from place size and pixel size), `zones.rs` (grid and zone
  214. lookups), `aggregate.rs` (`mean`/`sum`/`min`/`max`/
  215. `count` and majority vote)
  216. - `src/main.rs` — wiring: picks the stdio or HTTP transport

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.