Skip to main content
Glama

pph21-mcp

An MCP server that lets AI assistants calculate Indonesian employee income tax (PPh 21) using the official TER scheme (PP 58/2023, PMK 168/2023) accurately, instead of guessing the numbers.

Server MCP untuk menghitung PPh 21 pegawai tetap dengan skema TER secara akurat, sehingga asisten AI tidak perlu menebak angka pajak.

Disclaimer / Peringatan: This is an estimate, not tax advice. Verify with DJP or a licensed tax consultant. Hasil ini hanya estimasi, bukan nasihat pajak. Pastikan ke DJP atau konsultan pajak resmi.

What it does / Fungsinya

Ask your assistant things like:

  • "Gaji saya Rp15.000.000 dan status K/0. Berapa PPh 21 bulanan saya?"

  • "Hitung PPh 21 Desember untuk gaji Rp15 juta, iuran pensiun Rp150 ribu per bulan, status K/0."

  • "Status K/2 masuk kategori TER apa?"

Everything is calculated locally. No salary data is sent anywhere, no API key, no network access.

Related MCP server: kalkulatory-place

Tools

Tool

What it does

calculate_pph21_monthly

PPh 21 for a regular month (January-November) using the TER table.

calculate_pph21_december

PPh 21 for December (final period): annual Article 17 tax minus TER already withheld. A negative result means over-withholding.

get_ter_category

TER category (A/B/C) and annual PTKP for a status such as K/1.

get_ter_table

The full official monthly TER table for category A, B or C.

Install / Pasang

Requires Python 3.10+.

pip install git+https://github.com/srositad/pph21-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "pph21": { "command": "pph21-mcp" }
  }
}

Accuracy and sources / Akurasi dan sumber

  • TER tables (A: 44 rows, B: 40, C: 41): Lampiran PP 58/2023, read from the official PDF and cross-checked against independent published copies.

  • Category per PTKP status: PMK 168/2023. PTKP amounts: PMK 101/PMK.010/2016. Article 17 brackets: UU PPh as amended by UU HPP (5% / 15% / 25% / 30% / 35%).

  • The test suite reproduces official worked examples, including the DJP leaflet example for Tuan R (December PPh 21 = Rp1.155.000) and the PMK 168/2023 monthly examples.

  • As of the last check (December 2026) PTKP and the TER tables had not changed. If the rules change, this tool will be out of date. Please open an issue.

Not supported yet / Belum didukung

Results are only correct for the cases below. For anything else, use the official DJP calculator.

  • Permanent employees (pegawai tetap) only. No daily TER, non-employee income, severance (pesangon), pensioners or board members.

  • December calculation requires a full 12 months. Employees who joined or left mid-year are not supported.

  • No combined-spouse-income PTKP (K/I/x).

  • No 20% surcharge for taxpayers without NPWP/NIK registration.

  • No government-borne (DTP) incentives.

  • Tax amounts are rounded down to whole rupiah, and taxable income (PKP) down to the nearest thousand. Your payroll system may round differently by a few rupiah.

Development

git clone https://github.com/srositad/pph21-mcp
cd pph21-mcp
pip install -e ".[dev]"
pytest

Contributions are welcome, especially corrections against official examples.

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to perform Japanese invoice and tax calculations, including consumption tax, withholding tax, invoice number validation, and invoice data generation, all locally without external APIs.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to compute accurate Polish payroll figures, including net-to-gross salary conversions, hourly rates, and statutory tax/ZUS data, matching the results on kalkulatory-place.pl to the cent.
      57 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude, Cursor, or ChatGPT to compute Indonesian payroll reliably instead of guessing: monthly and daily PPh 21 TER withholding, December Pasal 17 reconciliation, and BPJS Ketenagakerjaan/Kesehatan contributions. Each call returns a cited breakdown, and a rule-listing tool shows which dated rates and caps are loaded.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to calculate take-home pay, employer cost, and cross-country salary comparisons, and to look up official income tax and social security tables for 24 countries with tax-year and source citations.
      14
      629 npm
      MIT