Skip to main content
Glama
un-shayani

ESCAP Data Explorer MCP Server

by un-shayani

ESCAP Data Explorer MCP Server

An MCP (Model Context Protocol) server that provides official statistical data for development indicators in Asia-Pacific. It wraps the ESCAP Data Explorer API, letting any MCP-compatible host query SDG and thematic data through natural language.

MCP SDMX License: MIT Node.js Docker

Live endpoint: https://dataexplorer.unescap.org/mcp/message


What is this?

The ESCAP Data Explorer is the official statistical platform of the United Nations Economic and Social Commission for Asia and the Pacific (ESCAP). It publishes hundreds of SDG and thematic indicators covering poverty, gender, environment, health, trade, and more — across 58 Asia-Pacific countries and territories.

This MCP server wraps the ESCAP Data Explorer's SDMX v2.1 REST API and exposes it as five structured tools that an AI agent can call in sequence to discover, validate, and retrieve statistical data — all through natural language.


Related MCP server: MoSPI MCP Server

Example use cases

  • "What is the poverty headcount ratio in Thailand between 2010 and 2022?"

  • "Show me SDG 5 gender equality indicators available for South Asia."

  • "Compare CO₂ emissions per capita across ASEAN countries from 2000 to 2020."

  • "Which Asia-Pacific countries have data on maternal mortality after 2015?"

  • "Summarize progress on SDG 1 (No Poverty) for least developed countries."


Tools

The server exposes five tools that follow a guided workflow:

Step

Tool

Description

1

get_indicators

Browse the full SDG & Thematic indicator hierarchy. Returns indicator codes and descriptions.

2

get_indicator_metadata

Fetch structural metadata (dimensions, attributes) for a chosen indicator in XML.

3

get_countries

List all 58 reference areas with their codes and full names.

4

check_data_availability

Confirm data exists for a given indicator, country, and year range before fetching.

5

get_data

Retrieve observation data in SDMX format for a given indicator, country, and period.


Quickstart — use the public endpoint

The server is already deployed and publicly accessible. No installation needed.

Claude Desktop

Install mcp-remote if you haven't already:

npm install -g mcp-remote

Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "escap-data-explorer": {
      "command": "mcp-remote",
      "args": ["https://dataexplorer.unescap.org/mcp/message"]
    }
  }
}

Restart Claude Desktop. The five ESCAP tools will appear automatically.

Other MCP clients (native Streamable HTTP)

{
  "mcpServers": {
    "escap-data-explorer": {
      "url": "https://dataexplorer.unescap.org/mcp/message"
    }
  }
}

Self-hosting

Requirements

  • Node.js 18 or later

  • npm 8 or later

  • Docker + Docker Compose (for server deployment)

1. Clone the repository

git clone https://github.com/your-org/escap-mcp.git
cd escap-mcp

2. Install and build

npm install
npm run build

3. Run locally (stdio mode — for development)

node dist/index.js

Test with Claude Desktop by pointing to the local binary:

{
  "mcpServers": {
    "escap-data-explorer": {
      "command": "node",
      "args": ["/absolute/path/to/escap-mcp/dist/index.js"]
    }
  }
}

4. Deploy with Docker

Build the image:

docker build -t escap-mcp:latest .
docker compose up -d

Verify the server is running:

curl http://localhost:9000/health
# {"status":"ok","transport":"streamable-http","messagePath":"/message"}

Configuration

All configuration is via environment variables:

Variable

Default

Description

MCP_TRANSPORT

stdio

Transport mode: stdio for local dev, http for Docker/server

PORT

9000

HTTP port when MCP_TRANSPORT=http

PATH_PREFIX

""

Path prefix if your reverse proxy passes it through unchanged


Reverse proxy (Apache)

If deploying behind Apache, replace your /mcp/ location block with the following. The key directive is flushpackets=on, which prevents Apache from buffering the streaming HTTP response:

<Location /mcp/>
    ProxyPass http://localhost:9000/ flushpackets=on flushwait=1
    ProxyPassReverse http://localhost:9000/

    ProxyPreserveHost On
    RequestHeader set X-Forwarded-Proto "https"

    SetEnv no-gzip 1
    SetEnv dont-vary 1
</Location>

Required modules: mod_proxy, mod_proxy_http, mod_headers.

sudo a2enmod proxy proxy_http headers
sudo systemctl reload httpd

API reference

This server connects to the ESCAP Data Explorer SDMX v2.1 REST API. The underlying endpoints used are:

Purpose

Endpoint

Indicator hierarchy

https://dataexplorer.unescap.org/search/api/search?tenant=demo

Indicator metadata

https://api-dataexplorer.unescap.org/rest/v2/data/dataflow/ESCAP/{type}_Dataflow/2.10/

Country codelist

https://api-dataexplorer.unescap.org/rest/codelist/escap/cl_ref_area

Data availability

https://api-dataexplorer.unescap.org/rest/availableconstraint/ESCAP,{type}_Dataflow,2.10/

Data retrieval

https://api-dataexplorer.unescap.org/rest/data/ESCAP,{type}_Dataflow,2.10/

Dataset types are either SDG (Sustainable Development Goals) or Theme (thematic indicators).


Transport

The server implements the Streamable HTTP MCP transport (the current standard as of MCP SDK 1.x). Legacy SSE transport is not supported.

  • Endpoint: POST /message — all client-to-server communication

  • Session management: via Mcp-Session-Id request/response header

  • Server push: GET /message with Mcp-Session-Id header


Project structure

