An unofficial Model Context Protocol (MCP) server for accessing Malaysia's Open Data APIs
  • JavaScript 98.8%
  • TypeScript 1.2%
Find a file
Aliff 333ba73266 feat(parquet): add date range, column value, and column selection filters
New parameters for parse_parquet_file:
- filter_date_from / filter_date_to: date range filtering (auto-detects
  date column, inclusive bounds)
- filter_column / filter_value: exact-match filtering on any column
- columns: select specific columns (passed to hyparquet, skips reading
  unneeded columns for better performance)

All filters work with all three output modes (raw, summary, latest).
When filters are active, responses include a filters object showing
what was applied and row counts before/after. Raw mode without filters
retains the original code path for full backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 17:15:37 +08:00
.github/workflows Add Firebase analytics persistence with async loading and dual storage strategy 2025-12-26 09:38:15 +08:00
.smithery Fix parquet date handling and update documentation 2025-09-11 13:53:41 +08:00
deploy refactor: remove geocoding credentials, use Nominatim only 2026-04-02 20:03:42 +08:00
scripts Replace static indexes with live GitHub fetching for datasets and dashboards 2026-03-01 00:52:48 +08:00
src feat(parquet): add date range, column value, and column selection filters 2026-04-03 17:15:37 +08:00
.env.example refactor: remove geocoding credentials, use Nominatim only 2026-04-02 20:03:42 +08:00
.gitignore refactor: consolidate config and utilities into shared modules 2026-02-28 23:14:02 +08:00
.npmignore refactor: consolidate config and utilities into shared modules 2026-02-28 23:14:02 +08:00
.prettierrc Implement unified search across datasets and dashboards 2025-07-27 13:04:16 +08:00
docker-compose.yml refactor: remove geocoding credentials, use Nominatim only 2026-04-02 20:03:42 +08:00
Dockerfile Replace static indexes with live GitHub fetching for datasets and dashboards 2026-03-01 00:52:48 +08:00
eslint.config.mjs feat(api): add offset pagination support and cache warming 2026-03-01 00:58:59 +08:00
LICENSE Implement unified search across datasets and dashboards 2025-07-27 13:04:16 +08:00
malaysia_open_data_mcp_plan.md first commit 2025-07-26 22:23:48 +08:00
package-lock.json refactor: remove geocoding credentials, use Nominatim only 2026-04-02 20:03:42 +08:00
package.json refactor: remove geocoding credentials, use Nominatim only 2026-04-02 20:03:42 +08:00
PROMPT.md Implement unified search across datasets and dashboards 2025-07-27 13:04:16 +08:00
README.md feat(parquet): add summary and latest output modes for AI-friendly data consumption 2026-04-03 16:36:02 +08:00
response.txt Implement unified search across datasets and dashboards 2025-07-27 13:04:16 +08:00
smithery.yaml Implement unified search across datasets and dashboards 2025-07-27 13:04:16 +08:00
TOOLS.md feat(parquet): add date range, column value, and column selection filters 2026-04-03 17:15:37 +08:00
tsconfig.json Replace static indexes with live GitHub fetching for datasets and dashboards 2026-03-01 00:52:48 +08:00

Malaysia Open Data MCP

MCP Endpoint: https://mcp.techmavie.digital/datagovmy/mcp

Analytics Dashboard: https://mcp.techmavie.digital/datagovmy/analytics/dashboard

MCP (Model Context Protocol) server for Malaysia's open data APIs, with tools for datasets, dashboards, DOSM, weather, floods, parquet files, and GTFS transit data.

This is not an official MCP server from the Government of Malaysia, Jabatan Digital Negara, or the Ministry of Digital.

Features

  • Unified search across datasets and dashboards
  • Live metadata fetching from data-gov-my/datagovmy-meta
  • Pure JavaScript parquet parsing with raw, summary, and latest-period modes
  • GTFS static and realtime transit tools
  • Zero-credential geocoding for GTFS location search
  • Built-in analytics endpoints and dashboard

Geocoding

GTFS location search now uses Nominatim (OpenStreetMap) only.

  • No Google Maps, GrabMaps, or AWS credentials are required
  • The hosted MCP URL works as-is with zero credentials
  • Requests are throttled and cached to be friendlier to the public Nominatim service
  • Self-hosted operators can optionally set NOMINATIM_CONTACT_EMAIL

Quick Start

Hosted server

