Skip to main content
Glama

nusa-mcp

MCP server tidak resmi untuk data publik Indonesia: kode wilayah, gempa dan cuaca BMKG, statistik BPS. Dengan atribusi sumber di setiap hasil.

CI License: MIT Node >=20 MCP

Bahasa Indonesia | English

Proyek komunitas, tidak berafiliasi dengan BMKG, BPS, Bank Indonesia, Kemendagri, atau lembaga pemerintah mana pun. Akurasi data adalah tanggung jawab sumbernya. Status: 0.1.0-rc.1 (release candidate), belum ada di npm.

Daftar isi

Related MCP server: bps-webapi-mcp

Fitur

  • 10 alat berbasis niat, bukan satu alat per endpoint. Nama konsisten nusa_*, semua read-only, punya outputSchema dan structuredContent.

  • Atribusi dan jejak sumber di setiap hasil: source, sourceUrl, attribution, retrievedAt, dataAsOf, cache (hit|miss|stale), warnings. Data resmi hanya dibentuk ulang, tidak diubah atau diisi.

  • Lapisan wilayah offline: 91.599 baris Kepmendagri 2025 (provinsi sampai desa/kelurahan), alias ("Jogja", "jateng", "Solo"), nama ganda ditandai ambiguous.

  • Gagal dengan jujur: not_found, upstream_unavailable, rate_limited, requires_api_key, upstream_schema_changed, data usang diberi tanda stale.

  • Aman secara bawaan: daftar host tetap (tanpa SSRF), teks dari upstream dibersihkan, HTTP hanya 127.0.0.1 dengan validasi Host/Origin, tanpa data pribadi, tanpa scraping.

  • Tangguh: cache per sumber, single-flight, stale-if-error, retry dengan jitter, rate limiter, circuit breaker.

  • Teruji: 117 tes offline, tes konformansi MCP lewat klien resmi, 25 kasus evaluasi, tes kontrak langsung (tidak memblokir).

Server sejenis sudah ada. Perbandingan jujur ada di docs/COMPETITIVE-ANALYSIS.md. Fokus proyek ini: kepatuhan, atribusi, dan satu lapisan wilayah yang dipakai semua alat.

Mulai cepat

Butuh Node.js 20 atau lebih baru. Paket belum dipublikasikan ke npm, jalankan dari sumber:

git clone https://github.com/JackBerck/nusa-mcp.git
cd nusa-mcp
npm ci && npm run build
node dist/index.js        # transport stdio

Tanpa konfigurasi apa pun, alat wilayah dan BMKG langsung bisa dipakai. Alat BPS butuh kunci gratis (lihat BPS).

Konfigurasi klien MCP

Ganti path dengan lokasi dist/index.js Anda.

claude mcp add nusa -- node /path/ke/nusa-mcp/dist/index.js

Windows:

{
  "mcpServers": {
    "nusa": { "command": "node", "args": ["D:\\Code\\nusa-mcp\\dist\\index.js"] }
  }
}

macOS / Linux:

{
  "mcpServers": {
    "nusa": { "command": "node", "args": ["/home/saya/nusa-mcp/dist/index.js"] }
  }
}
{ "mcpServers": { "nusa": { "command": "node", "args": ["/path/ke/nusa-mcp/dist/index.js"] } } }
{
  "servers": {
    "nusa": { "type": "stdio", "command": "node", "args": ["/path/ke/nusa-mcp/dist/index.js"] }
  }
}

Kunci BPS

Daftar gratis di https://webapi.bps.go.id/developer/, lalu isi sebagai variabel lingkungan server (jangan ditempel ke chat):

{
  "mcpServers": {
    "nusa": { "command": "node", "args": ["..."], "env": { "BPS_API_KEY": "kunci-anda" } }
  }
}

Tanpa kunci, nusa_stats_* mengembalikan requires_api_key beserta petunjuk pendaftaran, tidak error.

Alat (10)

Alat

Fungsi

nusa_region_search

Cari wilayah berdasarkan nama (fuzzy, alias, singkatan Kab./Kec.), kode resmi, hierarki, confidence, ambiguous

nusa_region_get

Satu wilayah menurut kode (path, titik pusat provinsi/kabupaten, zona WIB/WITA/WIT)

nusa_region_children

Anak wilayah, bisa langsung ke level lebih dalam, dengan cursor

nusa_earthquake_latest

Gempa terbaru, M5.0+, atau dirasakan (BMKG)

nusa_earthquake_nearby

Gempa dalam radius dari koordinat (turunan lokal, ditandai derived)

nusa_weather_forecast

Prakiraan 3 hari per desa/kelurahan dari nama tempat atau kode wilayah

nusa_weather_warnings

Peringatan dini cuaca (nowcast CAP), filter provinsi atau kode

nusa_stats_search

Cari indikator, variabel, tabel, publikasi, rilis BPS

