Indonesia Civic Stack

io.github.suryast由 GitHub 账号 suryast 发布v0.1.1更新于 Oct 27, 2026

40 MCP tools for 11 Indonesian government portals — BPOM, BPJPH, AHU, OJK, BMKG+

发布方自己的服务:Nexus

概览

AI 生成的概览

本地 MCP 服务器,提供约 45 个工具,用于查询印尼政府门户的产品、清真认证、企业、金融、选举、统计与气象数据。

可以做什么
  • 查询产品注册(BPOM)与清真认证(BPJPH),并可交叉比对两者
  • 查询企业登记、董事与状态(AHU)、营业识别号(OSS NIB)及建筑许可(SIMBG)
  • 检索 OJK 机构与警示名单、LPSE 供应商与招标、KSEI 证券页面
  • 获取选举候选人、2024 年选举结果与竞选资金(KPU),以及官员财产申报(LHKPN)
  • 获取 BPS 统计数据与地区、BMKG 地震与天气、法规(JDIH)及预算主题(DJPB)
适用场景
适合公民科技、尽职调查或研究工作,需要印尼公共部门记录时使用,例如核实产品与清真认证、查企业或供应商、获取官方统计、选举与灾害数据,且由用户本机的助手调用。
运行要求
以 Python 包形式本地运行,需安装 mcp 附加组件;依赖浏览器的模块(AHU、OSS NIB、JDIH、LHKPN 搜索、OJK 完整列表)还需 Playwright 与 Camoufox 二进制文件。统计工具需要 BPS_API_KEY。在印尼境外访问门户可能需要 PROXY_URL。不提供托管服务器。
安装前请注意
数据来自抓取,可能过期或失效:ERROR 或空结果不能证明记录不存在,查到注册也不构成安全或法律保证。配置的代理运营方可以控制服务器收到的响应。自带 REST 应用没有 API 密钥认证或限流,应仅绑定本机回环地址。可选的扫描 PDF 回退会把文档发送到外部 API,可能产生费用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Indonesia Civic Stack,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🇮🇩 indonesia-civic-stack

[PyPI] [MCP Registry] [CI] [Python] [License]

Python SDK, MCP tools, and REST wrappers for Indonesian public-sector data. Release 1.2.1 includes 14 scraper modules, 45 unified MCP tools, and 11 REST module routers. These counts describe code, not live availability.

Indonesian public-data portals expose different APIs, HTML structures, browser requirements, and access restrictions. This project provides a shared response schema and reusable clients rather than requiring every civic-tech app to build its own integration. Portal changes can still break individual operations; verify the response and its provenance before drawing conclusions.

Module inventory and maturity

Each row has a scraper, normalizer, and module test file. “Tests present” means mocked/replayed tests exist, not that they establish current portal liveness. The MCP column counts decorators in the unified civic_stack/server.py.

ModuleSource configured in codeData / methodMCP toolsRESTTests present
bpomcekbpom.pom.go.idProduct registration; HTTP HTML3YesYes
bpjphcmsbl.halal.go.idHalal certificates; HTTP REST4YesYes
ahuahu.go.idCompany registry; browser helper4YesYes
ojkwww.ojk.go.id / sikapiuangmu.ojk.go.idInstitutions and alerts; HTTP + optional browser list4YesYes
oss_niboss.go.idNIB identity; Playwright3YesYes
lpsespse.inaproc.id and configured portalsVendors/tenders; multi-portal HTTP4YesYes
kpuinfopemilu.kpu.go.id / sirekap-obj-data.kpu.go.idCandidates and 2024 elections; HTTP JSON4YesYes
lhkpnelhkpn.kpk.go.idWealth declarations; Playwright search, HTTP PDFs3YesYes
bpswebapi.bps.go.idStatistics; HTTP API, requires BPS_API_KEY3YesYes
bmkgdata.bmkg.go.idEarthquakes/weather; HTTP JSON/XML4YesYes
simbgsimbg.pu.go.id and pilot portalsPermits; multi-portal HTTP3YesYes
jdihperaturan.go.idRegulations; Playwright recent-list filtering2NoYes
kseiweb.ksei.co.idSecurities and statistics links; HTTP HTML2NoYes
djpbdata-apbn.kemenkeu.go.idBudget themes; HTTP JSON2NoYes

JDIH, KSEI, and DJPB are available through the SDK and unified MCP server, but have no individual MCP server or REST router. JDIH search checks up to 50 recent listing links; KSEI securities fetch/search only inspect page 1. Neither is a complete registry search. LHKPN's browser search implementation does not prove that reCAPTCHA or the upstream portal works in your deployment.

Current portal liveness is unverified here. Historical March/April 2026 observations in endpoint status and geo-restrictions are troubleshooting context, not present-day health evidence. An HTTP 200 homepage, local /health, or passing mock/VCR test is not a successful live registry lookup.

Install

bash
pip install indonesia-civic-stack             # Core HTTP SDKpip install "indonesia-civic-stack[mcp]"       # + unified MCP serverpip install "indonesia-civic-stack[api]"       # + FastAPI and uvicornpip install "indonesia-civic-stack[browser]"   # + Playwright and Camoufoxpip install "indonesia-civic-stack[all]"       # mcp + api + browser

Browser-backed operations also need binaries:

bash
playwright install chromiumpython -m camoufox fetch  # AHU Camoufox path

AHU, OSS NIB, JDIH, LHKPN search, and OJK's full-list helper use browser paths. BPJPH's current scraper uses HTTP REST. all does not download browser binaries or include LHKPN's optional PDF packages. Install pdfplumber directly for PDF text extraction; the optional scanned-document fallback needs anthropic and ANTHROPIC_API_KEY, sends the document to an external API, and may incur cost. There are no pdf or playwright extras. SOCKS HTTP transport additionally requires pip install "httpx[socks]".

Python SDK

python
import asynciofrom civic_stack.bpom.scraper import search
async def main():    try:        async with asyncio.timeout(120):            records = await search("paracetamol")    except Exception as exc:        print("Could not verify:", type(exc).__name__)        return    if not records:        print("No records returned; acquisition may be unverified")    for record in records:        print(record.status, record.found, record.source_url, record.fetched_at)        if record.status == "ERROR":            print("Could not verify:", record.result)        elif record.found:            print(record.result)  # Check identity, period, and domain-specific status        else:            print("No match reported within the query scope; not proof of absence")
asyncio.run(main())

Every scraper has fetch() and search(), with module-specific signatures. Specialized helpers include BMKG's get_latest_earthquake, KPU's get_election_results, OJK's check_waspada, KSEI's get_statistics_links, and DJPB's get_budget_summary. See usage and limitations for actual return shapes, scope limits, and unified-tool wrapper caveats.

Response interpretation

Core lookups return CivicStackResponse or lists of envelopes:

json
{  "result": {"product_name": "Example", "registration_status": "ACTIVE"},  "found": true,  "status": "ACTIVE",  "confidence": 1.0,  "source_url": "https://cekbpom.pom.go.id/example",  "fetched_at": "2026-03-14T06:30:00Z",  "last_updated": null,  "module": "bpom",  "raw": null}

This is illustrative, not a live response. Status values are ACTIVE, EXPIRED, SUSPENDED, REVOKED, NOT_FOUND, and ERROR. Error details are under result.detail, not a top-level detail. Some helpers return raw lists/dicts, PDF extraction data, or URLs instead of envelopes; status shortcut MCP tools omit source and timestamp. Do not assume every tool has the full schema.

Check status, found, source_url, and fetched_at before reading result. Retrieval time is not publication time; verify the source's reporting period. ERROR is not NOT_FOUND. Current paths in several modules also collapse network/browser failures into NOT_FOUND or []. Consequently, an empty or not-found result alone cannot prove acquisition succeeded or that the record does not exist. BPS fetch() can raise for a missing key; other callers can also encounter unexpected exceptions. Catch exceptions at the caller boundary.

A found registration is not a general safety/legal guarantee. An alert-list match is a warning, not an endorsement. Partial multi-portal results and scraper confidence values must not be presented as exhaustive or authoritative checks.

Unified MCP server

bash
civic-stack-mcp                   # stdio, 45 toolspython -m civic_stack.server      # packaged equivalentcivic-stack mcp                   # CLI stdio entry pointpython -m civic_stack.server --transport http --host 127.0.0.1 --port 8000
# Individual module server (where present):python -m civic_stack.bpom.server

For local clients, configure civic-stack-mcp as the command. The repository's .mcp.json uses .venv/bin/python -m civic_stack.server; create that virtual environment and install [mcp] before discovery. Discovery does not install dependencies or ensure portals respond. There is no shared hosted server.

Unified MCP tool inventory

ModuleRegistered tool names
bpomcheck_bpom, search_bpom, get_bpom_status
bpjphcheck_halal_cert, lookup_halal_by_product, get_halal_status, cross_reference_halal_bpom
ahulookup_company_ahu, get_company_directors, verify_company_status, search_companies_ahu
ojkcheck_ojk_license, search_ojk_institutions, get_ojk_status, check_ojk_waspada
oss_niblookup_nib, verify_nib, search_oss_businesses
lpselookup_vendor_lpse, search_lpse_vendors, search_lpse_tenders, get_lpse_portals
kpuget_candidate, search_kpu_candidates, get_election_results_kpu, get_campaign_finance_kpu
lhkpnget_lhkpn, search_lhkpn, get_lhkpn_pdf
bpssearch_bps_datasets, get_bps_indicator, list_bps_regions
bmkgget_bmkg_alerts, get_weather_forecast, get_earthquake_history, get_latest_earthquake
simbglookup_building_permit, search_permits_by_area, list_simbg_portals
jdihsearch_jdih, get_jdih
kseisearch_ksei, get_ksei
djpbsearch_djpb, get_djpb

