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