@reneturcios/myopendata

中文文档
0.1.0发布于 2026/11/02MITES Module

Malaysia open data without a key: search datasets and dashboards, DOSM data, weather and flood warnings, and GTFS transit routes and stops from data.gov.my. One bin serves a small CLI and a stdio MCP server.

原始使用文档
文档目录6 节
  1. Install
  2. CLI
  3. MCP server
  4. Tools
  5. Development
  6. License

myopendata

myopendata reads Malaysia's open data: a unified search across the dataset catalogue and dashboards, dataset and dashboard details, Department of Statistics Malaysia (DOSM) datasets, weather forecasts and warnings, flood warnings, and GTFS transit routes and stops. One binary serves a command-line interface and a stdio MCP server.

This is a clean-room rebuild covering a labelled core subset of the documented tools (16 of 32); parquet, raw GTFS parsing, arrivals and location-search tools are not included. It is not an official Government of Malaysia server.

No API key is needed. The service is keyless, so myopendata works with nothing configured. The API base URL can be overridden with MYOPENDATA_API_URL; when it is not set, calls go to https://api.data.gov.my.

Install

npx @reneturcios/myopendata list-datasets

Or run the container image:

docker run -i ghcr.io/cloudcorprecords/myopendata

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

myopendata search-all "e-payment statistics" --limit 10
myopendata list-datasets --limit 5
myopendata search-datasets population
myopendata dataset population_malaysia
myopendata list-dashboards
myopendata search-dashboards health
myopendata dashboard kawasanku
myopendata list-dosm
myopendata dosm population
myopendata weather-forecast --location "Kuala Lumpur"
myopendata weather-warnings
myopendata flood-warnings
myopendata transport-agencies
myopendata transit-routes prasarana --category rapid-rail-kl
myopendata transit-stops ktmb
myopendata hello Ada

myopendata --version

Commands print the upstream JSON payload; hello prints a greeting string. Exit codes: 0 on success, 1 when a call fails (including an upstream API error), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

npx -y @reneturcios/myopendata mcp

MCP client configuration:

{
  "mcpServers": {
    "myopendata": {
      "command": "npx",
      "args": ["-y", "@reneturcios/myopendata", "mcp"]
    }
  }
}

To point the server at a different compatible host, add MYOPENDATA_API_URL to the client's env for this server.

Tools

ToolInputWhat it returns
search_allquery (required), limit (optional)Unified search results across datasets and dashboards.
list_datasets_cataloguelimit (optional)Datasets in the data catalogue.
search_datasets_cataloguequery (required), limit (optional)Catalogue datasets matching the query.
get_dataset_detailsid (required)Details for one dataset.
list_dashboardslimit (optional)Available dashboards.
search_dashboardsquery (required), limit (optional)Dashboards matching the query.
get_dashboard_detailsname (required)Details for one dashboard.
list_dosm_datasetslimit (optional)DOSM datasets.
get_dosm_datasetid (required)One DOSM dataset.
get_weather_forecastlocation (optional)The weather forecast payload.
get_weather_warnings(none)Current weather warnings.
get_flood_warnings(none)Current flood warnings.
list_transport_agencies(none)Transport agencies with GTFS data.
get_transit_routesprovider (required), category (optional)Transit routes for a GTFS provider.
get_transit_stopsprovider (required), category (optional)Transit stops for a GTFS provider.
helloname (optional)A greeting string. Health-check style tool for connectivity testing.

Known GTFS providers in the upstream documentation include mybas-johor, ktmb, and prasarana; common names are a feature of the original server and are not normalised by this rebuild — pass the provider id directly.

Development

npm install
npm run build   # tsc -> dist/
npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)
npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

版本与发布记录

@reneturcios/myopendata 共发布 2 个版本,首次发布于 2026/11/02;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.1.0latest2026/11/021 天前
0.0.0-stage2026/11/021 天前

关于 @reneturcios/myopendata 的常见问题

@reneturcios/myopendata 是什么?

马来西亚无键开放数据:搜索数据集和仪表板,DOSM数据,天气和洪水预警,以及GTFS过境路线和站点从data.gov.my。一个bin提供一个小型CLI和一个studio MCP服务器。

如何安装 @reneturcios/myopendata?

在项目目录运行 npm install @reneturcios/myopendata,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 myopendata,可以用 npx myopendata 直接运行。

@reneturcios/myopendata 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/reneturcios__myopendata 是否存在。

@reneturcios/myopendata 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@reneturcios/myopendata 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@reneturcios/myopendata 可以商用吗?

@reneturcios/myopendata 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@reneturcios/myopendata 还在维护吗?

最新版本 0.1.0 发布于 2026/11/02(1 天前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。