Use the hosted endpoint directly:

https://mcp.techmavie.digital/datagovmy/mcp

Example MCP client config:

{
  "mcpServers": {
    "malaysia-opendata": {
      "transport": "streamable-http",
      "url": "https://mcp.techmavie.digital/datagovmy/mcp"
    }
  }
}

No API keys or geocoding credentials are needed.

Self-hosted

Detailed VPS instructions live in deploy/DEPLOYMENT.md.

npm install
npm run build
npm run start:http

Tool Overview

Search and metadata

  • search_all
  • list_datasets_catalogue
  • search_datasets_catalogue
  • filter_datasets_catalogue
  • get_dataset_filters
  • get_dataset_details
  • list_dashboards
  • search_dashboards
  • get_dashboard_details
  • get_dashboard_charts
  • list_dosm_datasets
  • get_dosm_dataset

Files and dashboards

  • parse_parquet_file
  • get_parquet_info
  • find_dashboard_for_parquet

Weather and floods

  • get_weather_forecast
  • get_weather_warnings
  • get_earthquake_warnings
  • get_flood_warnings

Transport and GTFS

  • list_transport_agencies
  • get_transport_data
  • get_gtfs_static
  • get_gtfs_realtime_vehicle_position
  • parse_gtfs_static
  • parse_gtfs_realtime
  • get_transit_routes
  • get_transit_stops
  • get_transit_arrivals
  • search_transit_stops_by_location
  • find_nearest_transit_stops

Misc

  • hello

More detail and usage guidance lives in TOOLS.md and PROMPT.md.

Local Development

# Install dependencies
npm install

# Run the HTTP server in development mode
npm run dev:http

# Build and run the production server locally
npm run build
npm run start:http

# Verify the server
curl http://localhost:8080/health
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Analytics

The hosted server exposes:

  • /analytics for JSON stats
  • /analytics/tools for tool usage stats
  • /analytics/dashboard for the HTML dashboard

Configuration

Core environment variables

Variable Default Description
PORT 8080 HTTP server port
HOST 0.0.0.0 Bind address
API_BASE_URL https://api.data.gov.my Malaysia Open Data API base URL
CACHE_TTL 3600000 Metadata cache TTL in ms
AXIOS_TIMEOUT 30000 HTTP timeout in ms
GITHUB_FETCH_BATCH_SIZE 20 Concurrent GitHub metadata fetches
GH_PAT empty Optional GitHub token for higher GitHub API rate limits
ANALYTICS_RESET_KEY empty Secret key for analytics reset/import endpoints
ANALYTICS_DIR /app/data Analytics storage directory
FIREBASE_DATABASE_URL empty Firebase Realtime Database URL for analytics persistence
FIREBASE_CREDENTIALS_PATH .credentials/firebase-service-account.json Firebase service account path
NOMINATIM_CONTACT_EMAIL empty Optional contact email appended to Nominatim queries for self-hosted deployments

Example .env:

GH_PAT=your_github_pat_here
NOMINATIM_CONTACT_EMAIL=your-email@example.com
ANALYTICS_RESET_KEY=your_analytics_reset_key_here
ANALYTICS_DIR=/app/data
FIREBASE_DATABASE_URL=your_firebase_database_url_here
FIREBASE_CREDENTIALS_PATH=.credentials/firebase-service-account.json

Nominatim Notes

The server now depends on public Nominatim for GTFS location-name searches. The code includes:

  • A custom User-Agent
  • Optional email support via NOMINATIM_CONTACT_EMAIL
  • Serialized requests with a 1 request/second floor
  • Positive and negative result caching

If you expect sustained geocoding traffic, consider self-hosting a compatible geocoder or routing through your own approved service.

Project Structure

src/
  index.ts
  http-server.ts
  config.ts
  datacatalogue.tools.ts
  dashboards.tools.ts
  dosm.tools.ts
  flood.tools.ts
  gtfs.tools.ts
  parquet.tools.ts
  transport.tools.ts
  unified-search.tools.ts
  weather.tools.ts
  firebase-analytics.ts
  utils/

deploy/
  DEPLOYMENT.md
  nginx-mcp.conf

Troubleshooting

# Docker logs
docker compose logs -f

# Local health check
curl http://localhost:8080/health

# Hosted MCP tool list
curl -X POST https://mcp.techmavie.digital/datagovmy/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

License

MIT. See LICENSE.

Acknowledgments