MCP Hub
Back to servers

BPS MCP Server

Enables AI clients to access official Indonesian statistical data from Badan Pusat Statistik (BPS) through natural language queries. It provides over 20 tools for retrieving demographic, economic, and trade data with support for bilingual responses and fuzzy domain matching.

glama
Updated
Mar 31, 2026

BPS MCP Server

CI License: MIT Node.js

MCP (Model Context Protocol) server untuk data statistik BPS (Badan Pusat Statistik) Indonesia. Memungkinkan AI clients seperti Claude Desktop, Claude Code, Cursor, dan lainnya untuk mengakses data statistik resmi Indonesia melalui natural language.

Fitur

  • 32 tools mencakup seluruh endpoint BPS API v1
  • 3 MCP Resources — domain list, kabupaten per provinsi, subjek per domain
  • 5 MCP Prompts — template analisis data siap pakai
  • Domain resolver dengan fuzzy matching (ketik "Jatim" → Jawa Timur)
  • Data formatter yang mengubah raw BPS data menjadi format mudah dibaca
  • In-memory cache dengan TTL per tipe data
  • Bilingual — mendukung bahasa Indonesia dan Inggris
  • Atribusi BPS otomatis di setiap response (sesuai ToU)
  • BYOK (Bring Your Own Key) — setiap user menggunakan API key BPS sendiri

Prasyarat

Instalasi & Penggunaan

Via npx (recommended)

BPS_API_KEY=your_key npx bps-mcp-server

Clone & Run

git clone https://github.com/murphi/bps-mcp-server
cd bps-mcp-server
npm install
npm run build
BPS_API_KEY=your_key npm start

Akses Remote via Cloudflare Workers

Server ini tersedia secara publik di:

https://bps-mcp-server.murphi.my.id/mcp

Tambahkan ke MCP client manapun (Claude Desktop, Cursor, dll.) via remote transport:

{
  "mcpServers": {
    "bps-statistics": {
      "type": "http",
      "url": "https://bps-mcp-server.murphi.my.id/mcp",
      "headers": {
        "X-BPS-API-Key": "your_api_key_here"
      }
    }
  }
}

Self-hosted

Ingin deploy sendiri? Deploy sebagai serverless worker di akun Cloudflare kamu:

Deploy to Cloudflare Workers

Lihat panduan lengkap di docs/DEPLOY-WORKERS.md.

Konfigurasi MCP Client

Claude Desktop

File: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)

{
  "mcpServers": {
    "bps-statistics": {
      "command": "npx",
      "args": ["-y", "bps-mcp-server"],
      "env": {
        "BPS_API_KEY": "your_api_key_here"
      }
    }
  }
}

Claude Code

claude mcp add bps -- npx -y bps-mcp-server

Atau file .mcp.json di project root:

{
  "mcpServers": {
    "bps": {
      "command": "npx",
      "args": ["-y", "bps-mcp-server"],
      "env": {
        "BPS_API_KEY": "${BPS_API_KEY}"
      }
    }
  }
}

Cursor / VS Code

File ~/.cursor/mcp.json atau .vscode/mcp.json:

{
  "mcpServers": {
    "bps-statistics": {
      "command": "npx",
      "args": ["-y", "bps-mcp-server"],
      "env": {
        "BPS_API_KEY": "your_api_key_here"
      }
    }
  }
}

Tools (32)

ToolDeskripsi
list_domainsDaftar wilayah (provinsi, kab/kota)
resolve_domainKonversi nama wilayah → kode domain (fuzzy matching)
list_subjectsDaftar subjek data statistik
list_subject_categoriesKategori subjek
list_variablesDaftar variabel tabel dinamis
list_vertical_variablesVariabel vertikal (disagregasi)
list_derived_variablesTurunan variabel
list_periodsPeriode data tersedia
list_derived_periodsTurunan periode
list_unitsSatuan data
get_dynamic_dataCore — Ambil data tabel dinamis
list_static_tablesDaftar tabel statis
get_static_tableDetail tabel statis (HTML)
list_press_releasesDaftar Berita Resmi Statistik (BRS)
get_press_releaseDetail BRS
list_publicationsDaftar publikasi
get_publicationDetail publikasi
list_strategic_indicatorsIndikator strategis
get_trade_dataData ekspor/impor berdasarkan kode HS
list_infographicsDaftar infografis BPS
get_infographicDetail infografis
list_newsDaftar berita BPS
get_newsDetail berita
list_census_eventsDaftar kegiatan sensus
list_census_topicsTopik data per kegiatan sensus
list_csa_categoriesKategori CSA
list_csa_subjectsSubjek CSA per domain
list_csa_tablesTabel CSA per subjek
get_csa_tableDetail tabel CSA (HTML)
list_glossaryGlosarium istilah statistik
searchPencarian lintas tipe
cache_clearBersihkan cache

Resources (3)

URIDeskripsi
bps://domains/provincesDaftar seluruh provinsi Indonesia (cached)
bps://domains/regencies/{prov_id}Kabupaten/kota per provinsi
bps://subjects/{domain}Subjek statistik per domain

Prompts (5)

PromptDeskripsi
compare_regionsBandingkan data antara dua wilayah
trend_analysisAnalisis tren data multi-tahun
poverty_profileProfil kemiskinan suatu wilayah
economic_overviewRingkasan ekonomi wilayah
population_statsStatistik kependudukan

Contoh Query

"Berapa jumlah penduduk Indonesia tahun 2023?"
"Bandingkan angka kemiskinan Jawa Timur vs Jawa Barat 2020-2023"
"Cari BRS terbaru tentang inflasi"
"Data ekspor kopi Indonesia tahun 2024"

Environment Variables

VariableDefaultDeskripsi
BPS_API_KEY(required)API key dari webapi.bps.go.id
BPS_API_BASE_URLhttps://webapi.bps.go.id/v1Base URL API
BPS_DEFAULT_LANGindBahasa default: ind / eng
BPS_DEFAULT_DOMAIN0000Domain default (0000 = Nasional)
BPS_CACHE_ENABLEDtrueAktifkan cache
BPS_CACHE_MAX_ENTRIES500Maks entri cache
BPS_LOG_LEVELinfoLevel log: debug/info/warn/error

Development

git clone https://github.com/murphi/bps-mcp-server
cd bps-mcp-server
npm install
npm run build
npm run test:unit

Atribusi

Sumber: Badan Pusat Statistik (BPS) — https://www.bps.go.id Layanan ini menggunakan API Badan Pusat Statistik (BPS).

Lisensi

MIT

Reviews

No reviews yet

Sign in to write a review