Stats Nz logo

Stats Nz

Search Stats NZ datasets and retrieve labelled observations, dimensions, code lists, and regional census smoking data over MCP.

Install Stats Nz

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "stats-nz": {
      "command": "npx",
      "args": [
        "-y",
        "@pipeworx/mcp-stats-nz"
      ],
      "env": {
        "PLATFORM_STATSNZ_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 5 tools correctly (10d ago).

Overview

Stats Nz connects MCP clients to Stats NZ’s Aotearoa Data Explorer for searching its dataset catalogue and retrieving official statistical observations. It exposes catalogue search, observation, resource-metadata, and regional census smoking tools, with dataset discovery available without an API key. Keyed requests use Stats NZ’s SDMX endpoints and can accept a caller-supplied API key, while the gateway can provide its platform subscription key. Reach for it when an agent needs New Zealand census, earnings, business, population, household expenditure, corrections, or justice statistics rather than general economic indicators such as CPI or trade.

Use cases

  • Search New Zealand official datasets by topic
  • Retrieve census observations for selected dimensions
  • Decode SDMX dimension keys and code lists
  • Compare census smoking status across regional councils

Key features

  • Keyless search across 911 Stats NZ datasets
  • SDMX observation retrieval with dimension labels
  • Dataset structure and code-list inspection
  • Automatic narrowing of oversized unfiltered queries
  • Regional census smoking statistics for 2006–2023

Tools5

What Stats Nz lets your agent do. Expand a tool for its parameters.

Verified live~2.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

9/9 checks healthy over the last 44d

What it can do

From the 5 tools this server returned when we ran it; 5 declare their own safety hints.

Handles credentials · 2Makes network requests · 5Read-only tools · 5
Network at startup4 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age37 days
Maintainers1

Observed 2026-11-02 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · @pipeworx/mcp-stats-nz (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads1.2kPackage downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Stats Nz works

What Stats Nz does

Stats Nz provides MCP access to New Zealand’s official statistics through the Aotearoa Data Explorer API. Its catalogue search covers 911 published dataflows and returns identifiers, titles, descriptions where available, agencies, and versions. Agents can then use a dataset identifier to retrieve observations, inspect dimensions and code lists, or query a dedicated census smoking-by-region view.

The available datasets include the 2013, 2018, and 2023 censuses, LEED earnings, business demography, population estimates and projections, household expenditure, corrections, and justice. The integration is independent and unofficial; it is not published or endorsed by Stats NZ.

How it works

The hosted MCP endpoint is available at https://gateway.pipeworx.io/stats-nz/mcp. Add that URL to an MCP client and call the exposed tools. The catalogue is fetched from Stats NZ’s keyless dataflow endpoint. Observation and structure requests use the live api.data.stats.govt.nz host and require the platform subscription key or a caller-provided _apiKey.

Stats NZ returns SDMX data. Stats Nz translates the response into period/value records with dimension labels and can expose the structure needed to interpret compact keys such as 1.2.Q. It also handles the catalogue’s SDMX-ML response format and the flat observation layout used by the upstream API.

For an unfiltered request that is too broad, the integration may select total geography or other total-coded dimensions and return a narrowed explanation. A caller-supplied key is not changed. Dataset identifiers are checked against the catalogue before observation requests, helping distinguish an unknown dataset from an empty result.

Setup and configuration

Configure the MCP URL in a compatible client, for example:

config.json
{
  "mcpServers": {
    "stats-nz": {
      "url": "https://gateway.pipeworx.io/stats-nz/mcp"
    }
  }
}

The gateway uses PLATFORM_STATSNZ_KEY for its Stats NZ subscription credential. Callers do not need their own key when the platform credential is available. A Stats NZ API subscription can also be obtained through the Aotearoa Data Explorer API product, and individual tool calls support a _apiKey override.

Tools and capabilities

  • statsnz_datasets: Search the full catalogue by keyword with limit and offset. This tool is keyless.
  • statsnz_observations: Retrieve observations for a dataset, optionally constrained by agency, version, dimension key, period range, or the last N observations.
  • statsnz_resources: Return dimension order, time-dimension information, measures, and code lists. Code-list expansion can be controlled with includeCodes and maxCodesPerList.
  • statsnz_smoking_by_region: Return census smoking-status counts and percentages by regional council for 2006, 2013, 2018, and 2023.

Observation responses may report collapsed dimensions when lastNObservations removes one axis from the returned keys. Period filters apply when the dataset declares the standard TIME_PERIOD dimension; other year-like dimensions may need to be selected through the dataset key.

Limitations and notes

The smoking tool covers census self-reports and should not be treated as the Ministry of Health New Zealand Health Survey. The catalogue does not provide CPI, GDP, or merchandise-trade data. Dataset descriptions are available for only part of the catalogue, so searches often depend on formal dataset titles.

A broad query can be automatically narrowed to stay within the response-size limit. The response identifies the requested key and the dimensions that were pinned. Queries with an explicit key are not narrowed and may fail if they are too large. A zero-result response includes an explanation such as an empty period range, an unmatched dimension key, or an upstream gap.

Use the current Stats NZ host through the MCP endpoint. The older api.stats.govt.nz host is not the service endpoint used by this integration, and SDMX flow-reference commas must remain literal when constructing upstream paths.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Stats Nz

Stats Nz is an MCP server that connects AI clients to Stats NZ’s Aotearoa Data Explorer. Its main tools search the dataset catalogue, retrieve SDMX observations, expose dimensions and code lists, and return census smoking statistics by regional council. Catalogue searches are keyless; observation and structure requests use a platform or caller-supplied API key.

Add `https://gateway.pipeworx.io/stats-nz/mcp` as an MCP server URL in your client configuration. The hosted endpoint supplies the Stats Nz tools and uses the platform Stats NZ subscription key. A caller can provide `_apiKey` for keyed requests when using a separate subscription.

Yes, Stats Nz works with Cursor through its hosted MCP URL. Add the endpoint as an MCP server using Cursor’s configuration, then use the catalogue, observation, resource, and smoking tools exposed by the gateway.

No, Stats Nz is not suitable for CPI, GDP, or merchandise-trade queries. Its catalogue focuses on sources such as census tables, LEED earnings, business demography, population estimates and projections, household expenditure, corrections, and justice.

Stats Nz narrows an unfiltered query when the expected SDMX response is too large to return safely. It selects applicable total-coded dimensions, returns the resulting slice, and includes a `narrowed` object explaining the pins and how to request a more specific breakdown.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewStats Nz AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/stats-nz?style=directory)](https://allmcps.com/mcp/stats-nz)
HTML Embed
<a href="https://allmcps.com/mcp/stats-nz"><img src="https://allmcps.com/api/badge/stats-nz?style=directory" alt="Stats Nz on AllMCPs" /></a>