datagovmy-mcp

lightyoruichi/datagovmy-mcp

3.3

If you are the rightful owner of datagovmy-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Malaysia Data Government MCP Server provides AI assistants with programmatic access to Malaysian government open data through the OpenDOSM and Data Catalogue APIs.

Tools
3
Resources
0
Prompts
0

Malaysia Data Government MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with programmatic access to Malaysian government open data through the OpenDOSM and Data Catalogue APIs.

Key Features

  • Zero setup required. Built with TypeScript - just npx and go!
  • Comprehensive data access. Connects to both OpenDOSM and Data Catalogue APIs.
  • Easy integration. Simple tool interface for querying datasets, filtering, and pagination.

Requirements

  • Node.js 18 or newer - Download Node.js
  • VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client

Getting Started

Using npx (Recommended)

The easiest way to use this server - no installation required:

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

Amp

Add via the Amp VS Code extension settings screen or by updating your settings.json file:

"amp.mcpServers": {
  "datagovmy": {
    "command": "npx",
    "args": [
      "-y",
      "@lightyoruichi/datagovmy-mcp"
    ]
  }
}

Amp CLI Setup:

Add via the amp mcp add command below

amp mcp add datagovmy -- npx -y @lightyoruichi/datagovmy-mcp
Claude Code

Use the Claude Code CLI to add the Malaysia Data Government MCP server:

claude mcp add datagovmy npx -y @lightyoruichi/datagovmy-mcp
Claude Desktop

Follow the MCP install guide, use the standard config above.

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

After adding the configuration, restart Claude Desktop.

Codex

Use the Codex CLI to add the Malaysia Data Government MCP server:

codex mcp add datagovmy npx "-y" "@lightyoruichi/datagovmy-mcp"

Alternatively, create or edit the configuration file ~/.codex/config.toml and add:

[mcp_servers.datagovmy]
command = "npx"
args = ["-y", "@lightyoruichi/datagovmy-mcp"]

For more information, see the Codex MCP documentation.

Copilot

Use the Copilot CLI to interactively add the Malaysia Data Government MCP server:

/mcp add

Alternatively, create or edit the configuration file ~/.copilot/mcp-config.json and add:

{
  "mcpServers": {
    "datagovmy": {
      "type": "local",
      "command": "npx",
      "tools": [
        "*"
      ],
      "args": [
        "-y",
        "@lightyoruichi/datagovmy-mcp"
      ]
    }
  }
}

For more information, see the Copilot CLI documentation.

Cursor
Click the button to install:

Or install manually:

Go to Cursor Settings -> MCP -> Add new MCP Server. Name to your liking, use command type with the command npx -y @lightyoruichi/datagovmy-mcp. You can also verify config or add command like arguments via clicking Edit.

Factory

Use the Factory CLI to add the Malaysia Data Government MCP server:

droid mcp add datagovmy "npx -y @lightyoruichi/datagovmy-mcp"

Alternatively, type /mcp within Factory droid to open an interactive UI for managing MCP servers.

For more information, see the Factory MCP documentation.

Gemini CLI

Follow the MCP install guide, use the standard config above.

Goose
Click the button to install:

Install in Goose

Or install manually:

Go to Advanced settings -> Extensions -> Add custom extension. Name to your liking, use type STDIO, and set the command to npx -y @lightyoruichi/datagovmy-mcp. Click "Add Extension".

Kiro

Follow the MCP Servers documentation. For example in .kiro/settings/mcp.json:

{
  "mcpServers": {
    "datagovmy": {
      "command": "npx",
      "args": [
        "-y",
        "@lightyoruichi/datagovmy-mcp"
      ]
    }
  }
}
LM Studio
Click the button to install:

Add MCP Server datagovmy to LM Studio

Or install manually:

Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above.

opencode

Follow the MCP Servers documentation. For example in ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "datagovmy": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "@lightyoruichi/datagovmy-mcp"
      ],
      "enabled": true
    }
  }
}

Qodo Gen

Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.

Click Save.

VS Code
Click the button to install:

Or install manually:

Follow the MCP install guide, use the standard config above. You can also install the Malaysia Data Government MCP server using the VS Code CLI:

# For VS Code
code --add-mcp '{"name":"datagovmy","command":"npx","args":["-y","@lightyoruichi/datagovmy-mcp"]}'

After installation, the Malaysia Data Government MCP server will be available for use with your GitHub Copilot agent in VS Code.

Warp

Go to Settings -> AI -> Manage MCP Servers -> + Add to add an MCP Server. Use the standard config above.

Alternatively, use the slash command /add-mcp in the Warp prompt and paste the standard config from above:

{
  "mcpServers": {
    "datagovmy": {
      "command": "npx",
      "args": [
        "-y",
        "@lightyoruichi/datagovmy-mcp"
      ]
    }
  }
}
Windsurf