nusa_stats_get

Ambil nilai variabel BPS dengan label, satuan, periode

nusa_sources

Status sumber, kata atribusi, catatan ketentuan, status kunci

Skema, contoh panggilan, dan satuan: docs/TOOLS.md.

Contoh percakapan

Ada gempa hari ini dekat Cilacap? Agen memanggil nusa_region_search("Cilacap") lalu nusa_earthquake_nearby(lat, lon, 300). Jawaban menyebut "Sumber: BMKG" dan bahwa hasil berasal dari daftar terbaru BMKG, bukan katalog penuh.

Cuaca Purwokerto Timur 3 hari? nusa_weather_forecast(place="Purwokerto Timur"). BMKG hanya punya prakiraan per desa, jadi alat memakai satu desa perwakilan kecamatan dan menjelaskannya di warnings.

Kecamatan apa saja di Kabupaten Purbalingga? nusa_region_search lalu nusa_region_children(code="33.03") menghasilkan 18 kecamatan.

Berapa inflasi terakhir? nusa_stats_search(query="inflasi") (butuh kunci BPS), jawaban menyertakan periode dan satuan.

Resource dan prompt

Resource: nusa://glossary (istilah dan satuan), nusa://sources (katalog sumber), nusa://regions/summary (versi dataset, 38 provinsi). Prompt: earthquake_situation_brief, regional_weather_brief, statistics_lookup.

Variabel lingkungan

Semua opsional. Contoh lengkap: .env.example.

Variabel

Default

Keterangan

BPS_API_KEY

kosong

Kunci BPS, mengaktifkan nusa_stats_*

NUSA_DISABLE_PROVIDERS

kosong

Daftar dipisah koma: bmkg,bps

NUSA_CONTACT

kosong

Email atau URL yang ditambahkan ke User-Agent

NUSA_HTTP_TIMEOUT_MS

10000

Batas waktu permintaan upstream

NUSA_MAX_RESPONSE_BYTES

5000000

Batas ukuran respons upstream

NUSA_LOG_LEVEL

info

silent, error, warn, info, debug (log ke stderr)

NUSA_TRANSPORT

stdio

stdio atau http (juga flag --http)

NUSA_HTTP_HOST / NUSA_HTTP_PORT

127.0.0.1 / 3000

Alamat bind mode HTTP

NUSA_HTTP_API_KEY

kosong

Bearer token, wajib jika bind bukan loopback

NUSA_HTTP_ALLOWED_HOSTS / NUSA_HTTP_ALLOWED_ORIGINS

kosong

Daftar Host/Origin yang diizinkan

NUSA_HTTP_RATE_PER_MIN

120

Batas permintaan per alamat klien

Mode HTTP

NUSA_TRANSPORT=http node dist/index.js
# POST http://127.0.0.1:3000/mcp   (stateless Streamable HTTP, tanpa SSE)
# GET  /healthz  /readyz

Bind selain loopback ditolak kecuali NUSA_HTTP_API_KEY (min. 16 karakter) dan NUSA_HTTP_ALLOWED_HOSTS diisi. Server berbicara HTTP biasa: pasang TLS lewat reverse proxy. Model keamanan lengkap: docs/SECURITY-MODEL.md.

Batasan dan kepatuhan

  • Izin BMKG. Ketentuan BMKG (diperbarui 8 Juli 2026) mewajibkan izin tertulis untuk pengemasan ulang, integrasi ke aplikasi pihak ketiga, dan penggunaan komersial. Proyek ini dirancang untuk dijalankan lokal oleh pengguna sendiri dan tidak menyediakan layanan terhosting. Detail: docs/DATA-SOURCES.md.

  • Prakiraan BMKG hanya per desa/kelurahan. Masukan koordinat tidak didukung karena dataset terbuka tidak punya titik desa.

  • Daftar gempa BMKG hanya jendela terbaru, bukan katalog sejarah.

  • Alat BPS baru diuji dengan fixture sintetis dari contoh OpenAPI resmi BPS. Verifikasi dengan kunci asli belum dilakukan.

  • Kode wilayah berasal dari dump SQL MIT pihak ketiga (cahyadsn/wilayah); lisensi redistribusi datanya dan kesesuaiannya dengan lampiran resmi belum diverifikasi (docs/REGION-DATA.md).

  • Tidak ada data pribadi, tidak ada scraping, tidak ada akses di balik login atau CAPTCHA.

Pengembangan

npm ci
npm run check        # typecheck, lint, format, tes offline
npm run test:live    # kontrak langsung ke BMKG (BPS jika BPS_API_KEY ada), tidak memblokir
npm run bench        # benchmark offline

Dokumen: ARCHITECTURE, RELIABILITY, REGION-DATA, ADDING-A-PROVIDER, EVALUATION, BENCHMARK, CONTRIBUTING, CHANGELOG, SECURITY.