escap-mcp/
├── src/
│   └── index.ts          # All server logic (single file)
├── dist/                 # Compiled output (after npm run build)
├── Dockerfile            # Two-stage Alpine build
├── docker-compose.yml    # Production deployment
├── apache-mcp.conf       # Apache reverse proxy config snippet
├── tsconfig.json
└── package.json

GitHub topic tags

Add these topics to your GitHub repository (Settings → Topics):

mcp mcp-server model-context-protocol asia-pacific statistics open-data sdmx unescap sustainable-development-goals sdg


Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.


License

MIT — see LICENSE for details.


About ESCAP

The United Nations Economic and Social Commission for Asia and the Pacific (ESCAP) is the regional development arm of the United Nations for the Asia-Pacific region. The ESCAP Data Explorer provides free, open access to official statistics from member states across economic, social, and environmental dimensions.

Available Tools

4 tools
get_countriesA

Step 3: Retrieve the full list of countries and reference areas available in UNESCAP Data Explorer, including their codes (id) and names. Use these codes when checking availability or fetching data.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It discloses the read-only nature and output, but does not elaborate on performance, caching, or authentication. Minimal but adequate for a simple list retrieval.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no superfluous content. 'Step 3' is not wasteful; it provides sequencing context. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description fully covers what the tool does and why to use it: retrieve codes for use with other tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the baseline is 4. The description adds no parameter info, which is appropriate since none are needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the full list of countries and reference areas with codes and names, which distinguishes it from sibling tools like get_indicators and get_data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises using the codes when checking availability or fetching data, implying this tool is a prerequisite. It does not mention explicit when-not cases, but the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_dataA

Step 5: Retrieve actual data for a given indicator, optional country, and time period. Returns SDMX data (JSON or XML) including observation values, time periods, and attributes. It is recommended to call check_data_availability first to confirm data exists.

ParametersJSON Schema
NameRequiredDescriptionDefault
endYearYesEnd year
countryIdNoCountry/ref_area code (optional — omit for all countries)
startYearYesStart year
datasetTypeYesDataset type: "SDG" or "Thematic"
indicatorCodeYesIndicator code

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description transparently describes the return format (SDMX JSON/XML including observation values, time periods, attributes). It does not discuss rate limits or destructive effects, but the read-only nature is implied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no redundant words, front-loaded with key action and parameters. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description sufficiently explains what is returned. It also provides a usage recommendation to avoid errors, making it complete for a data retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents parameters. The description adds value by clarifying that countryId is optional and can be omitted for all countries, and by referring to time period as startYear/endYear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Retrieve actual data' with specific parameters (indicator, country, time period), distinguishing it from sibling tools like get_indicators and get_countries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description recommends calling check_data_availability first, providing sequential guidance. However, it does not explicitly state when not to use this tool or mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_indicator_metadataA

Step 2: Retrieve metadata (dimensions, attributes, structure) for a specific indicator. Call this after choosing an indicator from get_indicators.

ParametersJSON Schema
NameRequiredDescriptionDefault
datasetTypeYesDataset type: "SDG" or "Thematic"
indicatorCodeYesIndicator code (last segment after # in val field)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It describes a read operation ('retrieve metadata') but does not disclose whether it is read-only, has side effects, or requires special permissions. Implies safety but lacks explicit behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted words. First sentence defines purpose and scope, second sentence provides usage guidance in a workflow context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but the description enumerates the kind of metadata (dimensions, attributes, structure). Could mention the return format (e.g., a JSON object) for completeness, but not essential.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, each parameter has a description in the schema. The tool description mentions the parameters implicitly by referencing 'specific indicator' but does not add extra meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve' and the resource 'metadata (dimensions, attributes, structure) for a specific indicator'. It distinguishes itself from siblings like get_indicators (lists indicators) and get_data (retrieves data) by positioning as Step 2 in a workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to use after get_indicators, providing clear ordering. Does not include negative guidance or alternatives, but the workflow context is sufficient for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_indicatorsA

Step 1: Retrieve the full hierarchy of available SDG and Thematic indicators from UNESCAP Data Explorer. Browse the results and choose ONE indicator. The indicator code is the segment after the last # in the 'val' field. Only use indicator codes returned by this tool — do not invent or source codes from elsewhere.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully explains behavior: retrieves full hierarchy, specifies output format (indicator code after last # in 'val'), and indicates it is a read operation. No annotations to contradict.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise, front-loaded with purpose, and provides structured instructions. Every sentence serves a purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description fully explains output structure and usage. It also provides a critical constraint (do not invent codes), making it complete for the tool's context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no parameters, so baseline is 4. The description adds value by explaining how to use the output (extracting indicator code), though no parameter details are needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the full hierarchy of SDG and Thematic indicators from UNESCAP Data Explorer, using specific verbs and resource. It distinguishes itself by instructing to browse and select one indicator, unlike sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit step-by-step instructions are provided: use to browse, choose one indicator, extract code from 'val' field. It also warns not to invent codes, providing clear when-to-use and when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedget_countries
    • First observedget_data
    • First observedget_indicator_metadata
    • First observedget_indicators

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: listing indicators, getting metadata, listing countries, and fetching data. No overlap or ambiguity.

Naming Consistency5/5

All tools follow a consistent 'get_' prefix with a resource name, using underscores for multi-word names.

Tool Count5/5

4 tools cover the essential operations for a data explorer: browsing metadata and fetching data. The count is well-scoped.

Completeness4/5

Covers the main workflow but missing a 'check_data_availability' tool that is referenced in the get_data description, creating a minor gap.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers