Skip to main content

MCP for official statistics

A Model Context Protocol (MCP) server over official statistics exposes a fixed set of tools to MCP clients: search of the catalog, the metadata of a record, and the values of a series with their unit, period, status, release, and source. The office maintains the server, and each client, from a desktop assistant to a custom agent, calls the same tools.

Use cases for a statistical office​

Use caseWhat the server doesWhat the office gains
Answers from official figuresA chatbot calls the data tool and quotes the returned value with its period and sourceIts figures reach users through AI systems, with provenance
Catalog discoveryAn agent searches by meaning and reads the metadata before choosing a seriesFewer wrong series chosen by users and by models
Verified numbersEach value carries a claim identifier that a renderer can check with Proof-Carrying NumbersNumbers in generated text that match the record or are flagged
Internal assistantsStaff assistants call the same tools over internal series under access controlOne interface for public and internal use, with the tier rule enforced at the server
Monitoring of useThe server logs tool calls by clientEvidence of which series AI systems use, and which questions they fail on

What the tools return​

A server over a catalog needs few tools. The cookbook on serving statistics to agents designs them in full; the shape is:

  • search_series(query, limit): identifier, name, unit, periodicity, and coverage for each match.
  • get_metadata(series): the record in the organization's schema, with definition, method, breaks, and caveats.
  • get_values(series, ref_area, period): observations with TIME_PERIOD, OBS_VALUE, OBS_STATUS, the unit, the release date, the source URL, and a claim identifier per observation.

The fields follow the SDMX cross-domain concepts so that a client built for one office works for another.

Servers in operation and reference code​

  • The Data360 MCP server runs over the World Bank Data360 platform with a public endpoint and six tools: indicator search with country-coverage checks, data, metadata, disaggregation, codelist lookup, and indicator listing. Chart rendering is an optional external service. Its client setup guide covers three MCP clients.
  • The Data AI Chatbot is a self-hostable application over any MCP server, with PCN marks on the numbers in its answers.
  • The dissemination cookbook ships a minimal server over two CSV files, and the end-to-end reference implementation runs a server over a published catalog and verifies an answer against it.
  • NADA AI serves a NADA catalog over MCP with semantic search. It is being integrated into NADA, and its release is tied to the NADA release; the released NADA software has a REST API.

Design in full​

The Practical Guide to Serving Official Statistics to AI Agents covers the purpose and scope of agent access, the design of the tools, context beyond the tools, provenance in every response, access control, quotas, and terms, safety of the interface, evaluation, distribution to clients and developers, and operation. The MCP architecture page gives the protocol background.

Limitations​

  • An MCP server exposes what the catalog and the API already hold. Incomplete records and unstable identifiers pass through to every client.
  • Access control, quotas, and terms are the office's to add; the protocol carries authorization but does not decide it.
  • A server answers tool calls. Whether a client's answer is right depends on the client's model and prompt, which the evaluation chapter of the agents cookbook measures.