Atribusi dan lisensi

  • Wilayah: Kepmendagri No. 300.2.2-2430 Tahun 2025 (dibangun dari cahyadsn/wilayah, MIT).

  • Cuaca dan gempa: Sumber: BMKG.

  • Statistik: This service uses the Badan Pusat Statistik (BPS) API.

Kode: MIT. Lisensi ini tidak berlaku untuk data sumber, yang tunduk pada ketentuan penerbitnya.

Available Tools

10 tools
nusa_earthquake_latestLatest earthquakes from BMKGA
Read-onlyIdempotent

Gempa bumi from BMKG: the single latest event, the recent M5.0+ list, or the recent felt (dirasakan) list. Lists are short recent windows, not a historical catalog.

Inputs: kind, lang, limit. Returns: data, cache, source, derived, +7 more

nusa_earthquake_nearbyEarthquakes near a point (derived)A
Read-onlyIdempotent

Gempa within a radius of a coordinate, computed locally (haversine) from the BMKG latest, M5+ and felt lists. Derived result: those lists are short recent windows, so an empty result does not prove no earthquake occurred.

Inputs: lat (required), lon (required), lang, limit, +2 more. Returns: data, cache, source, derived, +7 more

nusa_region_childrenList sub-regions of a regionA
Read-onlyIdempotent

Lists child wilayah of a region code (e.g. kecamatan of a kabupaten). Use level to jump several levels down (e.g. all desa of a kabupaten). Paginated with limit and cursor.

Inputs: code (required), lang, level, limit, +1 more. Returns: data, cache, source, derived, +7 more

nusa_region_getGet one administrative region by codeA
Read-onlyIdempotent

Returns one wilayah by its official Kemendagri code, with hierarchy path, centroid (province/regency only) and time zone (WIB/WITA/WIT).

Inputs: code (required), lang. Returns: data, cache, source, derived, +7 more

nusa_sourcesList data sources and statusA
Read-onlyIdempotent

Lists the data sources behind this server (BMKG, BPS, region codes) with health status, required attribution wording and terms notes. Use it to cite sources correctly or to check whether a source is up.

Inputs: lang. Returns: data, cache, source, derived, +7 more

nusa_stats_getGet a BPS dynamic-table variableA
Read-onlyIdempotent

Fetch values of one BPS dynamic-table variable (var id from nusa_stats_search type=variable) for a domain, with units, labels and periods. Without period it uses the most recent period BPS lists. Requires a free BPS API key.

Inputs: variable_id (required), lang, limit, domain, +2 more. Returns: data, cache, source, derived, +7 more

nusa_weather_forecastWeather forecast for a placeA
Read-onlyIdempotent

Prakiraan cuaca (3-day, 3-hourly) from BMKG for a place name or a Kemendagri region code. BMKG forecasts exist per desa/kelurahan; a kecamatan name is approximated by one of its villages and flagged. Coordinates are not supported because the open dataset has no village centroids.

Inputs: days, lang, place, region_code. Returns: data, cache, source, derived, +7 more

nusa_weather_warningsActive weather warnings (nowcast)A
Read-onlyIdempotent

Peringatan dini cuaca (nowcast, CAP) from BMKG, optionally filtered by province or a Kemendagri region code. Matching below province level is by kecamatan name found in the alert text.

Inputs: lang, limit, province, region_code. Returns: data, cache, source, derived, +7 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: region_search (name→code), region_get (code→detail), and region_children (hierarchy traversal) form an unambiguous trio, and the BMKG/BPS pairs (latest vs nearby, forecast vs warnings, stats_search vs stats_get) are each separated by an explicit qualifier in the description. nusa_sources is a server-level utility that cannot be confused with any data tool.

    Naming Consistency4/5

    All tools follow a predictable nusa_<domain>_<action/noun> pattern (region_search, weather_forecast, stats_get), which makes the domain groupings obvious. The only deviation is nusa_sources, which drops the domain segment, and earthquake_latest/nearby use adjectives rather than verbs—minor and still readable.

    Tool Count5/5

    Ten tools is well-scoped for a three-source data server: three for regions, two for earthquakes, two for weather, two for BPS stats, and one for source metadata. No tool appears redundant or padded, and each maps to a concrete lookup the agent needs.

    Completeness4/5

    Region hierarchy (search/get/children), weather forecast plus warnings, and BPS search/get cover the core lifecycle for each source, with nusa_sources closing the attribution loop. The main gap is the absence of a reverse geocode (coordinates→region code) or historical earthquake catalog, which leaves earthquake_nearby as a dead-end derived result that cannot be followed up on.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      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.
      34
      412 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables access to a wide range of Indonesian public data and services without requiring accounts or API keys, including weather, earthquakes, addresses, postal codes, news, prayer schedules, Quran, gold prices, and more.
      MIT