Follow Windsurf MCP documentation. Use the standard config above.

Local Development

For local development with TypeScript:

cd /Users/lightyoruichi/Dev/datagovmy-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Link globally for testing
npm link

Then use this configuration:

{
  "mcpServers": {
    "datagovmy": {
      "command": "datagovmy-mcp"
    }
  }
}

Note: npm link creates a global symlink, making the datagovmy-mcp command available system-wide.

Or for development with auto-reload:

# Run directly with tsx (no build needed)
npm run dev

Discovering Datasets

You have multiple ways to discover available datasets:

1. Use Discovery Tools (Recommended)

The server provides built-in tools to search and explore datasets:

# Ask your AI assistant:
"What datasets are available about fuel prices?"
"List all datasets in the Prices category"
"Show me datasets related to GDP"

The AI will use the search_datasets and list_datasets tools automatically to find relevant data.

2. Browse Categorized Datasets
💰 Economy & Finance (OpenDOSM)
  • gdp - Gross Domestic Product
  • gdp_qtr - GDP by Quarter
  • gdp_annual - GDP Annual
  • ppi - Producer Price Index
  • trade - International Trade
  • banking - Banking Statistics
  • foreign_exchange - Foreign Exchange Rates
  • property_prices - Property Prices

Keywords: economy, gdp, growth, national accounts, trade, finance

📊 Prices & Inflation (OpenDOSM & Data Catalogue)
  • cpi - Consumer Price Index
  • cpi_core - Core Consumer Price Index
  • inflation - Inflation Rate
  • fuelprice - Weekly Fuel Prices (RON95, RON97, Diesel)
  • ppi - Producer Price Index

Keywords: prices, inflation, cpi, cost of living, fuel, petrol

👥 Population & Demography (OpenDOSM)
  • population - Population Statistics
  • population_malaysia - Population of Malaysia
  • population_state - Population by State
  • births - Live Births
  • deaths - Deaths
  • marriage - Marriages
  • divorce - Divorces

Keywords: population, demography, births, deaths, fertility, mortality

💼 Labour & Employment (OpenDOSM)
  • unemployment - Unemployment Rate
  • lfs_monthly - Labour Force Survey (Monthly)
  • wages - Wages and Salaries

Keywords: unemployment, labour, jobs, work, employment, workforce, wages, salary

🏥 Healthcare (OpenDOSM & Data Catalogue)
  • healthcare - Healthcare Statistics
  • blood_donation - Blood Donation
  • hospital_beds - Hospital Beds
  • covid_cases - COVID-19 Cases
  • covid_vaccination - COVID-19 Vaccination

Keywords: healthcare, medical, health, hospitals, covid, pandemic

🏠 Households & Welfare (OpenDOSM)
  • poverty - Poverty Statistics
  • hh_income - Household Income

Keywords: poverty, income, household, earnings, welfare

🌍 Environment (OpenDOSM & Data Catalogue)
  • electricity - Electricity Statistics
  • renewable_energy - Renewable Energy
  • rainfall - Rainfall Data
  • air_quality - Air Quality Index
  • water_quality - Water Quality

Keywords: environment, energy, electricity, renewable, weather, climate, pollution

🚔 Public Safety (OpenDOSM & Data Catalogue)
  • crime - Crime Statistics

Keywords: crime, safety, police, law enforcement

🚗 Transportation (Data Catalogue)
  • traffic - Traffic Data
  • vehicle_registration - Vehicle Registration
  • public_transport - Public Transport Ridership

Keywords: traffic, transportation, vehicles, cars, bus, train

🏭 Economic Sectors (Data Catalogue)
  • agriculture - Agricultural Production
  • manufacturing - Manufacturing Statistics
  • construction - Construction Statistics

Keywords: agriculture, farming, manufacturing, industry, construction

📚 Education (Data Catalogue)
  • education - Education Statistics

Keywords: education, schools, students, enrollment

🌴 Tourism (Data Catalogue)
  • tourist_arrivals - Tourist Arrivals

Keywords: tourism, tourists, arrivals, travel

3. Manual Browse (Alternative)

If you prefer, you can still browse the data catalogues directly:

  1. OpenDOSM Datasets: open.dosm.gov.my/data-catalogue
  2. Data Catalogue Datasets: data.gov.my/data-catalogue

On each dataset page, scroll to the "Sample OpenAPI query" section to find the dataset ID.

Tools

