@lightyoruichi/datagovmy-mcp
v0.3.1
Published
MCP server for Malaysian government open data APIs (OpenDOSM and Data Catalogue)
Maintainers
Readme
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
npxand 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"
]
}
}
}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-mcpUse the Claude Code CLI to add the Malaysia Data Government MCP server:
claude mcp add datagovmy npx -y @lightyoruichi/datagovmy-mcpFollow 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.
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.
Use the Copilot CLI to interactively add the Malaysia Data Government MCP server:
/mcp addAlternatively, 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.
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.
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.
Follow the MCP install guide, use the standard config above.
Click the button to install:
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".
Follow the MCP Servers documentation. For example in .kiro/settings/mcp.json:
{
"mcpServers": {
"datagovmy": {
"command": "npx",
"args": [
"-y",
"@lightyoruichi/datagovmy-mcp"
]
}
}
}Click the button to install:
Or install manually:
Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above.
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
}
}
}
Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
Click Save.
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.
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"
]
}
}
}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 linkThen use this configuration:
{
"mcpServers": {
"datagovmy": {
"command": "datagovmy-mcp"
}
}
}Note:
npm linkcreates a global symlink, making thedatagovmy-mcpcommand available system-wide.
Or for development with auto-reload:
# Run directly with tsx (no build needed)
npm run devDiscovering 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
gdp- Gross Domestic Productgdp_qtr- GDP by Quartergdp_annual- GDP Annualppi- Producer Price Indextrade- International Tradebanking- Banking Statisticsforeign_exchange- Foreign Exchange Ratesproperty_prices- Property Prices
Keywords: economy, gdp, growth, national accounts, trade, finance
cpi- Consumer Price Indexcpi_core- Core Consumer Price Indexinflation- Inflation Ratefuelprice- Weekly Fuel Prices (RON95, RON97, Diesel)ppi- Producer Price Index
Keywords: prices, inflation, cpi, cost of living, fuel, petrol
population- Population Statisticspopulation_malaysia- Population of Malaysiapopulation_state- Population by Statebirths- Live Birthsdeaths- Deathsmarriage- Marriagesdivorce- Divorces
Keywords: population, demography, births, deaths, fertility, mortality
unemployment- Unemployment Ratelfs_monthly- Labour Force Survey (Monthly)wages- Wages and Salaries
Keywords: unemployment, labour, jobs, work, employment, workforce, wages, salary
healthcare- Healthcare Statisticsblood_donation- Blood Donationhospital_beds- Hospital Bedscovid_cases- COVID-19 Casescovid_vaccination- COVID-19 Vaccination
Keywords: healthcare, medical, health, hospitals, covid, pandemic
poverty- Poverty Statisticshh_income- Household Income
Keywords: poverty, income, household, earnings, welfare
electricity- Electricity Statisticsrenewable_energy- Renewable Energyrainfall- Rainfall Dataair_quality- Air Quality Indexwater_quality- Water Quality
Keywords: environment, energy, electricity, renewable, weather, climate, pollution
crime- Crime Statistics
Keywords: crime, safety, police, law enforcement
traffic- Traffic Datavehicle_registration- Vehicle Registrationpublic_transport- Public Transport Ridership
Keywords: traffic, transportation, vehicles, cars, bus, train
agriculture- Agricultural Productionmanufacturing- Manufacturing Statisticsconstruction- Construction Statistics
Keywords: agriculture, farming, manufacturing, industry, construction
education- Education Statistics
Keywords: education, schools, students, enrollment
tourist_arrivals- Tourist Arrivals
Keywords: tourism, tourists, arrivals, travel
3. Manual Browse (Alternative)
If you prefer, you can still browse the data catalogues directly:
- OpenDOSM Datasets: open.dosm.gov.my/data-catalogue
- 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
- 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"}'
- Get latest CPI data:
- 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 latest fuel prices:
- 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 forsource(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'
- Get fuel price metadata:
- 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 allcategory(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 alllimit(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'
- Search for fuel data:
- 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 forsource(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'
- Get fuel price schema:
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
limitandoffset - 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/inspectorThe 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 itData 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
