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.
README
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
- 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
- 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-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:
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)
| Tool | Deskripsi |
|---|---|
list_domains |
Daftar wilayah (provinsi, kab/kota) |
resolve_domain |
Konversi nama wilayah → kode domain (fuzzy matching) |
list_subjects |
Daftar subjek data statistik |
list_subject_categories |
Kategori subjek |
list_variables |
Daftar variabel tabel dinamis |
list_vertical_variables |
Variabel vertikal (disagregasi) |
list_derived_variables |
Turunan variabel |
list_periods |
Periode data tersedia |
list_derived_periods |
Turunan periode |
list_units |
Satuan data |
get_dynamic_data |
Core — Ambil data tabel dinamis |
list_static_tables |
Daftar tabel statis |
get_static_table |
Detail tabel statis (HTML) |
list_press_releases |
Daftar Berita Resmi Statistik (BRS) |
get_press_release |
Detail BRS |
list_publications |
Daftar publikasi |
get_publication |
Detail publikasi |
list_strategic_indicators |
Indikator strategis |
get_trade_data |
Data ekspor/impor berdasarkan kode HS |
list_infographics |
Daftar infografis BPS |
get_infographic |
Detail infografis |
list_news |
Daftar berita BPS |
get_news |
Detail berita |
list_census_events |
Daftar kegiatan sensus |
list_census_topics |
Topik data per kegiatan sensus |
list_csa_categories |
Kategori CSA |
list_csa_subjects |
Subjek CSA per domain |
list_csa_tables |
Tabel CSA per subjek |
get_csa_table |
Detail tabel CSA (HTML) |
list_glossary |
Glosarium istilah statistik |
search |
Pencarian lintas tipe |
cache_clear |
Bersihkan cache |
Resources (3)
| URI | Deskripsi |
|---|---|
bps://domains/provinces |
Daftar seluruh provinsi Indonesia (cached) |
bps://domains/regencies/{prov_id} |
Kabupaten/kota per provinsi |
bps://subjects/{domain} |
Subjek statistik per domain |
Prompts (5)
| Prompt | Deskripsi |
|---|---|
compare_regions |
Bandingkan data antara dua wilayah |
trend_analysis |
Analisis tren data multi-tahun |
poverty_profile |
Profil kemiskinan suatu wilayah |
economic_overview |
Ringkasan ekonomi wilayah |
population_stats |
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"
Environment Variables
| Variable | Default | Deskripsi |
|---|---|---|
BPS_API_KEY |
(required) | API key dari webapi.bps.go.id |
BPS_API_BASE_URL |
https://webapi.bps.go.id/v1 |
Base URL API |
BPS_DEFAULT_LANG |
ind |
Bahasa default: ind / eng |
BPS_DEFAULT_DOMAIN |
0000 |
Domain default (0000 = Nasional) |
BPS_CACHE_ENABLED |
true |
Aktifkan cache |
BPS_CACHE_MAX_ENTRIES |
500 |
Maks entri cache |
BPS_LOG_LEVEL |
info |
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:unit
Atribusi
Sumber: Badan Pusat Statistik (BPS) — https://www.bps.go.id Layanan ini menggunakan API Badan Pusat Statistik (BPS).
Lisensi
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。