StatsMapped Public Data

com.statsmapped由 statsmapped.com 發布官方發布者v0.3.2更新於 Nov 7, 2026

Public statistics for Ireland and the UK: housing, crime, health, economy, welfare, with caveats.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取資料與分析

概覽

AI 產生的概覽

查詢 StatsMapped 的愛爾蘭與英國公開統計資料(住房、犯罪、健康、經濟、福利),並附上注意事項與引用資訊。

可以做什麼
  • 查找資料集與數值:列出所追蹤的統計項目,或取得某個地區可用的資料集、最新數值、年增率變化,以及含歷史的完整詳情
  • 列出地區:依所選邊界層級回傳某國的郡、地方政府轄區、區等地的 id 與名稱
  • 排名與比較:依某項統計對地區排名,查詢已登錄的跨資料集比較組合及其相關性統計,或判斷兩項統計是否可比
  • 解釋指標:提供單項統計的定義、方法與既有注意事項
  • 取得場景資料:為可引用的圖表或短片提供資料列、表格副本、替代文字與授權資訊
  • 列出顯著變化:依時間倒序回傳被標記為顯著的統計變動,可限定到某項統計或某個地區
適用情境
適合需要依郡或地方政府轄區取得可引用的愛爾蘭、英國官方統計資料,或需要說明某項指標含義與測量方式,而不想自行爬取與解析發布方網頁的情境。
執行需求
可透過 PyPI 套件 statsmapped-mcp 在本機以 stdio 執行(用 pip 安裝或用 uvx 執行),也可連線到託管的 Streamable HTTP 端點。不需要 API 金鑰或帳號,但會呼叫 StatsMapped 的公開 HTTPS API,因此需要網路存取。所有工具都帶 country 參數,預設為愛爾蘭。
安裝前請注意
僅執行唯讀 GET 呼叫,不寫入資料。每次工具呼叫後,用戶端會向 StatsMapped 送出一個小型使用事件,包含工具名稱、結果狀態、延遲、stat_key 或 area_id 等識別型參數,以及存放在 ~/.statsmapped-mcp/install_id 的隨機安裝 id;設定 STATSMAPPED_NO_LOG=1 或 DO_NOT_TRACK=1 即可關閉。公開 API 依來源 IP 限流(每小時 600 次請求),託管端點的所有使用者共用同一個出口 IP。比較結果僅限已登錄且人工審核的組合,多數組合正常會回傳「unknown」。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 StatsMapped Public Data,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.statsmapped%2Fpublic-data/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "statsmapped-public-data": {
      "type": "http",
      "url": "https://mcp.statsmapped.com/mcp"
    }
  }
}

README

statsmapped-mcp

An MCP server exposing StatsMapped's public API as tools for AI agents (Claude Desktop, Cursor, and any other MCP client).

StatsMapped tracks public data for Ireland (by county) and the UK (by local authority) — housing, crime, health, the economy and social welfare — from official publishers (CSO, PSRA, Central Bank of Ireland, DHLGH, NTPF, the Office of Government Procurement, EU Publications Office for Ireland; ONS/HM Land Registry/Nomis/DfE/DfT for the UK), each figure carrying its own caveats. This package lets an agent query that data directly as tool calls instead of crawling and parsing web pages. Every tool below takes a country argument ("ireland" or "united-kingdom", default "ireland") — the two countries track genuinely different datasets and geography levels, so call query_data/list_areas for the country you actually want rather than assume Ireland's defaults apply.

This is a thin client. It calls StatsMapped's already-public, unauthenticated HTTPS API (documented at statsmapped.com/openapi.json); no API key is needed for anything below. Runs on your own machine over stdio by default (the recommended way to use it today) -- see Why stdio for a hosted streamable-http mode this package also supports, and the real tradeoff that comes with it.

Install

