BPS MCP Server
Supports deployment as a serverless worker on Cloudflare Workers, allowing public remote access to the BPS statistical data service via HTTP transport.
Enables self-hosting of the BPS MCP server as a Cloudflare Worker, providing serverless deployment with remote access capabilities for statistical data queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BPS MCP ServerBerapa jumlah penduduk Indonesia tahun 2023?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BPS MCP Server
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
34 tools mencakup seluruh endpoint BPS WebAPI v1 + AllStats Search
Integrasi AllStats Search — pencarian unified + full-text PDF search (tanpa API key)
Smart fallback — WebAPI search otomatis fallback ke AllStats jika tidak ada hasil
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
Node.js ≥ 18
API key BPS (gratis, daftar di webapi.bps.go.id)
Instalasi & Penggunaan
Via npx (recommended)
BPS_API_KEY=your_key npx bps-mcp-serverClone & 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 startAkses Remote via Cloudflare Workers
Server ini tersedia secara publik di:
https://bps-mcp-server.murphi.my.id/mcpTambahkan 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:
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-serverAtau 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 (34)
WebAPI Tools (32)
Tool | Deskripsi |
| Daftar wilayah (provinsi, kab/kota) |
| Konversi nama wilayah → kode domain (fuzzy matching) |
| Daftar subjek data statistik |
| Kategori subjek |
| Daftar variabel tabel dinamis |
| Variabel vertikal (disagregasi) |
| Turunan variabel |
| Periode data tersedia |
| Turunan periode |
| Satuan data |
| Core — Ambil data tabel dinamis |
| Daftar tabel statis |
| Detail tabel statis (HTML) |
| Daftar Berita Resmi Statistik (BRS) |
| Detail BRS |
| Daftar publikasi |
| Detail publikasi |
| Indikator strategis |
| Data ekspor/impor berdasarkan kode HS |
| Daftar infografis BPS |
| Detail infografis |
| Daftar berita BPS |
| Detail berita |
| Daftar kegiatan sensus |
| Topik data per kegiatan sensus |
| Kategori CSA |
| Subjek CSA per domain |
| Tabel CSA per subjek |
| Detail tabel CSA (HTML) |
| Glosarium istilah statistik |
| Pencarian lintas tipe (WebAPI + AllStats fallback) |
| Bersihkan cache |
AllStats Search Tools (2)
Tool | Deskripsi |
| Pencarian unified semua konten BPS (publikasi, tabel, BRS, infografis, data mikro, glosarium, klasifikasi) |
| Full-text search di dalam isi PDF publikasi BPS — fitur unik, tidak tersedia di WebAPI |
Integrasi AllStats Search
Server ini mengintegrasikan dua sumber data yang saling melengkapi:
┌─────────────────────────────────────────────────────────┐
│ BPS MCP Server │
│ │
│ ┌──────────────────┐ ┌────────────────────────┐ │
│ │ WebAPI BPS │ │ AllStats Search │ │
│ │ (Primary) │ │ (Supplementary) │ │
│ │ │ │ │ │
│ │ + Structured │ │ + Full-text PDF search │ │
│ │ data (JSON) │ │ + Unified search │ │
│ │ + Dynamic tables │ │ semua tipe konten │ │
│ │ + Ekspor/Impor │ │ + Tanpa API key │ │
│ │ + Sensus data │ │ + Filter wilayah 550+ │ │
│ │ - No PDF search │ │ - HTML scraping │ │
│ └──────────────────┘ └────────────────────────┘ │
│ │
│ Strategi interaksi: │
│ 1. search → WebAPI dulu, fallback AllStats jika kosong │
│ 2. allstats_search → langsung ke AllStats Search │
│ 3. allstats_deep_search → cari teks di dalam PDF │
└─────────────────────────────────────────────────────────┘Cara Kerja
search (smart fallback)
Prioritas: WebAPI BPS (structured JSON)
Jika WebAPI mengembalikan hasil kosong atau error, otomatis fallback ke AllStats Search
User mendapat notifikasi sumber data yang digunakan
allstats_search (unified discovery)
Langsung query ke
searchengine.web.bps.go.idMendukung filter: tipe konten, wilayah, rentang tahun, urutan
Tidak memerlukan API key BPS
Cocok untuk discovery atau pencarian broad
allstats_deep_search (PDF full-text)
Cari teks di dalam isi PDF publikasi BPS
Memerlukan
publication_id(24 karakter hex) dari hasilallstats_searchMengembalikan halaman PDF yang cocok beserta cuplikan teks
Fitur unik yang tidak tersedia di WebAPI
Workflow Contoh
1. Discovery → Deep Search:
allstats_search("akses internet", content="publication")
→ dapat publication_id
→ allstats_deep_search("akses internet", publication_id="131385d0253c6aae7c7a59fa")
→ halaman PDF yang membahas "akses internet"
2. Smart fallback:
search(keyword="kemiskinan Papua")
→ WebAPI kosong → otomatis cari via AllStats
→ hasil dari AllStats ditampilkan dengan catatan fallback
3. Parallel enrichment (oleh AI):
- get_dynamic_data → data angka terstruktur
- allstats_search("inflasi", content="pressrelease") → BRS terbaru
→ AI menggabungkan data angka + konteks dari BRSResources (3)
URI | Deskripsi |
| Daftar seluruh provinsi Indonesia (cached) |
| Kabupaten/kota per provinsi |
| Subjek statistik per domain |
Prompts (5)
Prompt | Deskripsi |
| Bandingkan data antara dua wilayah |
| Analisis tren data multi-tahun |
| Profil kemiskinan suatu wilayah |
| Ringkasan ekonomi wilayah |
| Statistik 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"
"Cari publikasi tentang statistik telekomunikasi"
"Cari teks tentang akses internet di dalam publikasi BPS"Environment Variables
Variable | Default | Deskripsi |
| (required) | API key dari webapi.bps.go.id |
|
| Base URL API |
|
| Bahasa default: |
|
| Domain default (0000 = Nasional) |
|
| Aktifkan cache |
|
| Maks entri cache |
|
| Level 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:unitAtribusi
Sumber: Badan Pusat Statistik (BPS) — https://www.bps.go.id Layanan ini menggunakan API Badan Pusat Statistik (BPS).
Lisensi
MIT
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/setiapam/bps-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server