Thailand NSO MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Thailand NSO MCP ServerFind aging index data for Thailand"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Thailand NSO MCP Server
An MCP server that lets an LLM discover, query and
analyse Thailand's official statistics from the National Statistical Office (NSO,
agency TNSO) via the SDMX REST API — in natural language.
When connected to your chat tool (e.g. Gemini or Claude) it can generate analysis like the below:
This implementation based on a port of ondata/istat_mcp_server
(Italy / ISTAT), adjusted to point to the Thaliand NSO SDMX endpoint at
https://ns1-stathub.nso.go.th/rest.
It uses an 8-tool workflow (like the ISTAT MCP), same two-layer caching; the data source, agency, languages (Thai/English) and geography (Thai provinces) are swapped in.
Note we use Buddhist Era dates. TNSO publishes time periods in the Buddhist Era calendar (BE = Gregorian + 543). So
2567means 2024. Passstart_period/end_periodas BE years.
Tools
Tool | What it does |
| Search ~900 TNSO dataflows by keyword (Thai/English). |
| Dimensions + codelists for a data structure (DSD). |
| Valid values (with labels) per dimension + available time range. Start here. |
| Thai/English labels for every code in a codelist. |
| Resolve an SDMX concept id to its Thai/English name. |
| Fetch observations as a TSV table (+ reproducible CSV/curl URLs). |
| Thai geography codes: region ( |
| Inspect the on-disk cache. |
Typical workflow: discover_dataflows → get_constraints → get_data
(use get_territorial_codes first when you need province/region codes).
Related MCP server: Ukrainian Statistics MCP Server
Install & run
Requires Python ≥ 3.11. Using uv (recommended):
git clone https://github.com/aard-ai/tnso-mcp-server.git
cd tnso-mcp-server
uv venv
uv pip install -e ".[dev]"
# Run the server (stdio transport)
uv run python -m tnso_mcp_serverOr with pip:
cd tnso-mcp-server
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
python -m tnso_mcp_serverRegister with an MCP client
Claude Code:
claude mcp add tnso -- uv --directory /abs/path/to/tnso-mcp-server run python -m tnso_mcp_serverClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"tnso": {
"command": "uv",
"args": ["--directory", "/abs/path/to/tnso-mcp-server", "run", "python", "-m", "tnso_mcp_server"]
}
}
}Configuration
Copy .env.example to .env to override defaults (API base URL, timeouts, cache TTLs,
log level, dataflow blacklist). All values have sensible defaults, so .env is optional.
Example
discover_dataflows(keywords="aging")
-> DF_01DI_IND_AGING — "Aging Index dataflow"
get_constraints(dataflow_id="DF_01DI_IND_AGING")
-> dimensions POP_IND, SEX, AREA, CWT, ...; TIME_PERIOD range 2557–2567 (BE)
get_territorial_codes(level="province", name="bangkok")
-> { code: "10", name_en: "Krung Thep Maha Nakhon (Bangkok)", name_th: "กรุงเทพมหานคร" }
get_data(dataflow_id="DF_01DI_IND_AGING", dimension_filters={"CWT": ["10"]}, start_period="2560", end_period="2567")
-> TSV table of the aging index for Bangkok, 2017–2024Tests
uv run pytest -m "not integration" # fast unit tests (no network)
uv run pytest -m integration # live tests against the real TNSO API
uv run pytest # everythingMIT (same as the upstream istat_mcp_server).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aard-ai/tnso-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server