Data Querying
  • query_opendosm
    • Title: Query OpenDOSM Dataset
    • Description: Query an OpenDOSM dataset (Department of Statistics Malaysia)
    • Parameters:
      • dataset_id (string, required): Dataset ID (e.g., 'cpi_core', 'gdp', 'population')
      • filters (string, optional): JSON string of filter parameters (e.g., '{"date": "2024-01-01"}')
      • limit (integer, optional): Maximum number of records to return (default: 100)
      • offset (integer, optional): Number of records to skip for pagination (default: 0)
    • Read-only: false
    • Example use cases:
      • Get latest CPI data: dataset_id='cpi_core', limit=10
      • Get GDP data for specific date: dataset_id='gdp', filters='{"date": "2024-01-01"}'
  • query_data_catalogue
    • Title: Query Data Catalogue Dataset
    • Description: Query a Data Catalogue dataset (broader government data)
    • Parameters:
      • dataset_id (string, required): Dataset ID (e.g., 'fuelprice', 'healthcare', 'crime')
      • filters (string, optional): JSON string of filter parameters (e.g., '{"date": "2024-01-01"}')
      • limit (integer, optional): Maximum number of records to return (default: 100)
      • offset (integer, optional): Number of records to skip for pagination (default: 0)
    • Read-only: false
    • Example use cases:
      • Get latest fuel prices: dataset_id='fuelprice', limit=5
      • Get filtered data: dataset_id='fuelprice', filters='{"date": "2024-12-01"}'
  • get_dataset_metadata
    • Title: Get Dataset Metadata
    • Description: Get metadata for a dataset without fetching the actual data records
    • Parameters:
      • dataset_id (string, required): Dataset ID to get metadata for
      • source (string, required): Data source - either 'opendosm' or 'data_catalogue'
    • Read-only: true
    • Example use cases:
      • Get fuel price metadata: dataset_id='fuelprice', source='data_catalogue'
      • Get CPI metadata: dataset_id='cpi_core', source='opendosm'
Dataset Discovery
  • list_datasets
    • Title: List Available Datasets
    • Description: List all available datasets with optional filtering
    • Parameters:
      • source (string, optional): Filter by source - 'opendosm', 'data_catalogue', or None for all
      • category (string, optional): Filter by category (e.g., 'Prices', 'Demography', 'Economy')
      • limit (integer, optional): Maximum number of datasets to return (default: 100)
      • offset (integer, optional): Number of datasets to skip for pagination (default: 0)
    • Read-only: true
    • Example use cases:
      • List all datasets: (no parameters)
      • List OpenDOSM datasets: source='opendosm'
      • List price-related datasets: category='Prices'
  • search_datasets
    • Title: Search Datasets
    • Description: Search for datasets by keyword
    • Parameters:
      • query (string, required): Search query (searches in name, description, keywords, and ID)
      • source (string, optional): Filter by source - 'opendosm', 'data_catalogue', or None for all
      • limit (integer, optional): Maximum number of results to return (default: 10)
    • Read-only: true
    • Example use cases:
      • Search for fuel data: query='fuel'
      • Search for GDP: query='gdp'
      • Search for population: query='population'
  • get_dataset_schema
    • Title: Get Dataset Schema
    • Description: Get schema, metadata, and sample data for a dataset
    • Parameters:
      • dataset_id (string, required): Dataset ID to get schema for
      • source (string, required): Data source - either 'opendosm' or 'data_catalogue'
    • Read-only: true
    • Example use cases:
      • Get fuel price schema: dataset_id='fuelprice', source='data_catalogue'
      • Get GDP schema: dataset_id='gdp', source='opendosm'

API Details

OpenDOSM API
  • Base URL: https://api.data.gov.my/opendosm
  • Data Source: Department of Statistics Malaysia
  • Focus: Economic and demographic statistics
Data Catalogue API
  • Base URL: https://api.data.gov.my/data-catalogue
  • Data Source: Various Malaysian government agencies
  • Focus: Broader government data (healthcare, crime, education, etc.)

Both APIs support:

  • Filtering with query parameters
  • Pagination with limit and offset
  • Metadata retrieval with meta_only=true

Testing

With MCP Inspector
# Terminal 1: Start the server in development mode
npm run dev

# Terminal 2: In a new terminal, launch Inspector
npx @modelcontextprotocol/inspector

The Inspector will open in your browser. Connect to the stdio server you started in Terminal 1.

Testing Locally
# Build and link the package
npm run build
npm link

# The server is now available as 'datagovmy-mcp' command
# Configure your MCP client to use it

Data Categories

The catalogues include data across these categories:

  • Demography: Population, births, deaths, migration
  • Economy: GDP, inflation, trade, productivity
  • Labour: Employment, wages, labour force
  • Prices: Consumer prices, producer prices, fuel
  • Healthcare: Health statistics, disease data, infrastructure
  • Education: Schools, enrollment, outcomes
  • Public Safety: Crime, justice system
  • Environment: Energy, pollution, land use
  • Financial Markets: Banking, foreign exchange
  • Transportation: Vehicle registrations, ridership

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License - see LICENSE file for details

Links