These are 45 registered names, not 45 independently validated operations. Some wrappers call generic scraper functions rather than the specialized helper suggested by the tool name; read wrapper caveats before using election-results, campaign-finance, tender, alert-list, or portal-list tools.

Verify registration offline, without calling tools:

bash
python -c 'import asyncio; from civic_stack.server import mcp; print(len(asyncio.run(mcp.list_tools())))'

REST API

bash
civic-stack api --host 127.0.0.1 --port 8000uvicorn civic_stack.app:app --host 127.0.0.1 --port 8000uvicorn civic_stack.bpom.app:app --host 127.0.0.1 --port 8001

The unified app mounts 11 routers. JDIH, KSEI, and DJPB have no REST routes. Open /docs or /openapi.json for the actual route signatures. Examples:

text
GET /bpom/search?q=paracetamolGET /bpjph/search?q=kopiGET /ahu/search?q=ContohGET /ojk/check/Bank%20BCAGET /kpu/search?q=ContohGET /lhkpn/search?q=ContohGET /bps/search?q=inflasiGET /bmkg/forecast/JakartaGET /bmkg/earthquake/latestGET /simbg/search?q=Jakarta

/health only describes the local app; it does not probe upstream portals.

Deployment and security

civic_client() reads PROXY_URL, with environment-based PROXY_MODE=connect or rewrite selection. A *.workers.dev URL auto-selects rewriting. Browser proxy handling is separate: a Worker rewrite URL is not a standard Chromium proxy, AHU and OSS-NIB fall back to PROXY_URL only in CONNECT mode, JDIH uses its explicit proxy argument, and LHKPN search does not forward its proxy_url argument to its browser. Do not assume setting an environment variable proxies every operation. See usage.

Whoever runs a proxy controls the portal responses the server receives. The REST routers and the standalone AHU/OSS-NIB MCP servers therefore accept a caller-supplied proxy_url only when it exactly matches PROXY_URL or an entry in CIVIC_ALLOWED_PROXIES (comma-separated full proxy URLs); anything else is rejected (HTTP 400 or an ERROR envelope). Configure proxies server-side.

Access can vary by deployment, endpoint, and time. Historical regional tests do not establish a current geo-block or WAF cause. Stop after bounded attempts; do not bypass authenticated tiers or repeatedly retry access controls.

The current unified REST app does not implement API-key authentication or per-client rate-limit middleware. Setting CIVIC_API_KEY or CIVIC_RATE_LIMIT alone does not enable either. CIVIC_ALLOWED_PROXIES only gates caller-supplied proxies; it is not an SSRF allowlist for SDK calls. Deploy behind your own authentication, quotas, and network controls. Bind loopback for local use. Module acquisition rate limiters are not public-API abuse controls.

Agent Skills installation

SKILL.md is the portable skill entry point. Its metadata version is "1.2.1"; it uses trigger phrases in description, not unsupported frontmatter keys. Installation must retain the complete repository, especially references/usage.md and the other bundled references, package code, manifest, and licenses. The installed directory must be named indonesia-civic-stack.

For a host that supports a user-selected skills directory:

bash
# Set this to your host's configured directory; destination must not already exist.git clone https://github.com/suryast/indonesia-civic-stack.git "$SKILLS_DIR/indonesia-civic-stack"cd "$SKILLS_DIR/indonesia-civic-stack"pip install -e ".[mcp]"  # if running the bundled MCP code

Do not install only SKILL.md, and do not rename the package to a release worktree's suffix. Host discovery and Python installation are separate steps. For version-pinned installs, choose the reviewed release revision explicitly; cloning the default branch is not a version pin.

Development and offline verification

bash
git clone https://github.com/suryast/indonesia-civic-stack.gitcd indonesia-civic-stackpython -m venv .venv && source .venv/bin/activatepip install -e ".[all,dev]"
pytest --collect-only -q   # derive current collected tests; no fixed advertised totalpytest -v                 # mocked/VCR replay; no live portal calls intendedpytest tests/jdih/ tests/ksei/ tests/djpb/ -vruff check civic_stack/ tests/ scripts/ examples/ app.py server.pyruff format --check civic_stack/ tests/ scripts/ examples/ app.py server.pymypy civic_stack/

All 14 modules have test files, including JDIH, KSEI, and DJPB. A passing offline suite validates fixtures/mocks, not upstream operation. Do not record live cassettes in CI; review the actual test isolation and recording settings first.

Read AGENTS.md, CLAUDE.md, and CONTRIBUTING.md before development. The contribution guide states the desired full module contract; the implemented surfaces above take precedence over older blanket inventory statements in other documents.

References and related projects

License

The root skill/documentation license is MIT; see LICENSE. Module licensing varies; retain module license files and consult LICENSES.md (its older modules/ labels refer to the current civic_stack/ package directories).

来源:README.md,提交 727127b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Civic 集成