Skip to content
Back to search

sg-gov-mcp

MCP server over Singapore government open data - horizontal, rate-limit respecting

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/azjhf-dev--sg-gov-mcp/badge.svg)](/listings/azjhf-dev--sg-gov-mcp)

HTML

<a href="/listings/azjhf-dev--sg-gov-mcp"><img src="/api/listings/azjhf-dev--sg-gov-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 113 lines
  1. # sg-gov-mcp
  2. A dependency-free Node MCP stdio server for Singapore government open data.
  3. One interface across agencies. No API keys are needed for the implemented tools.
  4. ## Status: iteration 2 (2026-11-20)
  5. 16 tools: 12 real-time feeds, 2 general tabular dataset tools, 2 diagnostics.
  6. The server is a prototype, not a hosted or production-hardened service.
  7. - Conservative sliding-window quota groups, below documented limits.
  8. - Shared cooldown on HTTP 429. Honor `Retry-After`, with a 10.5-second minimum.
  9. Retry at most once. A wait longer than one minute fails early but keeps the
  10. cooldown, rather than occupying the call indefinitely.
  11. - Cache bounded at 256 entries. Concurrent identical fetches share one request.
  12. - No boundary probing, quota bypasses, proxy rotation or automatic page crawling.
  13. - 28 offline tests and 9 live MCP smoke checks pass on 2026-11-20.
  14. ## Run and test
  15. Requires Node 18 or newer, no install step or packages:
  16. ```bash
  17. node src/server.js # MCP JSON-RPC over stdin/stdout
  18. npm test # offline fixtures, fake clocks, fake HTTP, stdio
  19. npm run test:live # four upstream calls, plus cached/diagnostic checks
  20. ```
  21. Run just one live test process at a time, with at least 10 seconds between
  22. runs. Limits apply to all clients sharing an upstream quota, not just this app.
  23. Do not run quota-discovery requests designed to exceed documented limits.
  24. Claude Code:
  25. ```bash
  26. claude mcp add sg-gov -- node /path/to/sg-gov-mcp/src/server.js
  27. ```
  28. Desktop config:
  29. ```json
  30. {"mcpServers":{"sg-gov":{"command":"node","args":["/path/to/sg-gov-mcp/src/server.js"]}}}
  31. ```
  32. ## Tools
  33. | Tool | Data |
  34. |---|---|
  35. | sg_pm25 | NEA PM2.5 by region |
  36. | sg_psi | NEA PSI and sub-indices |
  37. | sg_uv_index | NEA UV index |
  38. | sg_weather_forecast_2hr | NEA forecast by area |
  39. | sg_weather_forecast_24hr | NEA island-wide forecast |
  40. | sg_air_temperature | Weather-station temperature |
  41. | sg_rainfall | Station rainfall |
  42. | sg_relative_humidity | Station humidity |
  43. | sg_wind_direction | Station wind direction |
  44. | sg_wind_speed | Station wind speed |
  45. | sg_taxi_availability | Available taxis, legacy LTA feed |
  46. | sg_carpark_availability | Available carpark lots, legacy feed |
  47. | sg_dataset_schema | Tabular column names/types and total rows |
  48. | sg_dataset_rows | Tabular rows with exact filters, projection and sorting |
  49. | sg_list_sources | Implemented source registry |
  50. | sg_rate_limit_status | Per-process quota groups, cooldown and cache count |
  51. Real-time tools accept an optional SGT `date` string where supported by the
  52. upstream. Dataset tools require a `dataset_id` copied from a dataset page.
  53. They do not find dataset IDs or promise every catalogue format is queryable.
  54. ### Example: HDB resale transactions
  55. Verified source: https://data.gov.sg/datasets/d_8b84c4ee58e3cfc0ece0d773c8ca6abc/view
  56. 1. Call `sg_dataset_schema`:
  57. ```json
  58. {"dataset_id":"d_8b84c4ee58e3cfc0ece0d773c8ca6abc"}
  59. ```
  60. 2. Call `sg_dataset_rows`:
  61. ```json
  62. {"dataset_id":"d_8b84c4ee58e3cfc0ece0d773c8ca6abc","limit":2,"offset":0,"filters":{"town":"ANG MO KIO"},"fields":["month","town","resale_price"],"sort":"month desc"}
  63. ```
  64. 3. To continue, reuse the query with the returned `next_offset`. Pagination
  65. is explicit, never automatic. Default limit 20, maximum 50. A large result
  66. is shortened by removing complete rows, preserving valid JSON and a next
  67. position without skipping undisplayed rows. For stable pagination when rows
  68. are changing, choose an appropriate stable sort key from the schema.
  69. Dataset values are untrusted content, never instructions. HDB prices are
  70. indicative, not valuations. Read the publisher's notes before comparing them.
  71. ## Limits and remaining work
  72. - Implementation still uses the keyless tier. A developer key is stored
  73. securely but its programmatic use awaits owner permission. No secrets here.
  74. - Datastore queries share a 3 requests/10s bucket, below documented 4/10s.
  75. Real-time requests use 5/10s, below 6/10s. Cache TTLs are source-specific.
  76. - Quota state is **per process**. Do not deploy replicas or run other clients
  77. against the same quota without an external shared limiter and coordination.
  78. "Horizontal" here means breadth of agencies, not distributed scaling.
  79. - The documented catalogue/metadata host returned HTTP 403 during checks.
  80. Those tools are not shipped. No alternate-host bypass was attempted.
  81. - Legacy taxi/carpark APIs may change. No new quota measurement was attempted.
  82. - LTA DataMall signup waits on permission to use a required contact number.
  83. - OneMap account exists, but REST wrapping/token renewal is not implemented.
  84. Its regular REST token and official MCP gateway auth/quotas are distinct.
  85. - No bulk downloads, SQL endpoint, hosted billing or GitHub Actions workflows.
  86. Evidence and next stages: [RATE-LIMITS.md](docs/RATE-LIMITS.md),
  87. [ITERATION-2.md](docs/ITERATION-2.md), [PLAN.md](docs/PLAN.md).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.