This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
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, providing easy access to government datasets and collections.
Do note that this is NOT an official MCP server by the Government of Malaysia or anyone from Malaysia's Open Data/Jabatan Digital Negara/Ministry of Digital team.
This MCP server fetches dataset and dashboard metadata live from the data-gov-my/datagovmy-meta GitHub repository:
This approach provides several benefits:
When integrating this MCP server with AI models:
search_all for any data querieshttps://data.gov.my/... and https://open.dosm.gov.my/...parse_parquet_file to access data directly or get_parquet_info for metadatafind_dashboard_for_parquetRefer to PROMPT.md for comprehensive AI integration guidelines.
npm installThe easiest way to use this MCP server is via the hosted endpoint. No installation required!
Server URL:
https://mcp.techmavie.digital/datagovmy/mcp
You can provide your own API keys via URL query parameters:
https://mcp.techmavie.digital/datagovmy/mcp?googleMapsApiKey=YOUR_KEY
Or via headers:
X-Google-Maps-Api-Key: YOUR_KEYX-GrabMaps-Api-Key: YOUR_KEYX-AWS-Access-Key-Id: YOUR_KEYX-AWS-Secret-Access-Key: YOUR_KEYX-AWS-Region: ap-southeast-5Supported Query Parameters:
| Parameter | Description |
|---|---|
googleMapsApiKey | Google Maps API key for geocoding |
grabMapsApiKey | GrabMaps API key for Southeast Asia geocoding |
awsAccessKeyId | AWS Access Key ID for AWS Location Service |
awsSecretAccessKey | AWS Secret Access Key |
awsRegion | AWS Region (default: ap-southeast-5) |
⚠️ Important: GrabMaps Requirements
To use GrabMaps geocoding, you need ALL FOUR parameters:
grabMapsApiKeyawsAccessKeyIdawsSecretAccessKeyawsRegionGrabMaps uses AWS Location Service under the hood, so AWS credentials are required alongside the GrabMaps API key.
For Claude Desktop / Cursor / Windsurf, add to your MCP configuration:
{
"mcpServers": {
"malaysia-opendata": {
"transport": "streamable-http",
"url": "https://mcp.techmavie.digital/datagovmy/mcp"
}
}
}With your own API key:
{
"mcpServers": {
"malaysia-opendata": {
"transport": "streamable-http",
"url": "https://mcp.techmavie.digital/datagovmy/mcp?googleMapsApiKey=YOUR_KEY"
}
}
}If you prefer to run your own instance, see deploy/DEPLOYMENT.md for detailed VPS deployment instructions with Docker and Nginx.
The hosted server includes a built-in analytics dashboard:
Dashboard URL: https://mcp.techmavie.digital/datagovmy/analytics/dashboard
| Endpoint | Description |
|---|---|
/analytics | Full analytics summary (JSON) |
/analytics/tools | Detailed tool usage stats (JSON) |
/analytics/dashboard | Visual dashboard with charts (HTML) |
The dashboard tracks:
Auto-refreshes every 30 seconds.
search_all: Primary search tool — searches across both datasets and dashboards with intelligent fallback and scoringlist_datasets_catalogue: Lists available datasets in the Data Cataloguesearch_datasets_catalogue: Searches datasets in the Data Cataloguefilter_datasets_catalogue: Filters datasets by frequency, geography, demography, data source, or year rangeget_dataset_details: Gets metadata/details for a specific datasetget_dataset_filters: Gets available filter options for datasetslist_dashboards: Lists all available dashboardssearch_dashboards: Searches dashboards by queryget_dashboard_details: Gets comprehensive metadata for a dashboardget_dashboard_charts: Gets chart configurations for a specific dashboardlist_dosm_datasets: Lists available datasets from DOSMget_dosm_dataset: Gets data from a specific DOSM datasetparse_parquet_file: Parse and display data from a Parquet file URL
get_parquet_info: Get metadata and structure information about a Parquet filefind_dashboard_for_parquet: Find the corresponding dashboard URL for a Parquet fileget_weather_forecast: Gets weather forecast for Malaysiaget_weather_warnings: Gets current weather warnings for Malaysiaget_earthquake_warnings: Gets earthquake warnings for Malaysialist_transport_agencies: Lists available transport agencies with GTFS dataget_transport_data: Gets GTFS data for a specific transport agencyparse_gtfs_static: Parses GTFS Static data (ZIP files with CSV data) for a specific transport providerparse_gtfs_realtime: Parses GTFS Realtime data (Protocol Buffer format) for vehicle positionsget_transit_routes: Extracts route information from GTFS dataget_transit_stops: Extracts stop information from GTFS data, optionally filtered by routeget_flood_warnings: Gets current flood warnings for Malaysia, filterable by state, district, and severityhello: A simple test tool to verify that the MCP server is working correctlyThe MCP server provides robust handling for data-catalogue information retrieval:
employment_sector with annual data from 2001-2022const result = await tools.get_weather_forecast({
location: "Kuala Lumpur",
days: 3
});const result = await tools.search_datasets_catalogue({
query: "population",
limit: 5
});// Parse GTFS Static data
const staticData = await tools.parse_gtfs_static({
provider: "ktmb"
});
// Get real-time vehicle positions
const realtimeData = await tools.parse_gtfs_realtime({
provider: "prasarana",
category: "rapid-rail-kl"
});
// Get transit routes
const routes = await tools.get_transit_routes({
provider: "mybas-johor"
});
// Get stops for a specific route
const stops = await tools.get_transit_stops({
provider: "prasarana",
category: "rapid-rail-kl",
route_id: "LRT-KJ"
});Please be aware of rate limits for the underlying APIs. Excessive requests may be throttled.
src/
├── index.ts # Main MCP server (stdio transport)
├── http-server.ts # Streamable HTTP server for VPS deployment
├── config.ts # Centralized configuration (API URLs, cache TTLs, timeouts)
├── firebase-analytics.ts # Firebase analytics persistence
├── datacatalogue.tools.ts # Data Catalogue search and listing tools
├── dashboards.tools.ts # Dashboard search and listing tools
├── unified-search.tools.ts # Unified search across datasets and dashboards
├── dosm.tools.ts # Department of Statistics Malaysia tools
├── parquet.tools.ts # Parquet file parsing and metadata tools
├── weather.tools.ts # Weather forecast and warnings tools
├── transport.tools.ts # Transport and GTFS data tools
├── gtfs.tools.ts # GTFS parsing and geocoding tools
├── flood.tools.ts # Flood warning and monitoring tools
└── utils/
├── github-index.ts # Live GitHub index fetcher (Trees API + raw content)
├── search.ts # Shared search utilities (tokenization, synonyms)
└── tool-naming.ts # Tool name prefixing utility
deploy/ # Deployment files (nginx config, deployment guide)
Dockerfile # Docker configuration for VPS deployment
docker-compose.yml # Docker Compose configuration# Install dependencies
npm install
# Run HTTP server in development mode
npm run dev:http
# Or build and run production version
npm run build
npm run start:http
# Test health endpoint
curl http://localhost:8080/health
# Test MCP endpoint
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'# Check container status
docker compose ps
# View logs
docker compose logs -f
# Restart container
docker compose restart# List tools
curl -X POST https://mcp.techmavie.digital/datagovmy/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# Call hello tool
curl -X POST https://mcp.techmavie.digital/datagovmy/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"datagovmy_hello","arguments":{}}}'This project supports the following configuration options:
Server Configuration:
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | HTTP server port |
API_BASE_URL | https://api.data.gov.my | Malaysia Open Data API base URL |
CACHE_TTL | 3600000 | Cache time-to-live in ms (default: 1 hour) |
AXIOS_TIMEOUT | 30000 | HTTP request timeout in ms (default: 30s) |
GITHUB_FETCH_BATCH_SIZE | 20 | Concurrent file fetches when loading indexes from GitHub |
GH_PAT | � | Optional GitHub PAT for higher API rate limits (60/hr anonymous vs 5000/hr authenticated). Recommended for production. |
ANALYTICS_RESET_KEY | — | Secret key required for /analytics/reset and /analytics/import endpoints |
FIREBASE_DATABASE_URL | — | Firebase Realtime Database URL for analytics persistence |
FIREBASE_CREDENTIALS_PATH | .credentials/firebase-service-account.json | Path to Firebase service account credentials |
Geocoding Credentials (Optional. Only for GTFS Transit Features Usage):
The following credentials are only needed if you plan to use the GTFS transit tools that require geocoding services. Other features like data catalogue access, weather forecasts, and DOSM data do not require these credentials.
If neither Google Maps nor GrabMaps API keys are provided, the GTFS transit tools will automatically fall back to using Nominatim (OpenStreetMap) API for geocoding, which is free and doesn't require credentials.
You can set these configuration options in two ways:
Create a .env file in the root directory:
GOOGLE_MAPS_API_KEY=your_google_api_key_here
GRABMAPS_API_KEY=your_grab_api_key_here
AWS_ACCESS_KEY_ID=your_aws_access_key_for_grabmaps
AWS_SECRET_ACCESS_KEY=your_aws_secret_key_for_grabmaps
AWS_REGION=ap-southeast-5The variables will be automatically loaded when you run the server.
Note: For Malaysian locations, GrabMaps provides the most accurate geocoding results, followed by Google Maps. If you don't provide either API key, the system will automatically use Nominatim API instead, which is free but may have less accurate results for some locations in Malaysia.
Important: These geocoding credentials are only required for the following GTFS transit tools:
get_transit_routes - When converting location names to coordinatesget_transit_stops - When converting location names to coordinatesparse_gtfs_static - When geocoding is needed for stop locationsNote about GTFS Realtime Tools: The parse_gtfs_realtime tool is currently in development and has limited availability. Real-time data access through this MCP is experimental and may not be available for all providers or routes. For up-to-date train and bus schedules, bus locations, and arrivals in real-time, please use official transit apps like Google Maps, MyRapid PULSE, Moovit, or Lugo.
All other tools like data catalogue access, dashboard search, weather forecasts, and DOSM data do not require any geocoding credentials.
MIT - See LICENSE file for details.