{"$schema":"https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json","name":"io.mapscale/maps","title":"MapScale","description":"Maps for Thailand: MapLibre styles, Thai geocoding, autocomplete, routing, matrix, isochrones.","version":"0.1.0","websiteUrl":"https://mapscale.io","remotes":[{"type":"streamable-http","url":"https://api.mapscale.io/mcp","supportedProtocolVersions":["2025-06-18","2025-03-26","2024-11-05"],"headers":[{"name":"X-API-Key","description":"MapScale API key (pk_ or sk_). Optional: the quickstart, style URL and status tools need no key.","isRequired":false,"isSecret":true},{"name":"Authorization","description":"Alternative to X-API-Key: `Bearer <key>`.","isRequired":false,"isSecret":true}]}],"serverInfo":{"name":"mapscale-mcp","version":"0.1.0"},"transport":{"type":"streamable-http","endpoint":"https://api.mapscale.io/mcp"},"capabilities":{"tools":{"listChanged":false}},"_meta":{"io.mapscale/tools":[{"name":"mapscale_products","description":"Lists MapScale's products (APIs, SDKs, datasets and tools) with what each does, whether it needs an API key, and its docs URL. Optional filter by need."},{"name":"mapscale_thailand_quickstart","description":"Returns copy-paste code for adding a MapLibre map of Thailand to a project: a complete, working example for maplibre-html, next, react, or react-native, including a keyless demo path (OpenStreetMap-based PMTiles) and the hosted style URL path that needs a MapScale publishable key. Useful when a project needs a Thailand basemap with Thai or English labels."},{"name":"mapscale_style_url","description":"Build the MapScale MapLibre style URL (self-contained: tiles+glyphs on the same origin). Drop straight into `new maplibregl.Map({ style })`. Params: lang (th/en), accent (6-digit hex), hide (layer groups)."},{"name":"mapscale_newsroom_map","description":"Make a choropleth map of Thailand by province or district with NO API key and no studio clicks: returns the MapScale newsroom studio link, a bare-map link, ready-to-paste responsive embed code and SVG/PNG image links, for a curated dataset (elderly share, rainfall, income, population density, forest, rice...) or the user's own numbers by province/district name (English or Thai). Free for editorial use with a 'Map: MapScale' credit linking to mapscale.io. Use for any \"map these numbers\" / \"map X across Thailand\" request from a journalist or writer."},{"name":"mapscale_status","description":"Check the MapScale API's health/dependency status (public endpoint, no key)."},{"name":"mapscale_geocode","description":"Geocode a query to coordinates. Accepts Thai-script or English queries (addresses, POIs, Thai administrative areas such as province, district and subdistrict) and returns a Mapbox-shaped GeoJSON FeatureCollection built on OpenStreetMap data. Requires a secret (sk_) key."},{"name":"mapscale_reverse","description":"Reverse-geocode a lng,lat point (Thai admin areas, addresses)."},{"name":"mapscale_autocomplete","description":"Address/place autocomplete session call — Google Places-shaped {predictions:[…]} for building a Thai address search box. Pass a stable session_token per user session."},{"name":"mapscale_place","description":"Fetch full place details by id from geocode/autocomplete results (photon:… or places uuids)."},{"name":"mapscale_route","description":"Driving/walking route between waypoints (Thailand-tuned Valhalla). Mapbox-shaped response. Coordinates are [lng, lat] pairs."},{"name":"mapscale_matrix","description":"Travel-time/distance matrix (≤25×25) — logistics, store-finder sort. sources and targets are [lng, lat] pair arrays."},{"name":"mapscale_isochrone","description":"Isochrone contours around a point as GeoJSON — contours in minutes (\"5,10,15\") or kilometers (\"1km,2km\")."},{"name":"mapscale_datasets_list","description":"List the datasets uploaded to your MapScale account (GeoJSON served as vector tiles). Each entry has id, name, slug, tilesetId (ds_<uuid>), feature count, geometry type and bbox. Requires a secret (sk_) key and an API deployment with the datasets endpoint."},{"name":"mapscale_dataset_upload","description":"Upload a small GeoJSON FeatureCollection (WGS84, up to 1000 features and 256 KB inline) as a dataset and serve it as vector tiles at /tiles/v1/ds_<id>/{z}/{x}/{y}.mvt. Larger files: POST to /v1/datasets directly. Requires a secret (sk_) key. Creates a stored dataset, so confirm with the user first."},{"name":"mapscale_catalog","description":"Browse the MapScale Thailand data catalog (hazard, boundary and reference layers). Without an id returns the layer list; with an id returns that layer's details. Requires an API deployment with the catalog endpoint."},{"name":"mapscale_analysis","description":"Run a spatial analysis on GeoJSON: buffer, aggregate, nearest or intersect. `params` is the JSON request body for that operation, as documented in the MapScale analysis reference (https://mapscale.io/docs). Requires a secret (sk_) key and an API deployment with the analysis endpoints."},{"name":"mapscale_styles_list","description":"List the saved map styles in your MapScale account. Each can be loaded in MapLibre from its /styles/v1/st_<id> URL. Requires a secret (sk_) key and an API deployment with the styles endpoint."},{"name":"mapscale_places_search","description":"Search MapScale's own places index: POIs, admin areas (province, district, subdistrict), custom areas and major streets. Returns ranked candidates with stable feature keys. `types` is a comma-separated filter (e.g. condo,school,province). Requires an API key."},{"name":"mapscale_places_nearby","description":"Find MapScale POIs near a point, ordered by crow-fly distance (baseScore is metres). Optional `types` filter is comma-separated POI types. Requires an API key."},{"name":"mapscale_place_by_slug","description":"Resolve one MapScale POI or custom area by its stable URL slug (custom areas include their polygon and bounding box). Requires an API key."},{"name":"mapscale_admin_area_reverse","description":"Point-in-polygon lookup: the Thai administrative area (province, district, subdistrict) containing a lng,lat point. Requires an API key."},{"name":"mapscale_environmental","description":"Environmental data lookups, chosen by `op`. admin_area_metrics: latest metric per admin area (areas [{level, code}], metrics [keys], optional as_of). flood_exposure: flood-event recurrence for up to 500 keyed points. elevation: Copernicus GLO-30 elevation for up to 500 keyed points. waterways: hydrography GeoJSON in a bbox. sources: provenance and coverage of the environmental datasets. All operations only read data. Requires an API key."},{"name":"mapscale_static_map","description":"Build the URL of a static PNG map of Thailand (no download, no network call) plus a markdown image line. Give `center` [lng, lat] and `zoom`; optional size, retina, labels language, accent colour and up to 24 markers. The URL carries the key as `?key=` only when a publishable pk_ key is configured, otherwise a pk_live_YOUR_KEY placeholder."},{"name":"mapscale_assistant_plan","description":"Turn a sentence (English or Thai) into up to three validated map actions: style, buffer/aggregate/nearest analysis, ranking, or a clarifying question. With a secret key and dataset_ids (1-4 dataset UUIDs) it plans against your datasets. Without a key it answers against a fixed 12-shop demo dataset (prompt up to 300 characters, rate limited)."},{"name":"mapscale_atlas","description":"Public Thailand atlas data (no key needed), chosen by `op`. catalog: layer registry. province_metrics: latest environmental metrics per province. traffic_incidents: current traffic incidents. snapshot: layer metadata for a bbox (bbox, layers). layer: GeoJSON for one layer (layer_id, bbox). intelligence: server intelligence layers for a bbox (bbox, ids). cameras: public camera catalogue (optional bbox). air_quality_history: OpenAQ series (location_id, sensor_id, from, to). forecast: TMD forecast (lat, lng). bus_stop: route associations (stop_id). project_site: OSM plot and buildings (project_id)."},{"name":"mapscale_intelligence","description":"Read MapScale Intelligence data for one product (land, civic or defense), chosen by `op`: search (q), overview, usage (usage and limits), or a listing of entities, evidence, reports, alerts, assessments, incidents, dependencies, cases, watches or jobs (optional cursor); report returns one report by id. Read-only. Requires a secret (sk_) key with Intelligence access."},{"name":"mapscale_show_thailand_map","description":"Show an interactive map of Thailand inline (MapLibre on OpenStreetMap data). Give a `place` (a major Thai city/province such as Bangkok, Chiang Mai, Phuket — other places need a MapScale key) or an explicit `center` [lng, lat], plus an optional `zoom` (1-18) and `markers` ([{lng, lat, name}]). Use for any \"show me X on a map\" request about Thailand."}]}}