The AI connector (MCP)

undata-mcp is a Model Context Protocol server: it lets an AI assistant such as Claude search UN indicators, fetch data and run the analyses itself. Every tool only reads, and needs no account or key. Answers carry a table, a summary sentence, the data-quality notes and the sources; analysis tools can attach their chart as an image.

Setting it up

Install uv, which fetches Python and the package on first use.

Claude Desktop. Settings → Developer → Edit Config, then add, and restart:

{
  "mcpServers": {
    "undata": {"command": "uvx", "args": ["--from", "undata[mcp]", "undata-mcp"]}
  }
}

Claude Code.

claude mcp add undata -- uvx --from "undata[mcp]" undata-mcp

Other clients. pip install "undata[mcp]", then run undata-mcp (stdio), or undata-mcp --http to serve Streamable HTTP at http://127.0.0.1:8000/mcp (--host, --port). Responses are cached on disk; --no-cache turns that off.

Things to ask

  • “Which least developed countries are on track to bring maternal mortality below 70 by 2030? Show me a chart.”

  • “Give me a one-page profile of Chad against Middle Africa and the world.”

  • “How wide is the rural-urban gap in primary school completion in the Sahel?”

  • “Which countries in Western Africa have reported electricity access in the last five years?”

Tools

Generated from the server, so it lists exactly what the installed version offers.

Search UN indicators

undata_search_indicators

Find indicators by what they measure.

Returns one row per indicator: its id (pass it to the other tools), name, source, how many places and years have data, and its SDG number if it has one. Start here when you do not know an indicator’s id.

Argument

Type

Meaning

query

text

Required. Plain words, e.g. “maternal mortality”.

limit

whole number

Most indicators to return. Default: 10.

all_sources

true/false

Include copies of the same series held under other sources. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Describe an indicator

undata_describe_indicator

What an indicator measures, whose it is, its unit, its years, and its breakdowns.

Breakdowns (by sex, age, urbanization, wealth…) are what undata_get_data’s breakdown and undata_group_gap’s breakdown accept.

Argument

Type

Meaning

indicator

text

Required. An indicator id from undata_search_indicators, or an SDG number such as “3.1.1”.

Browse the SDG framework

undata_browse_sdg

Walk the SDG framework from goals down to series you can fetch.

Argument

Type

Meaning

code

text (optional)

Empty for the 17 goals; a goal (“5”) for its targets; a target (“5.5”) for its indicators; an indicator (“5.5.1”) for the series that report it. Default: None.

List countries, regions and groups

undata_list_places

Countries in a UN M49 region or UN group, or the list of regions and groups.

Names are the UN’s official names. LDCs, LLDCs and SIDS are the UN’s current lists.

Argument

Type

Meaning

region

text (optional)

A region or group (“Western Africa”, “LDCs”); empty to list every region and group. Default: None.

Get data by year

undata_get_data

Values by country and year, with unit and source on every row.

Argument

Type

Meaning

indicators

list of text

Required. One or more indicator ids or SDG numbers.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

start_year

whole number (optional)

First year. Default: None.

end_year

whole number (optional)

Last year. Default: None.

breakdown

text (optional)

A breakdown such as “sex” or “age” (see undata_describe_indicator). Default: None.

limit

whole number

Rows per page. Default: 200.

offset

whole number

Rows to skip, for the next page. Default: 0.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Latest value per country

undata_latest_values

Each country’s most recent value, with the year it is from.

Countries’ latest years differ; the notes say so. within_years drops values older than that and names the countries left out.

Argument

Type

Meaning

indicators

list of text

Required. One or more indicator ids or SDG numbers.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

within_years

whole number (optional)

Only values from the past N years; older ones are named. Default: None.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Official totals for regions and groups

undata_group_totals

The figure the agency published for a region, a UN group or the world.

These are official aggregates, not averages of countries.

Argument

Type

Meaning

indicators

list of text

Required. One or more indicator ids or SDG numbers.

places

list of text

Required. Regions or groups, e.g. [“World”, “LDCs”, “Sub-Saharan Africa”].

latest_only

true/false

Only each place’s latest value. Default: True.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Change between two years

undata_change_over_time

Each country’s value in two years, the difference and the percentage change.

Argument

Type

Meaning

indicator

text

Required. An indicator id from undata_search_indicators, or an SDG number such as “3.1.1”.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

start_year

whole number

Required.

end_year

whole number

Required.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Compare indicators side by side

undata_compare_indicators

Latest values of several indicators side by side, with who has which spelled out.

With exactly two indicators, the chart is a scatter of one against the other.

Argument

Type

Meaning

indicators

list of text

Required. Two or more indicators.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

within_years

whole number (optional)

Only values from the past N years; older ones are named. Default: None.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Assess SDG progress

undata_assess_progress

Is each country on track? The UN Statistics Division’s progress method.

Each country’s growth rate since the baseline is projected to the target year. With a target, the projected change is compared with the change the target needs; without, the growth rate is scored. Each country gets one of the SDG Report’s categories, from “On track or target met” to “Regression”, and a 0-5 score.

Argument

Type

Meaning

indicator

text

Required. An indicator id from undata_search_indicators, or an SDG number such as “3.1.1”.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

better

“higher” | “lower”

Required. “lower” when a fall is progress (mortality, poverty); “higher” otherwise.

target

number (optional)

The value to reach by target_year, e.g. 70 for SDG 3.1.1. Default: None.

baseline_year

whole number

Default: 2015.

target_year

whole number

Default: 2030.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Country profile

undata_country_profile

One country’s latest values beside its UN M49 region and the world, with its rank.

Argument

Type

Meaning

country

text

Required. One country, e.g. “Chad”.

indicators

list of text

Required. One or more indicator ids or SDG numbers.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Gap between two groups

undata_group_gap

Two groups compared in the latest year that has both: the values, ratio and difference.

For example women and men, rural and urban, or the poorest and richest fifth.

Argument

Type

Meaning

indicator

text

Required. An indicator id from undata_search_indicators, or an SDG number such as “3.1.1”.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

breakdown

text

“sex”, “urbanization”, “wealth quantile”, or another breakdown it has. Default: 'sex'.

groups

list of text (optional)

The two groups, e.g. [“Rural”, “Urban”]; default depends on the breakdown. Default: None.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

UN groups side by side

undata_benchmark_groups

Published totals for regions and UN groups, at the baseline year and the latest.

Argument

Type

Meaning

indicator

text

Required. An indicator id from undata_search_indicators, or an SDG number such as “3.1.1”.

places

list of text

Regions or groups to compare. Default: ['World', 'LDCs', 'LLDCs', 'SIDS'].

baseline_year

whole number

Default: 2015.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.

Who reports what

undata_check_availability

The year of each country’s latest value for each indicator; blank means no data.

Run this before comparing countries, to see whether their data is comparable in time.

Argument

Type

Meaning

indicators

list of text

Required. One or more indicator ids or SDG numbers.

places

list of text

Required. Countries, regions or groups, e.g. [“Chad”, “Niger”], [“Southern Asia”], [“LDCs”].

within_years

whole number (optional)

Only values from the past N years; older ones are named. Default: None.

include_chart

true/false

Also return a publication-ready chart of the result, as an image. Default: False.

response_format

“markdown” | “json”

“markdown” to read, “json” for exact values to compute with. Default: 'markdown'.