{
  "markdown": "# @altronis/sgdata-mcp\n\n> A Singapore government data MCP server. **87 tools — 24 curated datasets + 7 SingStat tables + 6 live real-time feeds, CLI mode, data visualization, cross-dataset queries, natural language queries.**\n> Covering ACRA + HDB + URA + COE + CPI + GDP + employment + IRAS + MAS FX + MOE + ECDA + tourism + retail + population + crime + health + energy + hawkers + air quality + weather + carparks + live dengue.\n> No API keys. Runs anywhere MCP runs. Full write-up: https://altronis.sg/blog/sgdata-mcp\n\n[![npm version](https://img.shields.io/npm/v/@altronis/sgdata-mcp.svg)](https://www.npmjs.com/package/@altronis/sgdata-mcp)\n[![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)\n[![node](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)\n[![MCP](https://img.shields.io/badge/MCP-2024--11--05-blue.svg)](https://modelcontextprotocol.io)\n\n`@altronis/sgdata-mcp` is an [MCP](https://modelcontextprotocol.io) server that\nlets Claude, Cursor, Continue, or any other MCP-compatible client query\nSingapore government open data directly from data.gov.sg — corporate registry,\nreal estate, labour, prices, public services, capital flows, crime, health,\ndemographics, energy, and more.\n\nIt runs as a local stdio process on your machine. No hosted backend, no API\nkeys. Small curated datasets cache locally at `~/.sgdata-mcp/sgdata.sqlite`;\nlarge datasets (ACRA, HDB resale) and real-time feeds query data.gov.sg\nserver-side so they never download a whole dataset onto your disk.\n\n**v0.5.0:** 13 new tools + a smaller footprint. **Real-time feeds** — `sg_psi`\n(air quality), `sg_weather_forecast`, `sg_air_temperature`, `sg_rainfall`,\n`sg_carpark_availability`, and `sg_dengue_clusters` (live NEA clusters — current\ndengue, vs the frozen weekly-bulletin feed). **SingStat tables** —\n`sg_household_income`, `sg_wages`, `sg_deaths`, `sg_marriages`, `sg_divorces`,\n`sg_trade`, `sg_labour_force`. **`sg_search_datasets` now actually searches**\n(data.gov.sg's `q` param is a no-op upstream, so it filters a cached catalog\nlocally). **ACRA + HDB-resale tools query server-side** (`datastore_search`)\ninstead of ingesting the full 56 MB / 23 MB datasets — no more multi-GB local\ncache. FX tools fixed (upstream metadata endpoint 404s; they now read live data\nvia `datastore_search`).\n\n> ⚠️ **`sg_acra_formations_by_ssic` is a heavy tool.** ACRA's SSIC+year filter\n> can't be pushed server-side, so it crawls 27 shards with rate-limit backoff —\n> expect ~1–3 minutes, and for older years the count is a lower bound\n> (`bounded: true`). For fast formation **counts** by SSIC use the SingStat\n> `sg_formations_history` / `sg_formations_compare` / `sg_formations_monthly`\n> tools instead.\n\n**v0.4.1:** `sg_dataset_query` no longer hangs on very large datasets\n(size-gated server-side paging via `datastore_search` + a 60s ingest guard);\n`sg_fx_rate` / `sg_fx_history` now accept ISO currency codes (`USD`, `GBP`,\n`JPY`, `EUR`, …); `sg_tourism_latest` now emits `data_freshness` (its upstream\nstops at 2014); and the `_history` tools return an `available` label list on a\nno-match so callers can self-correct.\n\n**v0.4.0 highlights:** `data_freshness` metadata block emitted on every\n`_latest` tool — `last_period`, `last_record_date`, `age_days`, and a\ncategorical `level` of `fresh` / `ok` / `stale` / `frozen` so agents can\ndetect when an upstream data.gov.sg feed has gone silent. Fixes silent\nstale-data on `sg_disease_latest` (MOH stopped publishing the Weekly\nInfectious Disease Bulletin via data.gov.sg around epi week 2022-W52).\n\n**v0.3.2:** Monthly business formations + cessations + net growth tools via\nSingStat Table Builder. Track month-by-month company creation vs closure\nfor any SSIC industry. 74 tools total.\n\n**v0.3.1:** Annual formation counts by industry via SingStat Table Builder.\n\n**v0.3.0:** 8 new datasets, CLI mode, ASCII sparkline visualization,\ncross-dataset correlation queries, natural language query routing.\n\n## Data freshness\n\n`@altronis/sgdata-mcp` is only as fresh as data.gov.sg. Some datasets are\nupdated weekly (COE bidding, CPI), some monthly (unemployment, CPI sub-items),\nsome quarterly (URA private property), and some have effectively stopped\nupdating. Starting in v0.4.0 every `_latest` tool returns a `data_freshness`\nblock so you can detect drift programmatically:\n\n```json\n{\n  \"datasetId\": \"d_ca168b2cb763640d72c4600a68f9909e\",\n  \"epi_week\": \"2022-W52\",\n  \"cases\": [...],\n  \"data_freshness\": {\n    \"last_period\": \"2022-W52\",\n    \"last_record_date\": \"2023-01-01\",\n    \"age_days\": 1234,\n    \"level\": \"frozen\",\n    \"warning\": \"Upstream dataset appears frozen — latest record is 2022-W52...\"\n  }\n}\n```\n\n**Known frozen datasets (as of v0.4.1):**\n\n| Tool | Upstream dataset | Last update | Recommended action |\n|---|---|---|---|\n| `sg_disease_latest`, `sg_disease_trend`, `sg_disease_list` | MOH Weekly Infectious Disease Bulletin | 2022-W52 | Cross-check `moh.gov.sg` weekly bulletin PDFs. PRs welcome to swap in a live source. |\n| `sg_tourism_latest`, `sg_tourism_history` | STB Annual Tourism Receipts | 2014 | Cross-check `stb.gov.sg` / SingStat for newer receipts. PRs welcome. |\n\nIf you find another upstream feed has gone silent, please open an issue —\nwe'll add it to this table and surface the warning in the tool description.\n\n---\n\n## What you can ask Claude\n\nDrop this server into Claude Desktop and you immediately unlock questions like:\n\n- *\"Find all AI/ML companies (SSIC 62019) incorporated in Singapore in 2025.\"*\n- *\"What's the median resale price of 4-room HDB flats in Punggol over the last 6 months?\"*\n- *\"What is the latest COE Category A premium, and how has it trended over 12 months?\"*\n- *\"How many dengue cases were reported this week?\"*\n- *\"What's Singapore's unemployment rate? Show me the trend.\"*\n- *\"Compare GDP growth vs crime rates over the last 5 years.\"*\n- *\"How many scam cases were recorded in 2024?\"*\n- *\"What is Singapore's population and how fast is it growing?\"*\n- *\"How much electricity did Singapore generate last month?\"*\n- *\"Are birth rates declining? Show me the last 12 months.\"*\n- *\"What were Singapore's tourism receipts by component?\"*\n- *\"Find hawker centres near Tampines.\"*\n- *\"Which CPI categories are running hottest vs headline inflation?\"*\n- *\"Look up DBS Bank by UEN 196800306E.\"*\n\nYour model picks the right tool, fills in the filters, and returns structured\nrows. You never write a URL.\n\n---\n\n## Quick start\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json`\n(macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"sg-data\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@altronis/sgdata-mcp\"]\n    }\n  }\n}\n```\n\nRestart Claude Desktop. The 74 `sg_*` tools appear in the MCP tools menu.\n\n### Cursor\n\nAdd to `~/.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"sg-data\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@altronis/sgdata-mcp\"]\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add sg-data -- npx -y @altronis/sgdata-mcp\n```\n\n### CLI mode (new in v0.3.0)\n\nQuery Singapore data directly from the terminal — no MCP client needed:\n\n```bash\n# Natural language query\nnpx @altronis/sgdata-mcp query \"What is Singapore's unemployment rate?\"\nnpx @altronis/sgdata-mcp query \"How many dengue cases this week?\"\nnpx @altronis/sgdata-mcp query \"Latest COE prices\"\n\n# Call a specific tool\nnpx @altronis/sgdata-mcp tool sg_crime_compare '{\"year\":\"2024\"}'\nnpx @altronis/sgdata-mcp tool sg_hawker_search '{\"query\":\"bedok\"}'\n\n# List available tools and datasets\nnpx @altronis/sgdata-mcp list\nnpx @altronis/sgdata-mcp datasets\n```\n\n### Standalone (kick the tyres)\n\n```bash\n# Run the MCP server directly\nnpx -y @altronis/sgdata-mcp\n\n# Smoke-test via stdio\nprintf '%s\\n' \\\n  '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"0\"}}}' \\\n  '{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}' \\\n  '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\"}' \\\n  | npx -y @altronis/sgdata-mcp\n```\n\n---\n\n## What's in the box\n\n### Datasets (24)\n\n| # | Dataset | Agency | Tools |\n|---|---------|--------|-------|\n| 1 | ACRA Corporate Entities (~2M+) | ACRA | 3 |\n| 2 | HDB Resale Flat Prices (2017+) | HDB | 2 |\n| 3 | COE Bidding Results | LTA | 3 |\n| 4 | MOE Schools | MOE | 3 |\n| 5 | HDB Carpark Information | HDB | 3 |\n| 6 | GDP YoY Growth (quarterly) | SingStat | 3 |\n| 7 | Consumer Price Index (monthly) | SingStat | 3 |\n| 8 | MOM Median Gross Monthly Income | MOM | 2 |\n| 9 | Employment by Sector (annual) | SingStat | 3 |\n| 10 | URA Private Residential Transactions | URA | 3 |\n| 11 | International Visitor Arrivals | STB | 3 |\n| 12 | Retail Sales Index (monthly) | SingStat | 3 |\n| 13 | MAS Exchange Rates (monthly avg) | MAS | 3 |\n| 14 | IRAS Tax Collection (annual) | IRAS | 3 |\n| 15 | ECDA Childcare & Kindergarten Centres | ECDA | 3 |\n| 16 | **Unemployment Rate (quarterly)** | MOM | 2 |\n| 17 | **Population Indicators (annual)** | SingStat | 2 |\n| 18 | **Infectious Disease Cases (weekly)** | MOH | 3 |\n| 19 | **Electricity Generation (monthly)** | EMA | 2 |\n| 20 | **Live-Births by Sex/Ethnicity (monthly)** | SingStat | 2 |\n| 21 | **Crime Cases Recorded (annual)** | SPF | 3 |\n| 22 | **Tourism Receipts (annual)** | STB | 2 |\n| 23 | **Government Hawker Centres** | NEA | 2 |\n| 24 | **Business Entity Formations & Cessations** | ACRA/DOS | 6 |\n\nPlus **3 generic fallback tools**, **1 visualization tool**, **2 cross-dataset tools**, and **1 natural language query tool**. Total: **74 tools.**\n\n---\n\n### New in v0.3.0\n\n#### Data visualization — `sg_visualize`\n\nGenerate ASCII sparkline charts and summary statistics from any time series.\nReturns sparklines, min/max/mean/latest, period-over-period change, and\nchart-ready JSON for frontend rendering.\n\n```\nSG Unemployment Rate (SA): ▁█████▄▄████\nLatest: 2 % | Change: +0 (+0%) | Range: 1.8–2 | Mean: 1.97\n```\n\n#### Cross-dataset queries — `sg_cross_dataset`\n\nCompare any two datasets side-by-side over time. Automatically aligns\ndifferent time granularities (monthly, quarterly, annual):\n\n```json\n{\n  \"dataset_a\": \"cpi_monthly\",\n  \"dataset_b\": \"retail_sales\",\n  \"limit\": 5\n}\n```\n\nReturns aligned rows with both values for correlation analysis.\n\n#### Natural language queries — `sg_ask`\n\nAsk questions in plain English — the tool routes to the right dataset\nautomatically:\n\n```\n\"What is Singapore's unemployment rate?\" → sg_unemployment_latest\n\"How many dengue cases?\" → sg_disease_latest\n\"COE prices\" → sg_coe_latest\n\"Crime statistics\" → sg_crime_latest\n```\n\n#### CLI mode — no MCP client needed\n\nQuery data directly from your terminal:\n\n```bash\nsgdata-cli query \"Singapore population growth\"\nsgdata-cli tool sg_crime_compare '{\"year\":\"2024\"}'\nsgdata-cli datasets\n```\n\n---\n\n### Tools (74)\n\n#### Meta tools\n\n| Tool | Description |\n|------|-------------|\n| `sg_ask` | Natural language query — ask any question about Singapore data in plain English |\n| `sg_visualize` | ASCII sparkline + summary stats + chart-ready JSON from any numeric series |\n| `sg_cross_dataset` | Compare two datasets over time with automatic period alignment |\n| `sg_list_datasets` | List all 24 curated datasets with IDs, names, and agencies |\n\n#### Generic tools — any data.gov.sg dataset\n\n| Tool | Description |\n|------|-------------|\n| `sg_search_datasets` | Full-text discovery across all data.gov.sg datasets |\n| `sg_dataset_schema` | Column labels, agency, format for any dataset ID |\n| `sg_dataset_query` | Query any dataset with filters, auto-downloads and caches |\n\n#### Curated dataset tools (67)\n\n**ACRA** (3): `sg_acra_search_entities`, `sg_acra_get_entity`, `sg_acra_formations_by_ssic`\n\n**HDB Resale** (2): `sg_hdb_resale_search`, `sg_hdb_resale_stats`\n\n**COE** (3): `sg_coe_latest`, `sg_coe_history`, `sg_coe_demand_supply`\n\n**MOE Schools** (3): `sg_moe_search_schools`, `sg_moe_school_by_name`, `sg_moe_schools_near`\n\n**HDB Carparks** (3): `sg_hdb_carpark_lookup`, `sg_hdb_carparks_by_address`, `sg_hdb_carparks_by_type`\n\n**GDP** (3): `sg_gdp_latest`, `sg_gdp_history`, `sg_gdp_industry_compare`\n\n**CPI** (3): `sg_cpi_latest`, `sg_cpi_history`, `sg_cpi_yoy`\n\n**Income** (2): `sg_median_income_lookup`, `sg_median_income_history`\n\n**Employment** (3): `sg_employment_by_sector`, `sg_employment_sector_history`, `sg_employment_growth`\n\n**URA Property** (3): `sg_ura_private_txn_latest`, `sg_ura_private_txn_history`, `sg_ura_new_sale_pipeline`\n\n**Visitor Arrivals** (3): `sg_visitors_latest`, `sg_visitors_history`, `sg_visitors_top_sources`\n\n**Retail Sales** (3): `sg_retail_sales_latest`, `sg_retail_sales_history`, `sg_retail_sales_yoy`\n\n**MAS FX** (3): `sg_fx_rate`, `sg_fx_history`, `sg_fx_basket`\n\n**IRAS Tax** (3): `sg_iras_collection`, `sg_iras_collection_history`, `sg_iras_tax_mix`\n\n**ECDA Childcare** (3): `sg_ecda_search_centres`, `sg_ecda_centres_near`, `sg_ecda_vacancy_summary`\n\n**Unemployment** (2): `sg_unemployment_latest`, `sg_unemployment_history`\n\n**Population** (2): `sg_population_latest`, `sg_population_history`\n\n**Disease/Health** (3): `sg_disease_latest`, `sg_disease_trend`, `sg_disease_list`\n\n**Electricity** (2): `sg_electricity_latest`, `sg_electricity_history`\n\n**Births** (2): `sg_births_latest`, `sg_births_history`\n\n**Crime** (3): `sg_crime_latest`, `sg_crime_history`, `sg_crime_compare`\n\n**Tourism** (2): `sg_tourism_latest`, `sg_tourism_history`\n\n**Hawker Centres** (2): `sg_hawker_search`, `sg_hawker_stats`\n\n**Business Formations & Cessations** (6): `sg_formations_latest`, `sg_formations_history`, `sg_formations_compare`, `sg_formations_monthly`, `sg_cessations_monthly`, `sg_net_formations`\n\n---\n\n## Architecture\n\n```\n┌─────────────────┐    spawn    ┌──────────────────────┐\n│ Claude Desktop  │ ──────────▶ │ sgdata-mcp (node)   │\n│ /Cursor/Code    │ ◀── stdio ─▶│ runs on your machine │\n└─────────────────┘             └──────┬───────────────┘\n                                       │ HTTPS (first fetch only)\n                                       ▼\n                              api.data.gov.sg/v2/...\n                                       │\n                                       ▼\n                            ~/.sgdata-mcp/sgdata.sqlite\n                            (shared local SQLite cache)\n```\n\n---\n\n## Caching policy\n\n- **Location.** `~/.sgdata-mcp/sgdata.sqlite` by default.\n- **Override.** Set `SGDATA_MCP_CACHE_DIR=/custom/path`.\n- **Refresh cadence.** Per-dataset — daily for ECDA, weekly for HDB/COE/disease,\n  monthly for ACRA/CPI/GDP/FX/retail/visitors/births/electricity, quarterly for\n  MOE/URA/employment/unemployment, annually for IRAS/income/crime/population/tourism.\n- **Wipe.** `rm ~/.sgdata-mcp/sgdata.sqlite` — next query rebuilds.\n- **Disk.** ~480 MB with ACRA, under 20 MB without.\n\n---\n\n## Comparison\n\n| | `@altronis/sgdata-mcp` | `sgdata-mcp` (by vdineshk) |\n|---|---|---|\n| Tools | **74** | 5 |\n| Coverage | Corporate registry, real estate, prices, labour, tourism, FX, tax, public services, crime, health, demographics, energy | Real-time weather, traffic, carpark availability |\n| CLI mode | Yes | No |\n| Data visualization | Yes (sparklines + chart-ready JSON) | No |\n| Cross-dataset queries | Yes | No |\n| NL query routing | Yes | No |\n| Caching | Yes (SQLite) | No |\n| API keys | None | None |\n\nBoth packages complement each other — install both for the full picture.\n\n---\n\n## Disclaimer\n\nThis tool fetches and caches data from [data.gov.sg](https://data.gov.sg).\nWhile we take care to preserve data integrity during ingestion, **you should\nindependently verify any data before making decisions based on it**.\n\n- **Data accuracy.** All data originates from Singapore government agencies via\n  data.gov.sg. We do not alter source values, but column mappings, wide-to-long\n  transformations, and caching may introduce discrepancies. Always cross-check\n  critical figures against the [official source](https://data.gov.sg).\n- **Not professional advice.** This tool is not a substitute for professional\n  financial, legal, medical, or policy advice. GDP figures, crime statistics,\n  disease counts, property prices, and other data are provided for informational\n  purposes only.\n- **Staleness.** Cached data may be hours to weeks behind the source depending\n  on the dataset's refresh window. Check `ingestedAt` timestamps if freshness\n  matters.\n- **No warranty.** This software is provided \"as is\" under the MIT licence,\n  without warranty of any kind.\n\n---\n\n## FAQ\n\n**Do I need an API key?** No. data.gov.sg open datasets are public.\n\n**Where is the data stored?** On your machine, in `~/.sgdata-mcp/sgdata.sqlite`.\n\n**How often is data refreshed?** Per-dataset, from daily to annually.\n\n**Is this production-ready?** Yes. 74 tools, all tested against live data.\nFile issues on GitHub if you hit anything sharp.\n\n**Can I add my own dataset?** Yes — either use the generic tools for ad-hoc\nqueries, or open a PR adding a handler under `src/datasets/`.\n\n---\n\n## License\n\nMIT\n\n## Attribution\n\nContains information from [data.gov.sg](https://data.gov.sg) under the\n[Singapore Open Data Licence v1.0](https://beta.data.gov.sg/open-data-licence).\n\n---\n\n## Contributing\n\nFound a bug? Want a dataset added? Open an issue or PR on\n[GitHub](https://github.com/sypherin/sgdata-mcp).\n",
  "bytes": 17319,
  "sha": "6ea3b9b1fc4ab616808abf1e66c0b2ff614dad24daba865af877bd81cf874068",
  "repo_slug": "sypherin/sgdata-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_sypherin_sgdata_mcp_46f95ea4/readme"
}