Published on PyPI as statsmapped-mcp (confirmed live: https://pypi.org/project/statsmapped-mcp/):

bash
pip install statsmapped-mcp

Configure

Add to your MCP client's config (for Claude Desktop, claude_desktop_config.json; Cursor uses an equivalent mcp.json):

json
{  "mcpServers": {    "statsmapped": {      "command": "statsmapped-mcp"    }  }}

Tools

6 tools (consolidated from an original 9 -- query_data and compare are each one tool with a few modes, chosen by which arguments you give, rather than several near-identical single-purpose ones). Every tool takes a country argument ("ireland" or "united-kingdom", default "ireland") — Ireland and the UK track different datasets and geography levels, so call query_data/list_areas for the country you want rather than assume Ireland's defaults apply.

  • query_data(area_id=None, dataset=None, history_months=0, country="ireland") — three modes:
    • neither area_id nor dataset: every stat StatsMapped tracks for one country, with its key, label, and which geography levels it's published at. Start here.
    • area_id given, dataset omitted: every dataset available for one area (e.g. "county:kerry" for Ireland, "uk:lad:e09000033" for the UK), with its latest figure and year-on-year change. Caveats are projected to label + severity only, not full text — the point is deciding which datasets matter before paying for the full detail on any one of them.
    • both area_id and dataset given: full detail on one dataset in one area — a written summary, full caveat text, and (optionally, via history_months) recent history.
  • list_areas(level="county", country="ireland") — every geography at one boundary level. level defaults to Ireland's 26 counties; the UK's own primary level is "lad" (local authority districts), not "county" — other levels exist per country too (Ireland's local_authority/garda_division among them).
  • compare(stat_key=None, level=None, pair_key=None, stat_key_a=None, stat_key_b=None, country="ireland") — four modes, exactly one set of arguments at a time (mixing them raises an error):
    • stat_key alone: every area at one level, ranked by its latest figure for that stat, highest first.
    • pair_key alone: full detail for one registered comparison pair — each axis's label/unit/publisher, the correlation stats (r, rho, a leave-one-out sensitivity range), and caveats. pair_key comes from the no-argument mode below.
    • both stat_key_a and stat_key_b: does StatsMapped have a registered, hand-vetted comparison between these two stats? Registry-backed only — never computes a fresh correlation for an arbitrary pair. comparable is a string, not a bool: "yes" (a registered, hand-vetted pair; pair_key names it), "no" (the two stats share no geography level at all), or "unknown" (not registered, but not ruled out: treat as "ask a human", not "probably yes"). "unknown" is the normal result for most pairs. Compare the value explicitly (result["comparable"] == "yes"); a truthiness test is true for all three. reasons (a list) always explains the answer.
    • none of the above: every registered cross-dataset comparison pair for one country (e.g. "median sale price vs new dwelling completions per 1,000 residents"). A small, hand-curated set, not an arbitrary-pair engine.
  • explain_metric(stat_key, country="ireland") — definition, methodology and standing caveats for one stat, never a current figure. Use this when the question is about what a metric means or how it's measured, not about one area's value.
  • get_scene(scene_id="ireland-builds", purpose="analytical", vintage=None, country="ireland") — the data to draw one chart or short clip of a citable figure (rows, a table twin, alt text, the licence block, scene_hash), nothing rendered. Two scenes exist: "ireland-builds" and "county-in-motion" (one county against the county median, one row per year; pass county="county:cork" and terms="real" or "nominal"). A promotional use of a source whose licence forbids advertising is refused.
  • notable_changes(limit=8, stat_key=None, geography_id=None, country="ireland") — the statistical movements StatsMapped flagged as notable, newest first (limit 1 to 50), optionally narrowed to one stat or one area. They are movements, not verdicts on what they mean.

Citing an answer. A single-figure answer (query_data with both arguments, compare with pair_key, explain_metric) carries attribution: the publisher's own required wording when the publisher states one (for example "Source: Office for National Statistics. Contains public sector information licensed under the Open Government Licence v3.0."), otherwise StatsMapped's note. StatsMapped's note is always in attribution_note. Quote attribution where you show the figure; publisher, license and licence_class sit beside it (on each axis, for a comparison). A list of many datasets (query_data with area_id alone) has more than one publisher, so its top-level attribution is StatsMapped's note, and each entry carries its own publisher's attribution when that publisher states one. notable_changes carries only attribution_note.

Why stdio, not a hosted server, by default

StatsMapped runs on a single free-tier instance. A remote MCP endpoint hosted there would let an agent's own multi-area query pattern (calling the same tool once per area, in a loop) reproduce exactly the load pattern that has already caused timeouts on that instance under a large geography fan-out. Running over stdio means every call goes through your own network connection to the same public HTTPS API this package's tools call directly, with no shared bottleneck -- each user's own machine makes the HTTP calls, so N users' traffic is naturally spread across N source IPs, not funnelled through one.

server.py also supports a real hosted streamable-http mode (MCP_TRANSPORT=streamable-http) for a deployment that accepts that tradeoff -- StatsMapped's public API is itself rate-limited per source IP (600 requests/hour), but a hosted MCP endpoint proxies every remote user's calls through ONE shared egress IP, so all remote users of a hosted endpoint would share that one bucket rather than each getting their own. A StatsMapped-hosted endpoint is live at https://mcp.statsmapped.com/mcp (Streamable HTTP) -- confirmed responding correctly, no separate install needed for a client that speaks Streamable HTTP directly. The bare host (https://mcp.statsmapped.com, no path) redirects to the same endpoint as a courtesy.

What the client reports, and how to turn it off

After each tool call the client sends one small usage event to StatsMapped. It contains:

  • the tool name, whether the call succeeded, how it ended (answered, empty, error or unsupported) and its latency;
  • identifier-shaped arguments from a closed list, such as stat_key or area_id, and never free text;
  • a random install id kept in ~/.statsmapped-mcp/install_id.

To send nothing, set either of these in the server's environment (for example in the env block of your MCP client config):

  • STATSMAPPED_NO_LOG=1
  • DO_NOT_TRACK=1 (the cross-tool convention)

With either set, no event is sent and no install id is written.

Development

bash
cd mcp-serverpip install -e .python tests/test_client.py

The test suite runs against the real live API (https://statsmapped.com by default, or STATSMAPPED_MCP_BASE_URL if set) — read-only GETs only, nothing here writes any data or needs a key.

Licence

MIT for this package. The underlying data keeps each publisher's own licence — see statsmapped.com/ireland/sources for Ireland's own publisher/licence detail before reusing any figure outside of querying it through an agent (a UK equivalent page doesn't exist yet — check each UK tool response's own caveats/sources fields in the meantime).

來源:README.md,提交 54bf67e

工具

5

query_data

Use when you need to find which datasets exist, which exist for one area, or the figures and history for one area and dataset (or a council planning view). For what a metric means use `explain_metric`; for how areas rank use `compare`. Three modes, depending on which of `area_id`/`dataset` are given (plus a planning mode, `council`, described last) -- consolidates what were three separate tools (list_datasets, list_area_datasets, get_dataset_for_area) behind one, since they are all really "how do I get data" at different levels of specificity: 1. Neither `area_id` nor `dataset`: lists every dataset (stat) StatsMapped tracks for one country ('ireland' or 'united-kingdom'), with its key, human label, and which geography levels it can be shown at. Ireland and the UK track genuinely different datasets -- call this first for the right country before assuming a stat_key exists there, to find the right `stat_key` for `compare`'s ranking mode. 2. `area_id` given, `dataset` omitted: lists every dataset available for that one area (e.g. "county:kerry" for Ireland, "uk:lad:e09000033" for the UK), with its latest figure, year-on-year change, and caveat labels only (not full caveat text -- use mode 3 for the full detail on any one dataset that matters). Pass `stat_key` (from mode 1) to list only that stat's series for the area: a full listing is tens of KB, one stat is a few hundred bytes. `area_id` comes from `list_areas`; `country` must match whichever country that call used, or this simply 404s ("unknown geography"). 3. Both `area_id` and `dataset` given: full detail for one dataset in one area -- the latest figure, a written summary, full caveat text, and (if `history_months` is set) recent history. `dataset` is a `series_key` from mode 2's own response. `history_months` means actual months of history (0 = everything) --

輸入參數area_idcouncilcountrydatasetstat_keyhistory_months

list_areas

Use when you need the ids and names of the areas (counties, local authorities, districts) to pass to `query_data`. List every geography at one boundary level, for one country ('ireland' or 'united-kingdom'). `level` defaults to "county" (Ireland's 26 counties); the UK's own primary level is "lad" (local authority districts), not "county". Other levels exist per country (e.g. Ireland's "local_authority", "garda_division") -- see a dataset's own `compatible_levels` from `query_data` for which levels a given stat is actually published at. Returns each area's `id` (used by `query_data`'s area-scoped modes, always paired with the SAME `country`), `name` and `level`. Slim by default; `include_parents=True` adds each area's `parents` (the regions it sits in) and Irish-language name.

輸入參數levelcountryinclude_parents

compare

Use when the question is how areas rank or compare on a stat, or whether two stats can be compared fairly. For one area's own figures use `query_data`. Four modes, depending on which arguments are given -- consolidates what were four separate tools (rank_areas, list_comparisons, get_comparison, check_comparability) behind one, since they are all really "how does this stat compare" at different scopes. Exactly one mode's arguments should be given; mixing arguments from different modes (e.g. both `stat_key` and `pair_key`, or only one of `stat_key_a`/`stat_key_b`) raises an error rather than silently guessing which mode was meant. 1. `stat_key` alone (no `pair_key`, no `stat_key_a`/`stat_key_b`): ranks every area at one geography level by its latest figure for that stat, for one country -- e.g. "which counties have the highest median sale price" (country="ireland"). `stat_key` comes from `query_data`'s dataset-listing mode, for the SAME country. `level` omitted uses this ranking's own default level; pass one of that dataset's own `compatible_levels` for a different one -- a level this ranking doesn't have registered returns an empty list rather than an error. Where the underlying stat has no honest per-area denominator (crime, homelessness, live_register and similar -- StatsMapped's own RANKING_NO_DENOMINATOR_STATS), each row's `rate_per_1000` is the real figure to rank/compare by, not `latest_value`, which is a raw count dominated by area population size. Always carry forward every entry in `caveats` when using a row in an answer. 2. `pair_key` alone: full detail for one registered comparison pair -- each axis's label, unit and publisher, the correlation stats (r, rho, and a leave-one-out sensitivity range naming the single most influential area), and caveats. `pair_key` comes from mode 4's own response, for

輸入參數levelcountrypair_keystat_keystat_key_astat_key_b

explain_metric

Use when the question is what a metric means or how it is measured; for a figure use `query_data`. Definition, methodology and standing caveats for ONE stat ('ireland' or 'united-kingdom') -- never a current figure. Call this when the question is about what a metric MEANS or how it's measured ("how is the claimant count defined", "is this a mean or a median"), not about a specific area's value -- `query_data`/`compare` already answer that. `stat_key` comes from `query_data(country=...)` for the SAME country.

輸入參數countrystat_key必填

get_scene

The data to DRAW one scene, nothing rendered: use it when asked for a chart, still or short clip of a figure you can cite. Today one scene exists, "ireland-builds" (Ireland's homes granted permission, with a commencement notice and completed, by quarter from 2018Q1). The licence DIFFERS BY STAGE (see `licence.stages`): a stage whose licence is unconfirmed or ShareAlike is withheld (its cells are absences, not zeros) and the licence line names its holder. You get rows, a table twin, alt text, notes, `absences` (a missing figure is a typed absence, never a zero), the licence block, `scene_hash`, a `receipt` and the canonical URL. YOU draw it, and the last frame must match the table. Print the `scene_hash` and the licence `line` in the first, middle and last frame, quote only numbers that are in `rows`, do not loop, and keep the "stages are not a cohort" note. `purpose` is "analytical" (default) or "promotional": a promotional use of a source whose licence forbids advertising is refused (licence_refused). `vintage` (ISO date) omitted = the current data; an earlier vintage is not stored and returns unknown_vintage. Example: get_scene(scene_id="ireland-builds").

輸入參數countrypurposevintagescene_id

版本歷史

2
  1. v0.3.2最新Oct 10, 2026
  2. v0.3.1Oct 9, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分